diff mbox series

[5/8] trace-cruncher: Rename python function argument in PyFtrace_eprobe

Message ID 20220210152339.363943-6-y.karadz@gmail.com (mailing list archive)
State Accepted
Headers show
Series trace-cruncher:Fixes before v0.2 (Beta) | expand

Commit Message

Yordan Karadzhov Feb. 10, 2022, 3:23 p.m. UTC
The keyword (named) argument of the eprobe constrictor is renamed from
'fetchargs' to 'fetch_fields'. This is done because the old name can be
confusing, since the probe is supposed to fetch a field of event (not a
function argument). The new name also makes a better match with the
'snake case' naming convention used in trace-cruncher.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 examples/syscall_trace.py                           | 2 +-
 src/ftracepy-utils.c                                | 2 +-
 tracecruncher/tests/1_unit/test_01_ftracepy_unit.py | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/examples/syscall_trace.py b/examples/syscall_trace.py
index 7d6f399..bfa56ed 100755
--- a/examples/syscall_trace.py
+++ b/examples/syscall_trace.py
@@ -24,7 +24,7 @@  args = 'file=+0($file):ustring delta_T=$delta_T:s64'
 
 eprobe = ft.eprobe(event=eprobe_evt,
                    target_system='synthetic', target_event=synth_evt,
-                   fetchargs=args)
+                   fetch_fields=args)
 
 synth = ft.synth(name=synth_evt,
                  start_sys='syscalls', start_evt='sys_enter_' + syscall,
diff --git a/src/ftracepy-utils.c b/src/ftracepy-utils.c
index b262c19..20f0cd9 100644
--- a/src/ftracepy-utils.c
+++ b/src/ftracepy-utils.c
@@ -2366,7 +2366,7 @@  struct tep_event *dynevent_get_event(PyDynevent *event,
 
 PyObject *PyFtrace_eprobe(PyObject *self, PyObject *args, PyObject *kwargs)
 {
-	static char *kwlist[] = {"event", "target_system", "target_event", "fetchargs", NULL};
+	static char *kwlist[] = {"event", "target_system", "target_event", "fetch_fields", NULL};
 	const char *event, *target_system, *target_event, *fetchargs;
 	struct tracefs_dynevent *eprobe;
 	PyObject *py_dyn;
diff --git a/tracecruncher/tests/1_unit/test_01_ftracepy_unit.py b/tracecruncher/tests/1_unit/test_01_ftracepy_unit.py
index f942b6b..6fdd053 100644
--- a/tracecruncher/tests/1_unit/test_01_ftracepy_unit.py
+++ b/tracecruncher/tests/1_unit/test_01_ftracepy_unit.py
@@ -473,13 +473,13 @@  class EprobeTestCase(unittest.TestCase):
         evt2_args = 'res=$ret:u64'
 
         ep1 = ft.eprobe(event=evt1, target_system=evt1_tsys, target_event=evt1_tevent,
-                        fetchargs=evt1_args)
+                        fetch_fields=evt1_args)
         self.assertEqual(evt1, ep1.event())
         self.assertEqual("{}.{}".format(evt1_tsys, evt1_tevent), ep1.address())
         self.assertEqual(evt1_args, ep1.probe())
 
         ep2 = ft.eprobe(event=evt2, target_system=evt2_tsys, target_event=evt2_tevent,
-                        fetchargs=evt2_args)
+                        fetch_fields=evt2_args)
         self.assertEqual(evt2, ep2.event())
         self.assertEqual("{}.{}".format(evt2_tsys, evt2_tevent), ep2.address())
         self.assertEqual(evt2_args, ep2.probe())
@@ -496,7 +496,7 @@  class EprobeTestCase(unittest.TestCase):
         evt1_args = 'res=$ret:u64'
 
         ep1 = ft.eprobe(event=evt1, target_system=evt1_tsys, target_event=evt1_tevent,
-                        fetchargs=evt1_args)
+                        fetch_fields=evt1_args)
         ep1.register()
         inst = ft.create_instance(instance_name)
         ep1.enable(instance=inst)