perf jevents: Use "default_core" for events with no Unit
authorIan Rogers <irogers@google.com>
Sat, 26 Aug 2023 06:22:03 +0000 (23:22 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 29 Aug 2023 17:16:15 +0000 (14:16 -0300)
commitd2045f87154bf67a50ebefe28d2ca0e1e3f8eef1
treee69825ea0fd11e7fdd031eedef38d3b582da77f0
parenta84260e314029e6dc9904fd6eabf8d9fd7965351
perf jevents: Use "default_core" for events with no Unit

The JSON Unit field encodes the name of the PMU to match the events
to. When no name is given it has meant the "cpu" core PMU except for
tests.

On ARM, Intel hybrid and s390 the core PMU is named differently which
means that using "cpu" for this case causes the events not to get
matched to the PMU.

Introduce a new "default_core" string for this case and in the
pmu__name_match force all core PMUs to match this name.

Fixes: 2e255b4f9f41f137 ("perf jevents: Group events by PMU")
Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Reported-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20230826062203.1058041-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/pmu-events/jevents.py
tools/perf/tests/pmu-events.c
tools/perf/util/pmu.c