diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-05-31 18:43:07 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-05-31 18:43:07 -0400 |
commit | dd833d713ccc79e00176eb1b3a6c65638c44e27b (patch) | |
tree | 96f04a64e8d67f6dd5fc5f77882fc97ee840ec8b /tools/perf | |
parent | af64865ba6825e10fe62a3105fea5cadffeb52c6 (diff) |
perf: Do the comm inheritance per thread in event__process_task
event__process_task() doesn't propagate the comm copy on clone,
but only on process fork. So we loose all the tid:comm resolution
for tasks that aren't a main process thread.
Progragate the per thread granularity to event__process_task for
pid resolution.
This fixes various unresolved pids in perf sched, especially when
we trace multithread processes. The problem is quickly reproducible
with the messaging benchmark using the multithread mode "-t" :
perf sched record perf bench sched messaging -t
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Stephane Eranian <eranian@google.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/event.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index d28d80968f36..1f08f008d289 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -532,16 +532,11 @@ out_problem: | |||
532 | 532 | ||
533 | int event__process_task(event_t *self, struct perf_session *session) | 533 | int event__process_task(event_t *self, struct perf_session *session) |
534 | { | 534 | { |
535 | struct thread *thread = perf_session__findnew(session, self->fork.pid); | 535 | struct thread *thread = perf_session__findnew(session, self->fork.tid); |
536 | struct thread *parent = perf_session__findnew(session, self->fork.ppid); | 536 | struct thread *parent = perf_session__findnew(session, self->fork.ptid); |
537 | 537 | ||
538 | dump_printf("(%d:%d):(%d:%d)\n", self->fork.pid, self->fork.tid, | 538 | dump_printf("(%d:%d):(%d:%d)\n", self->fork.pid, self->fork.tid, |
539 | self->fork.ppid, self->fork.ptid); | 539 | self->fork.ppid, self->fork.ptid); |
540 | /* | ||
541 | * A thread clone will have the same PID for both parent and child. | ||
542 | */ | ||
543 | if (thread == parent) | ||
544 | return 0; | ||
545 | 540 | ||
546 | if (self->header.type == PERF_RECORD_EXIT) | 541 | if (self->header.type == PERF_RECORD_EXIT) |
547 | return 0; | 542 | return 0; |