From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
"Stephane Eranian" <eranian@google.com>,
"David S. Miller" <davem@davemloft.net>,
"Frédéric Weisbecker" <fweisbec@gmail.com>,
"Ingo Molnar" <mingo@elte.hu>,
"Paul Mackerras" <paulus@samba.org>,
"Peter Zijlstra" <peterz@infradead.org>,
"Tom Zanussi" <tzanussi@gmail.com>,
"Arnaldo Carvalho de Melo" <acme@redhat.com>
Subject: [PATCH 1/4] perf report: Make -D print sampled CPU
Date: Wed, 2 Jun 2010 17:40:12 -0300 [thread overview]
Message-ID: <1275511215-25703-2-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1275511215-25703-1-git-send-email-acme@infradead.org>
From: Stephane Eranian <eranian@google.com>
It is useful to know on which CPU a sample was captured on.
The information is captured with perf record -R but it was
not printed out by perf report -D. This patch adds this.
When -R is not used, cpu is set to -1to indicate that
the CPU is unknown (it is not captured).
Cc: David S. Miller <davem@davemloft.net>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <4bff964c.e88cd80a.3106.7d31@mx.google.com>
Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-report.c | 5 +++--
tools/perf/util/event.c | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 3592057..207da18 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -157,8 +157,9 @@ static int process_sample_event(event_t *event, struct perf_session *session)
event__parse_sample(event, session->sample_type, &data);
- dump_printf("(IP, %d): %d/%d: %#Lx period: %Ld\n", event->header.misc,
- data.pid, data.tid, data.ip, data.period);
+ dump_printf("(IP, %d): %d/%d: %#Lx period: %Ld cpu:%d\n",
+ event->header.misc, data.pid, data.tid, data.ip,
+ data.period, data.cpu);
if (session->sample_type & PERF_SAMPLE_CALLCHAIN) {
unsigned int i;
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 50771b5..58cb96b 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -770,7 +770,8 @@ int event__parse_sample(event_t *event, u64 type, struct sample_data *data)
u32 *p = (u32 *)array;
data->cpu = *p;
array++;
- }
+ } else
+ data->cpu = -1;
if (type & PERF_SAMPLE_PERIOD) {
data->period = *array;
--
1.6.2.5
next prev parent reply other threads:[~2010-06-02 20:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-02 20:40 [GIT PULL 0/4] Perf improvements for .36 (perf/core) Arnaldo Carvalho de Melo
2010-06-02 20:40 ` Arnaldo Carvalho de Melo [this message]
2010-06-02 20:40 ` [PATCH 2/4] perf tools: Add the ability to specify list of cpus to monitor Arnaldo Carvalho de Melo
2010-06-02 20:40 ` [PATCH 3/4] perf tools: Make target to generate self contained source tarball Arnaldo Carvalho de Melo
2010-06-03 9:02 ` Andi Kleen
2010-06-03 12:50 ` Arnaldo Carvalho de Melo
2010-06-03 17:26 ` Andi Kleen
2010-06-02 20:40 ` [PATCH 4/4] perf buildid: add perfconfig option to specify buildid cache dir Arnaldo Carvalho de Melo
2010-06-08 17:44 ` [GIT PULL 0/4] Perf improvements for .36 (perf/core) Ingo Molnar
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=1275511215-25703-2-git-send-email-acme@infradead.org \
--to=acme@infradead.org \
--cc=acme@redhat.com \
--cc=davem@davemloft.net \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=tzanussi@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).