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/tests/code-reading.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/tests/code-reading.c')
-rw-r--r-- | tools/perf/tests/code-reading.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c index afc9ad0a0515..abd3f0ec0c0b 100644 --- a/tools/perf/tests/code-reading.c +++ b/tools/perf/tests/code-reading.c | |||
@@ -293,7 +293,6 @@ static int process_sample_event(struct machine *machine, | |||
293 | { | 293 | { |
294 | struct perf_sample sample; | 294 | struct perf_sample sample; |
295 | struct thread *thread; | 295 | struct thread *thread; |
296 | u8 cpumode; | ||
297 | int ret; | 296 | int ret; |
298 | 297 | ||
299 | if (perf_evlist__parse_sample(evlist, event, &sample)) { | 298 | if (perf_evlist__parse_sample(evlist, event, &sample)) { |
@@ -307,9 +306,7 @@ static int process_sample_event(struct machine *machine, | |||
307 | return -1; | 306 | return -1; |
308 | } | 307 | } |
309 | 308 | ||
310 | cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; | 309 | ret = read_object_code(sample.ip, READLEN, sample.cpumode, thread, state); |
311 | |||
312 | ret = read_object_code(sample.ip, READLEN, cpumode, thread, state); | ||
313 | thread__put(thread); | 310 | thread__put(thread); |
314 | return ret; | 311 | return ret; |
315 | } | 312 | } |