Commit c33cdf54 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf tools: Allow r0x<HEX> event syntax

Add support to specify raw event with 'r0<HEX>' syntax within pmu term
syntax like:

  -e cpu/r0xdead/

It will be used to specify raw events in cases where they conflict with
real pmu terms, like 'read', which is valid raw event syntax, but also a
possible pmu term name as reported by Jin Yao.
Reported-by: default avatarJin Yao <yao.jin@linux.intel.com>
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Acked-by: default avatarIan Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Link: http://lore.kernel.org/lkml/20200725121959.1181869-1-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 3e43d79d
...@@ -119,6 +119,7 @@ It's also possible to use pmu syntax: ...@@ -119,6 +119,7 @@ It's also possible to use pmu syntax:
perf record -e r1a8 -a sleep 1 perf record -e r1a8 -a sleep 1
perf record -e cpu/r1a8/ ... perf record -e cpu/r1a8/ ...
perf record -e cpu/r0x1a8/ ...
You should refer to the processor specific documentation for getting these You should refer to the processor specific documentation for getting these
details. Some of them are referenced in the SEE ALSO section below. details. Some of them are referenced in the SEE ALSO section below.
......
...@@ -1766,6 +1766,11 @@ static struct evlist_test test__events_pmu[] = { ...@@ -1766,6 +1766,11 @@ static struct evlist_test test__events_pmu[] = {
.check = test__checkevent_raw_pmu, .check = test__checkevent_raw_pmu,
.id = 4, .id = 4,
}, },
{
.name = "software/r0x1a/",
.check = test__checkevent_raw_pmu,
.id = 4,
},
}; };
struct terms_test { struct terms_test {
......
...@@ -293,6 +293,7 @@ percore { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_PERCORE); } ...@@ -293,6 +293,7 @@ percore { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_PERCORE); }
aux-output { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT); } aux-output { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT); }
aux-sample-size { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE); } aux-sample-size { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE); }
r{num_raw_hex} { return raw(yyscanner); } r{num_raw_hex} { return raw(yyscanner); }
r0x{num_raw_hex} { return raw(yyscanner); }
, { return ','; } , { return ','; }
"/" { BEGIN(INITIAL); return '/'; } "/" { BEGIN(INITIAL); return '/'; }
{name_minus} { return str(yyscanner, PE_NAME); } {name_minus} { return str(yyscanner, PE_NAME); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment