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

TAKANO Mitsuhiro takano32 at gmail.com
Thu Nov 19 22:09:29 PST 2026


v11.  The shape is James's: the check is not an option any more, so a
typo in a key stops the build instead of being dropped without a word.

--check is gone.  Every event and metric table goes through
JsonEvent.__init__, so the keys of each object are compared there with
_valid_keys.  No new option, no second walk over the directory, and no way
to run the generator without the check.  (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 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.  The AMD one went into
perf-tools-next on 11 November and the arm64 v2 has Ilkka's Acked-by, so if
both are in your tree, 2/2 is all that is left; if the AMD one is in but
the arm64 one is not, 1/2 will need -3 or its AMD hunks dropped.

Measured: on 1/2 + 2/2, the generator run over all architectures, over
x86 alone and over arm64 alone exits 0.  Putting BriefDescript6ion back
into one AMD table makes the x86 run exit 1 with "jevents.py: <path>:
unknown key(s): ['BriefDescript6ion']"; the arm64 run does not read the
x86 tables and still exits 0.

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              | 70 +++++++++++++++----
 tools/perf/tests/shell/jevents_bad_key.sh     | 43 ++++++++++++
 6 files changed, 117 insertions(+), 34 deletions(-)
 create mode 100755 tools/perf/tests/shell/jevents_bad_key.sh


base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
-- 
2.53.0




More information about the linux-arm-kernel mailing list