[PATCH 07/14] perf: Add attr->precise support to raw event parsing

Peter Zijlstra
2010-03-04T14:02:00Z

[-- Attachment #1: perf-tools-precise.patch --]
[-- Type: text/plain, Size: 816 bytes --]

Minimal userspace interface to the new 'precise' events flag.

Can be used like: perf top -e r00c0p
Which will use PEBS to sample retired instructions

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
---
tools/perf/util/parse-events.c | 5 +++++
1 file changed, 5 insertions(+)

Index: linux-2.6/tools/perf/util/parse-events.c
===================================================================
--- linux-2.6.orig/tools/perf/util/parse-events.c
+++ linux-2.6/tools/perf/util/parse-events.c
@@ -656,6 +656,10 @@ parse_raw_event(const char **strp, struc
return EVT_FAILED;
n = hex2u64(str + 1, &config);
if (n > 0) {
+ if (str[n+1] == 'p') {
+ attr->precise = 1;
+ n++;
+ }
*strp = str + n + 1;
attr->type = PERF_TYPE_RAW;
attr->config = config;

--