diff options
Diffstat (limited to 'tools/perf/util/event.c')
-rw-r--r-- | tools/perf/util/event.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 50771b5813ee..2fbf6a463c81 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -370,9 +370,9 @@ static int thread__set_comm_adjust(struct thread *self, const char *comm) | |||
370 | 370 | ||
371 | int event__process_comm(event_t *self, struct perf_session *session) | 371 | int event__process_comm(event_t *self, struct perf_session *session) |
372 | { | 372 | { |
373 | struct thread *thread = perf_session__findnew(session, self->comm.pid); | 373 | struct thread *thread = perf_session__findnew(session, self->comm.tid); |
374 | 374 | ||
375 | dump_printf(": %s:%d\n", self->comm.comm, self->comm.pid); | 375 | dump_printf(": %s:%d\n", self->comm.comm, self->comm.tid); |
376 | 376 | ||
377 | if (thread == NULL || thread__set_comm_adjust(thread, self->comm.comm)) { | 377 | if (thread == NULL || thread__set_comm_adjust(thread, self->comm.comm)) { |
378 | dump_printf("problem processing PERF_RECORD_COMM, skipping event.\n"); | 378 | dump_printf("problem processing PERF_RECORD_COMM, skipping event.\n"); |
@@ -532,19 +532,16 @@ 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) { |
542 | perf_session__remove_thread(session, thread); | ||
547 | return 0; | 543 | return 0; |
544 | } | ||
548 | 545 | ||
549 | if (thread == NULL || parent == NULL || | 546 | if (thread == NULL || parent == NULL || |
550 | thread__fork(thread, parent) < 0) { | 547 | thread__fork(thread, parent) < 0) { |