[PATCH] perf: timechart: handle pthreads correctly

Previous thread: Re: [PATCH 2/3] can: add support for Janz VMOD-ICAN3 Intelligent CAN module by Andrew Morton on Thursday, April 1, 2010 - 1:03 pm. (2 messages)

Next thread: Re: [PATCH] SCSI: improve arcmsr's error handlers on lk2.6.33 by Andrew Morton on Thursday, April 1, 2010 - 1:12 pm. (1 message)
From: Andrew Isaacson
Date: Thursday, April 1, 2010 - 1:04 pm

pthreads applications have multiple processes with the same "pid" but
different "tid" values.  This confuses timechart, because it's using
the "pid" value to track processes.

Switch to using "tid" to avoid this confusion.  For non-pthreads
applications tid == pid so there's no downside.

Signed-off-by: Andy Isaacson <adi@vmware.com>

---
I've attached a before.svg.gz and after.svg.gz showing the failure.

diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 0d4d8ff..5b925de 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -286,7 +286,7 @@ static int process_comm_event(event_t *event, struct perf_session *session __use
 
 static int process_fork_event(event_t *event, struct perf_session *session __used)
 {
-	pid_fork(event->fork.pid, event->fork.ppid, event->fork.time);
+	pid_fork(event->fork.tid, event->fork.ppid, event->fork.time);
 	return 0;
 }
 
Previous thread: Re: [PATCH 2/3] can: add support for Janz VMOD-ICAN3 Intelligent CAN module by Andrew Morton on Thursday, April 1, 2010 - 1:03 pm. (2 messages)

Next thread: Re: [PATCH] SCSI: improve arcmsr's error handlers on lk2.6.33 by Andrew Morton on Thursday, April 1, 2010 - 1:12 pm. (1 message)