From: Peter Zijlstra Date: Thu, 4 Mar 2010 12:57:24 +0000 (+0100) Subject: perf: Add attr->precise support to raw event parsing X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=69fef0d2e2c2c049ef4207a52e78b50d527bd85a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git perf: Add attr->precise support to raw event parsing 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 Cc: Arnaldo Carvalho de Melo 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 --- diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 05d0c5c2030c..a2014459125a 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -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;