]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
perf report: Make -D print sampled CPU
authorStephane Eranian <eranian@google.com>
Fri, 28 May 2010 10:08:01 +0000 (12:08 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 5 Jun 2010 12:32:24 +0000 (09:32 -0300)
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
tools/perf/util/event.c

index 3592057829648a8d3f8ac909f93a10a729640b68..207da1849800abcc09ef974067a8b2b290ebae2b 100644 (file)
@@ -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;
index 1f08f008d289f841f7ae0089462129f97e313afc..891753255f54502586edf39e6fd694b45eb0885c 100644 (file)
@@ -765,7 +765,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;