[PATCH v10 0/1] perf jevents: Check the keys of the JSON tables
From: TAKANO Mitsuhiro
Date: Thu Nov 12 2026 - 22:44:08 EST
v10, and an apology for v9. The two fixes v9 describes were not in the
diff it carried: the commit that holds them was made on another branch and
the series was built without it, so v9 was v8 again with a new cover. The
review was right about both, and this time the code is in the patch.
- --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 v9 (and since v8, which is what v9 carried):
- --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 | 48 +++++++++++++++++++++++++
tools/perf/tests/shell/jevents_check.sh | 36 +++++++++++++++++++
2 files changed, 84 insertions(+)
create mode 100755 tools/perf/tests/shell/jevents_check.sh
base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
--
2.53.0