path: root/tools/perf/builtin-script.c
diff options
authorArnaldo Carvalho de Melo <>2016-03-22 18:23:43 -0300
committerArnaldo Carvalho de Melo <>2016-03-23 12:03:07 -0300
commit473398a21d28c089555117a8db4ea04e371dd03c (patch)
tree23aedcb836ef40362aa4bee4f625352b708fc492 /tools/perf/builtin-script.c
parenteb9f03231b7a27999abe22d3c5f71700338630c6 (diff)
perf tools: Add cpumode to struct perf_sample
To avoid parsing event->header.misc in many locations. This will also allow setting perf.sample.{ip,cpumode} in a single place, from tracepoint fields, as needed by 'perf kvm' with PPC guests, where the guest hardware counters is not available at the host. Cc: Adrian Hunter <> Cc: Hemant Kumar <> Cc: Jiri Olsa <> Cc: Namhyung Kim <> Cc: Naveen N. Rao <> Cc: Ravi Bangoria <> Cc: Wang Nan <> Link: Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf/builtin-script.c')
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index d04c8e7a9507..928a4411e023 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -498,14 +498,13 @@ static void print_sample_brstack(union perf_event *event __maybe_unused,
-static void print_sample_brstacksym(union perf_event *event,
+static void print_sample_brstacksym(union perf_event *event __maybe_unused,
struct perf_sample *sample,
struct thread *thread __maybe_unused,
struct perf_event_attr *attr __maybe_unused)
struct branch_stack *br = sample->branch_stack;
struct addr_location alf, alt;
- u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
u64 i, from, to;
if (!(br && br->nr))
@@ -518,11 +517,11 @@ static void print_sample_brstacksym(union perf_event *event,
from = br->entries[i].from;
to = br->entries[i].to;
- thread__find_addr_map(thread, cpumode, MAP__FUNCTION, from, &alf);
+ thread__find_addr_map(thread, sample->cpumode, MAP__FUNCTION, from, &alf);
if (
alf.sym = map__find_symbol(, alf.addr, NULL);
- thread__find_addr_map(thread, cpumode, MAP__FUNCTION, to, &alt);
+ thread__find_addr_map(thread, sample->cpumode, MAP__FUNCTION, to, &alt);
if (
alt.sym = map__find_symbol(, alt.addr, NULL);