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 | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index b9010d878b4b..24711b3536d3 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c | |||
@@ -225,7 +225,7 @@ static void python_process_tracepoint(union perf_event *perf_event __unused, | |||
225 | struct perf_sample *sample, | 225 | struct perf_sample *sample, |
226 | struct perf_evsel *evsel, | 226 | struct perf_evsel *evsel, |
227 | struct machine *machine __unused, | 227 | struct machine *machine __unused, |
228 | struct thread *thread) | 228 | struct addr_location *al) |
229 | { | 229 | { |
230 | PyObject *handler, *retval, *context, *t, *obj, *dict = NULL; | 230 | PyObject *handler, *retval, *context, *t, *obj, *dict = NULL; |
231 | static char handler_name[256]; | 231 | static char handler_name[256]; |
@@ -238,6 +238,7 @@ static void python_process_tracepoint(union perf_event *perf_event __unused, | |||
238 | int cpu = sample->cpu; | 238 | int cpu = sample->cpu; |
239 | void *data = sample->raw_data; | 239 | void *data = sample->raw_data; |
240 | unsigned long long nsecs = sample->time; | 240 | unsigned long long nsecs = sample->time; |
241 | struct thread *thread = al->thread; | ||
241 | char *comm = thread->comm; | 242 | char *comm = thread->comm; |
242 | 243 | ||
243 | t = PyTuple_New(MAX_FIELDS); | 244 | t = PyTuple_New(MAX_FIELDS); |
@@ -342,7 +343,7 @@ static void python_process_general_event(union perf_event *perf_event __unused, | |||
342 | struct perf_sample *sample, | 343 | struct perf_sample *sample, |
343 | struct perf_evsel *evsel, | 344 | struct perf_evsel *evsel, |
344 | struct machine *machine __unused, | 345 | struct machine *machine __unused, |
345 | struct thread *thread __unused) | 346 | struct addr_location *al __unused) |
346 | { | 347 | { |
347 | PyObject *handler, *retval, *t; | 348 | PyObject *handler, *retval, *t; |
348 | static char handler_name[64]; | 349 | static char handler_name[64]; |
@@ -361,7 +362,7 @@ static void python_process_general_event(union perf_event *perf_event __unused, | |||
361 | goto exit; | 362 | goto exit; |
362 | } | 363 | } |
363 | 364 | ||
364 | /* Pass 3 parameters: event_attr, perf_sample, raw data */ | 365 | /* Pass 4 parameters: event_attr, perf_sample, raw data, thread name */ |
365 | PyTuple_SetItem(t, n++, PyString_FromStringAndSize((void *)&evsel->attr, sizeof(evsel->attr))); | 366 | PyTuple_SetItem(t, n++, PyString_FromStringAndSize((void *)&evsel->attr, sizeof(evsel->attr))); |
366 | PyTuple_SetItem(t, n++, PyString_FromStringAndSize((void *)sample, sizeof(*sample))); | 367 | PyTuple_SetItem(t, n++, PyString_FromStringAndSize((void *)sample, sizeof(*sample))); |
367 | PyTuple_SetItem(t, n++, PyString_FromStringAndSize(data, sample->raw_size)); | 368 | PyTuple_SetItem(t, n++, PyString_FromStringAndSize(data, sample->raw_size)); |
@@ -380,17 +381,17 @@ static void python_process_event(union perf_event *perf_event, | |||
380 | struct perf_sample *sample, | 381 | struct perf_sample *sample, |
381 | struct perf_evsel *evsel, | 382 | struct perf_evsel *evsel, |
382 | struct machine *machine, | 383 | struct machine *machine, |
383 | struct thread *thread) | 384 | struct addr_location *al) |
384 | { | 385 | { |
385 | switch (evsel->attr.type) { | 386 | switch (evsel->attr.type) { |
386 | case PERF_TYPE_TRACEPOINT: | 387 | case PERF_TYPE_TRACEPOINT: |
387 | python_process_tracepoint(perf_event, sample, evsel, | 388 | python_process_tracepoint(perf_event, sample, evsel, |
388 | machine, thread); | 389 | machine, al); |
389 | break; | 390 | break; |
390 | /* Reserve for future process_hw/sw/raw APIs */ | 391 | /* Reserve for future process_hw/sw/raw APIs */ |
391 | default: | 392 | default: |
392 | python_process_general_event(perf_event, sample, evsel, | 393 | python_process_general_event(perf_event, sample, evsel, |
393 | machine, thread); | 394 | machine, al); |
394 | } | 395 | } |
395 | } | 396 | } |
396 | 397 | ||