linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: linux-trace-devel@vger.kernel.org
Cc: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Subject: [PATCH 5/8] trace-cruncher: Rename python function argument in PyFtrace_eprobe
Date: Thu, 10 Feb 2022 17:23:36 +0200	[thread overview]
Message-ID: <20220210152339.363943-6-y.karadz@gmail.com> (raw)
In-Reply-To: <20220210152339.363943-1-y.karadz@gmail.com>

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 --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)
-- 
2.32.0


  parent reply	other threads:[~2022-02-10 15:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 15:23 [PATCH 0/8] trace-cruncher:Fixes before v0.2 (Beta) Yordan Karadzhov (VMware)
2022-02-10 15:23 ` [PATCH 1/8] trace-cruncher: Prefix all python class names with 'tc_' Yordan Karadzhov (VMware)
2022-02-10 15:23 ` [PATCH 2/8] trace-cruncher: Fix bug in the constructor if tc_synth class Yordan Karadzhov (VMware)
2022-02-10 15:23 ` [PATCH 3/8] trace-cruncher: Add tests for synth helper APIs Yordan Karadzhov (VMware)
2022-02-10 15:23 ` [PATCH 4/8] trace-cruncher: Code cleanup in the constructor of tc_synth Yordan Karadzhov (VMware)
2022-02-10 15:23 ` Yordan Karadzhov (VMware) [this message]
2022-02-10 15:23 ` [PATCH 6/8] trace-cruncher: Add tc_eprobe class to ft_utiles Yordan Karadzhov (VMware)
2022-02-10 15:23 ` [PATCH 7/8] trace-cruncher: Check kernel support in the eprobe constructor Yordan Karadzhov (VMware)
2022-02-10 15:23 ` [PATCH 8/8] trace-cruncher: Add more comments to the examples Yordan Karadzhov (VMware)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220210152339.363943-6-y.karadz@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).