]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf jevents: Add legacy-hardware and legacy-cache json
authorIan Rogers <irogers@google.com>
Sun, 5 Oct 2025 18:24:16 +0000 (11:24 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 15 Oct 2025 14:59:11 +0000 (23:59 +0900)
commit0012e0fa221bf9cc54aa6a0e94d848653dc781bb
tree2ca65b111a29d3ef612e62d3d854d8cc0ac9ddb5
parent249a4c6d0165b2ad32f97e6b929718178c70b00e
perf jevents: Add legacy-hardware and legacy-cache json

The legacy-hardware.json is added containing hardware events similarly
to the software.json file. A difference is that for the software PMU
the name is known and matches sysfs. In the legacy-hardware.json no
Unit/PMU is specified for the events meaning default_core is used and
the events will appear for all core PMUs.

There are potentially 1216 legacy cache events, rather than list them
in a json file add a make_legacy_cache.py helper to generate them.

By using json for legacy hardware and cache events: descriptions of
the events can be added; events can be marked as deprecated, such as
those misleadingly named l2 (deprecated is also used to mark all
events that weren't previously displayed in perf list); and the name
lookup becomes case insensitive.

The C string encoding all the perf events and metrics is increased in
size by 123,499 bytes which will increase the perf binary size. Later
changes will remove hard coded event parsing for legacy hardware and
cache events, turning parsing overhead into a binary search during
event lookup.

That event descriptions are based off of those in perf_event_open man
page, credit to Vince Weaver <vincent.weaver@maine.edu>.

Tested-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: James Clark <james.clark@linaro.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/pmu-events/Build
tools/perf/pmu-events/arch/common/common/legacy-hardware.json [new file with mode: 0644]
tools/perf/pmu-events/empty-pmu-events.c
tools/perf/pmu-events/make_legacy_cache.py [new file with mode: 0755]