diff options
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
-rw-r--r-- | tools/perf/util/scripting-engines/trace-event-python.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index e87aa5d9696b..cc75a3cef388 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c | |||
@@ -225,6 +225,7 @@ static void python_process_tracepoint(union perf_event *perf_event | |||
225 | struct perf_sample *sample, | 225 | struct perf_sample *sample, |
226 | struct perf_evsel *evsel, | 226 | struct perf_evsel *evsel, |
227 | struct machine *machine __maybe_unused, | 227 | struct machine *machine __maybe_unused, |
228 | struct thread *thread, | ||
228 | struct addr_location *al) | 229 | struct addr_location *al) |
229 | { | 230 | { |
230 | PyObject *handler, *retval, *context, *t, *obj, *dict = NULL; | 231 | PyObject *handler, *retval, *context, *t, *obj, *dict = NULL; |
@@ -238,7 +239,6 @@ static void python_process_tracepoint(union perf_event *perf_event | |||
238 | int cpu = sample->cpu; | 239 | int cpu = sample->cpu; |
239 | void *data = sample->raw_data; | 240 | void *data = sample->raw_data; |
240 | unsigned long long nsecs = sample->time; | 241 | unsigned long long nsecs = sample->time; |
241 | struct thread *thread = al->thread; | ||
242 | char *comm = thread->comm; | 242 | char *comm = thread->comm; |
243 | 243 | ||
244 | t = PyTuple_New(MAX_FIELDS); | 244 | t = PyTuple_New(MAX_FIELDS); |
@@ -345,12 +345,12 @@ static void python_process_general_event(union perf_event *perf_event | |||
345 | struct perf_sample *sample, | 345 | struct perf_sample *sample, |
346 | struct perf_evsel *evsel, | 346 | struct perf_evsel *evsel, |
347 | struct machine *machine __maybe_unused, | 347 | struct machine *machine __maybe_unused, |
348 | struct thread *thread, | ||
348 | struct addr_location *al) | 349 | struct addr_location *al) |
349 | { | 350 | { |
350 | PyObject *handler, *retval, *t, *dict; | 351 | PyObject *handler, *retval, *t, *dict; |
351 | static char handler_name[64]; | 352 | static char handler_name[64]; |
352 | unsigned n = 0; | 353 | unsigned n = 0; |
353 | struct thread *thread = al->thread; | ||
354 | 354 | ||
355 | /* | 355 | /* |
356 | * Use the MAX_FIELDS to make the function expandable, though | 356 | * Use the MAX_FIELDS to make the function expandable, though |
@@ -404,17 +404,18 @@ static void python_process_event(union perf_event *perf_event, | |||
404 | struct perf_sample *sample, | 404 | struct perf_sample *sample, |
405 | struct perf_evsel *evsel, | 405 | struct perf_evsel *evsel, |
406 | struct machine *machine, | 406 | struct machine *machine, |
407 | struct thread *thread, | ||
407 | struct addr_location *al) | 408 | struct addr_location *al) |
408 | { | 409 | { |
409 | switch (evsel->attr.type) { | 410 | switch (evsel->attr.type) { |
410 | case PERF_TYPE_TRACEPOINT: | 411 | case PERF_TYPE_TRACEPOINT: |
411 | python_process_tracepoint(perf_event, sample, evsel, | 412 | python_process_tracepoint(perf_event, sample, evsel, |
412 | machine, al); | 413 | machine, thread, al); |
413 | break; | 414 | break; |
414 | /* Reserve for future process_hw/sw/raw APIs */ | 415 | /* Reserve for future process_hw/sw/raw APIs */ |
415 | default: | 416 | default: |
416 | python_process_general_event(perf_event, sample, evsel, | 417 | python_process_general_event(perf_event, sample, evsel, |
417 | machine, al); | 418 | machine, thread, al); |
418 | } | 419 | } |
419 | } | 420 | } |
420 | 421 | ||