perf: timechart: handle pthreads correctly
PATCH 1/1 perf: timechart: handle pthreads correctly
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 <[email protected]>
---
I've attached a before.svg.gz and after.svg.gz showing the failure.
tools/perf/builtin-timechart.c +1 -1
@@ -286,7 +286,7 @@ static int process_comm_event(event_t *event, struct perf_session *session __usestatic 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 ; }