diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-03-22 17:23:43 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-03-23 11:03:07 -0400 |
commit | 473398a21d28c089555117a8db4ea04e371dd03c (patch) | |
tree | 23aedcb836ef40362aa4bee4f625352b708fc492 /tools/perf/util/session.c | |
parent | eb9f03231b7a27999abe22d3c5f71700338630c6 (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 <adrian.hunter@intel.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-qp3yradhyt6q3wl895b1aat0@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r-- | tools/perf/util/session.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 60b3593d210d..4abd85c6346d 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -1107,12 +1107,11 @@ static struct machine *machines__find_for_cpumode(struct machines *machines, | |||
1107 | union perf_event *event, | 1107 | union perf_event *event, |
1108 | struct perf_sample *sample) | 1108 | struct perf_sample *sample) |
1109 | { | 1109 | { |
1110 | const u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; | ||
1111 | struct machine *machine; | 1110 | struct machine *machine; |
1112 | 1111 | ||
1113 | if (perf_guest && | 1112 | if (perf_guest && |
1114 | ((cpumode == PERF_RECORD_MISC_GUEST_KERNEL) || | 1113 | ((sample->cpumode == PERF_RECORD_MISC_GUEST_KERNEL) || |
1115 | (cpumode == PERF_RECORD_MISC_GUEST_USER))) { | 1114 | (sample->cpumode == PERF_RECORD_MISC_GUEST_USER))) { |
1116 | u32 pid; | 1115 | u32 pid; |
1117 | 1116 | ||
1118 | if (event->header.type == PERF_RECORD_MMAP | 1117 | if (event->header.type == PERF_RECORD_MMAP |