aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/scripting-engines/trace-event-python.c
diff options
context:
space:
mode:
authorAdrian Hunter <[email protected]>2021-05-30 19:22:58 +0000
committerArnaldo Carvalho de Melo <[email protected]>2021-06-01 13:03:02 +0000
commitcac30400a6d8159e2510a4a258db9c4ac6fbbba5 (patch)
treec8084b376db57a363461f224d21d1f6471676743 /tools/perf/util/scripting-engines/trace-event-python.c
parentperf scripting python: Simplify perf-trace-context module functions (diff)
downloadkernel-cac30400a6d8159e2510a4a258db9c4ac6fbbba5.tar.gz
kernel-cac30400a6d8159e2510a4a258db9c4ac6fbbba5.zip
perf scripting: Add scripting_context__update()
Move scripting_context update to a separate function and add the arguments of ->process_event() to it. This prepares the way for adding more methods to the perf_trace_context module, by providing the context information that they will need. Signed-off-by: Adrian Hunter <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Jiri Olsa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
-rw-r--r--tools/perf/util/scripting-engines/trace-event-python.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index ffc5f4cffdba..d99f71916af7 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -897,9 +897,6 @@ static void python_process_tracepoint(struct perf_sample *sample,
s = nsecs / NSEC_PER_SEC;
ns = nsecs - s * NSEC_PER_SEC;
- scripting_context->event_data = data;
- scripting_context->pevent = evsel->tp_format->tep;
-
context = _PyCapsule_New(scripting_context, NULL, NULL);
PyTuple_SetItem(t, n++, _PyUnicode_FromString(handler_name));
@@ -1403,6 +1400,8 @@ static void python_process_event(union perf_event *event,
{
struct tables *tables = &tables_global;
+ scripting_context__update(scripting_context, event, sample, evsel, al, addr_al);
+
switch (evsel->core.attr.type) {
case PERF_TYPE_TRACEPOINT:
python_process_tracepoint(sample, evsel, al, addr_al);