[PATCH v9 0/1] perf jevents: Check the keys of the JSON tables
From: TAKANO Mitsuhiro
Date: Thu Nov 12 2026 - 17:50:10 EST
v9 of the check. The two points the review raised about the argument are
fixed, and the one about the tree is still left alone on purpose.
- --check on a directory that is not there used to report nothing and
exit 0, because nothing found under it reads the same as a tree with
no bad key. It now says so on stderr and exits 2, which is the code
the test already uses for "could not run".
- "--check=DIR" is taken as well as "--check DIR". The option is read
before the parser looks at the three positional arguments, so the
value could be left over and taken for the table directory.
The check itself is unchanged: walk, set difference against the list of 51
keys, print the file that carries the bad key, exit 1. On today's tree it
reports 19 keys in four tables:
arch/arm64/ampere/ampereonex/mmu.json PublicDescrition 16 objects
arch/x86/amdzen4/cache.json BriefDescript6ion 1 object
arch/x86/amdzen5/load-store.json BriefDescript6ion 1 object
arch/x86/amdzen6/load-store.json BriefDescript6ion 1 object
The point about the test checking a temporary table and never the tables
in the tree is right, and it is still not possible to add: the tree
carries the two misspellings above, and a test that fails the day it lands
is not one anyone wants. Once the patches that fix them are in, the test
can run against the tree as well - I would rather add that as a second
step than bake a list of known-bad files into the test now.
Changes since v8:
- --check reports a directory that is not there instead of passing it
- "--check=DIR" is accepted as well as "--check DIR"
TAKANO Mitsuhiro (1):
perf jevents: Check the keys of the JSON tables
tools/perf/pmu-events/jevents.py | 41 +++++++++++++++++++++++++
tools/perf/tests/shell/jevents_check.sh | 29 +++++++++++++++++
2 files changed, 70 insertions(+)
create mode 100755 tools/perf/tests/shell/jevents_check.sh
base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
--
2.53.0