]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
perf: Add attr->precise support to raw event parsing
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Thu, 4 Mar 2010 12:57:24 +0000 (13:57 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 10 Mar 2010 12:23:32 +0000 (13:23 +0100)
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>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: paulus@samba.org
Cc: eranian@google.com
Cc: robert.richter@amd.com
Cc: fweisbec@gmail.com
LKML-Reference: <20100304140100.468665803@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/util/parse-events.c

index 05d0c5c2030cbd5d8bfac67c00fc341404419465..a2014459125aad2ead6782da1983f78ea746d700 100644 (file)
@@ -656,6 +656,10 @@ parse_raw_event(const char **strp, struct perf_event_attr *attr)
                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;