[PATCH v12 0/2] perf jevents: Fail the build on a key the tables may not carry

From: TAKANO Mitsuhiro

Date: Fri Nov 20 2026 - 08:43:01 EST


v12. James asked for the raise and nothing else, so the try/except
plumbing v11 carried is gone: the generator already names the file it was
reading and the exception names the keys it did not expect.

What is left is two hunks in jevents.py: _valid_keys, and the check in
JsonEvent.__init__ that every event and metric table goes through.
(metricgroups.json is a plain dictionary of group names and is not
checked.) The test is jevents_bad_key.sh and checks the failing case only.

1/2 is the prerequisite James asked for: the mainline tree carries 19
objects with a key the tables may not carry, so 2/2 cannot land on an
unfixed tree. It is the two fixes posted on their own, squashed, so the
series stands by itself. The AMD half went into perf-tools-next on
11 November; the arm64 half is acked by Ilkka but not applied. If your
tree has both, 2/2 is all that is left; if it has the AMD half only,
apply 1/2 with -3 (its AMD hunks are already there) and then 2/2.

Measured on 1/2 + 2/2: the generator run over all architectures, over x86
alone and over arm64 alone exits 0. Putting EvendtName into one AMD table
makes the x86 run exit 1, with "Exception processing <path>" on stdout and
a traceback ending in "ValueError: Unknown keys: ['EvendtName']".

Changes since v11:

- the try/except changes and the sys.exit() are dropped (James)
- the message reads "Unknown keys: [...]"; the test comment says the keys
a table may carry, not the keys the generator reads

TAKANO Mitsuhiro (2):
perf vendor events: Fix misspelled keys in the event tables
perf jevents: Fail the build on a key the tables may not carry

.../arch/arm64/ampere/ampereonex/mmu.json | 32 ++++++------
.../pmu-events/arch/x86/amdzen4/cache.json | 2 +-
.../arch/x86/amdzen5/load-store.json | 2 +-
.../arch/x86/amdzen6/load-store.json | 2 +-
tools/perf/pmu-events/jevents.py | 24 +++++++++
tools/perf/tests/shell/jevents_bad_key.sh | 52 +++++++++++++++++++
6 files changed, 95 insertions(+), 19 deletions(-)
create mode 100755 tools/perf/tests/shell/jevents_bad_key.sh


base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
--
2.53.0