Commit 761844b9 authored by Stephane Eranian's avatar Stephane Eranian Committed by Arnaldo Carvalho de Melo

perf report: Make -D print sampled CPU

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 <>
Cc: Frédéric Weisbecker <>
Cc: Ingo Molnar <>
Cc: Paul Mackerras <>
Cc: Peter Zijlstra <>
Cc: Tom Zanussi <>
LKML-Reference: <>
Signed-off-by: default avatarStephane Eranian <>
Signed-off-by: default avatarArnaldo Carvalho de Melo <>
parent 58cc1a9e
......@@ -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.tid, data.ip, data.period);
dump_printf("(IP, %d): %d/%d: %#Lx period: %Ld cpu:%d\n",
event->header.misc,, data.tid, data.ip,
data.period, data.cpu);
if (session->sample_type & PERF_SAMPLE_CALLCHAIN) {
unsigned int i;
......@@ -765,7 +765,8 @@ int event__parse_sample(event_t *event, u64 type, struct sample_data *data)
u32 *p = (u32 *)array;
data->cpu = *p;
} else
data->cpu = -1;
if (type & PERF_SAMPLE_PERIOD) {
data->period = *array;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment