perf tools: Add fake pmu support
authorJiri Olsa <jolsa@kernel.org>
Tue, 2 Jun 2020 21:47:29 +0000 (23:47 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 22 Jun 2020 19:28:08 +0000 (16:28 -0300)
commit387ad33fe710758a8e1b860819a7452bceb4329a
tree828d4602012381d3408f3f6308cff02c3471109a
parenta1f8bc95c33e953e080f72be4b95176dacb423b0
perf tools: Add fake pmu support

Add a way to create a pmu event without the actual PMU being in place.

This way we can test metrics defined for any processor.

The interface is to define fake_pmu in struct parse_events_state data.
It will be used only in tests via special interface function added in
following changes.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
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>
Link: http://lore.kernel.org/lkml/20200602214741.1218986-2-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/parse-events.c
tools/perf/util/parse-events.h
tools/perf/util/parse-events.l
tools/perf/util/parse-events.y