public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Isaacson <adi@vmware.com>
To: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] perf: timechart: handle pthreads correctly
Date: Thu, 1 Apr 2010 13:04:46 -0700	[thread overview]
Message-ID: <20100401200446.GB8434@vmware.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 928 bytes --]

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;
 }
 

[-- Attachment #2: after.svg.gz --]
[-- Type: application/octet-stream, Size: 12447 bytes --]

[-- Attachment #3: before.svg.gz --]
[-- Type: application/octet-stream, Size: 10731 bytes --]

                 reply	other threads:[~2010-04-01 20:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100401200446.GB8434@vmware.com \
    --to=adi@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox