summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/parse-events.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2020-07-26 09:52:44 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-07-30 07:01:48 -0300
commit4929e95a1400e45b4b5a87fd3ce10273444187d4 (patch)
treef6d9cd2ccb8fe558f493981eacd9a7c781aa10e7 /tools/perf/util/parse-events.h
parentc33cdf541181fae3dbcfbd79e40b11b0efe8c3d8 (diff)
downloadlinux-stable-4929e95a1400e45b4b5a87fd3ce10273444187d4.tar.gz
linux-stable-4929e95a1400e45b4b5a87fd3ce10273444187d4.tar.bz2
linux-stable-4929e95a1400e45b4b5a87fd3ce10273444187d4.zip
perf tools: Fix term parsing for raw syntax
Jin Yao reported issue with possible conflict between raw events and term values in pmu event syntax. Currently following syntax is resolved as raw event with 0xead value: uncore_imc_free_running/read/ instead of using 'read' term from uncore_imc_free_running pmu, because 'read' is correct raw event syntax with 0xead value. To solve this issue we do following: - check existing terms during rXXXX syntax processing and make them priority in case of conflict - allow pmu/r0x1234/ syntax to be able to specify conflicting raw event (implemented in previous patch) Also add automated tests for this and perf_pmu__parse_cleanup call to parse_events_terms, so the test gets properly cleaned up. Fixes: 3a6c51e4d66c ("perf parser: Add support to specify rXXX event with pmu") Reported-by: Jin Yao <yao.jin@linux.intel.com> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Tested-by: Jin Yao <yao.jin@linux.intel.com> Acked-by: Ian 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/20200726075244.1191481-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-events.h')
-rw-r--r--tools/perf/util/parse-events.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index f0010095fc8c..00cde7d2e30c 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -261,4 +261,6 @@ static inline bool is_sdt_event(char *str __maybe_unused)
}
#endif /* HAVE_LIBELF_SUPPORT */
+int perf_pmu__test_parse_init(void);
+
#endif /* __PERF_PARSE_EVENTS_H */