aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/scripting-engines/trace-event-perl.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2013-07-18 18:06:15 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-07-22 10:55:53 -0400
commit2eaa1b407aa6592a884f1be061ef61de7012c97a (patch)
tree0d488f803b833cde76946aebda09024f5c9860a3 /tools/perf/util/scripting-engines/trace-event-perl.c
parent5a9821321e0a61674fd5c4b5a9e95007d0e7e052 (diff)
perf script: Fix named threads support
Commit 73994dc broke named thread support in perf-script. The thread struct in al is the main thread for a multithreaded process. The thread struct used for analysis (e.g., dumping events) should be the specific thread for the sample. Signed-off-by: David Ahern <dsahern@gmail.com> Cc: Feng Tang <feng.tang@intel.com> Link: http://lkml.kernel.org/r/1374185175-28272-1-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-perl.c')
-rw-r--r--tools/perf/util/scripting-engines/trace-event-perl.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c
index eacec859f299..a85e4ae5f3ac 100644
--- a/tools/perf/util/scripting-engines/trace-event-perl.c
+++ b/tools/perf/util/scripting-engines/trace-event-perl.c
@@ -261,7 +261,8 @@ static void perl_process_tracepoint(union perf_event *perf_event __maybe_unused,
261 struct perf_sample *sample, 261 struct perf_sample *sample,
262 struct perf_evsel *evsel, 262 struct perf_evsel *evsel,
263 struct machine *machine __maybe_unused, 263 struct machine *machine __maybe_unused,
264 struct addr_location *al) 264 struct thread *thread,
265 struct addr_location *al)
265{ 266{
266 struct format_field *field; 267 struct format_field *field;
267 static char handler[256]; 268 static char handler[256];
@@ -272,7 +273,6 @@ static void perl_process_tracepoint(union perf_event *perf_event __maybe_unused,
272 int cpu = sample->cpu; 273 int cpu = sample->cpu;
273 void *data = sample->raw_data; 274 void *data = sample->raw_data;
274 unsigned long long nsecs = sample->time; 275 unsigned long long nsecs = sample->time;
275 struct thread *thread = al->thread;
276 char *comm = thread->comm; 276 char *comm = thread->comm;
277 277
278 dSP; 278 dSP;
@@ -351,7 +351,8 @@ static void perl_process_event_generic(union perf_event *event,
351 struct perf_sample *sample, 351 struct perf_sample *sample,
352 struct perf_evsel *evsel, 352 struct perf_evsel *evsel,
353 struct machine *machine __maybe_unused, 353 struct machine *machine __maybe_unused,
354 struct addr_location *al __maybe_unused) 354 struct thread *thread __maybe_unused,
355 struct addr_location *al __maybe_unused)
355{ 356{
356 dSP; 357 dSP;
357 358
@@ -377,10 +378,11 @@ static void perl_process_event(union perf_event *event,
377 struct perf_sample *sample, 378 struct perf_sample *sample,
378 struct perf_evsel *evsel, 379 struct perf_evsel *evsel,
379 struct machine *machine, 380 struct machine *machine,
380 struct addr_location *al) 381 struct thread *thread,
382 struct addr_location *al)
381{ 383{
382 perl_process_tracepoint(event, sample, evsel, machine, al); 384 perl_process_tracepoint(event, sample, evsel, machine, thread, al);
383 perl_process_event_generic(event, sample, evsel, machine, al); 385 perl_process_event_generic(event, sample, evsel, machine, thread, al);
384} 386}
385 387
386static void run_start_sub(void) 388static void run_start_sub(void)