From: TAKANO Mitsuhiro <takano32@gmail.com>
To: linux-perf-users@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>
Cc: Ian Rogers <irogers@google.com>,
James Clark <james.clark@linaro.org>,
John Garry <john.garry@linux.dev>,
linux-kernel@vger.kernel.org,
TAKANO Mitsuhiro <takano32@gmail.com>
Subject: [PATCH v6 0/3] perf jevents: Check the JSON keys a table may carry
Date: Wed, 11 Nov 2026 15:09:17 +0000 [thread overview]
Message-ID: <20261111150920.2383157-1-takano32@gmail.com> (raw)
In-Reply-To: <20261111132622.2349165-1-takano32@gmail.com>
jevents.py takes the fields it wants out of each JSON object by name and
ignores the rest, so a key spelled differently is dropped without a word
and the object is built without whatever that field held. Two of those
are in the tree: "PublicDescrition" in 16 entries of an Arm table, where
the lost long description repeated the brief one and so nothing a user saw
changed, and "BriefDescript6ion" in one entry each of three AMD tables,
where the event is generated with no text at all.
Patch 3 says which keys a table may carry and checks the tree against
that, instead of reporting the keys a run of jevents.py did not read. The
list is 51 names, 47 of which jevents.py reads, one more of which
metric.py reads, and three of which nothing reads although the tables hold
them (Counter, CountersNumFixed, CountersNumGeneric). A key outside the
list is reported with the object that carries it; there is no cut-off, no
similarity and nothing that depends on what a run of the generator
happened to read. It is not a JSON schema because perf's build would then
require jsonschema, which it does not use today and which is not in every
builder's python; the list holds the same names that a schema with
"additionalProperties": false would.
The other two patches are small reader fixes that came out of the same
work, and patch 3 stands on its own if you would rather take only the
check:
- patch 2 makes the model argument optional, so "jevents.py x86 <dir>"
runs by
hand, which is how the check was tried out.
- patch 1 stops the generator from dying with an AttributeError on a
metric
that has a name and no MetricExpr, which is the same kind of silent JSON
problem, and names the metric and the file when it does.
The single patch posted first (20261110193239) was version 1 of this
check, before those fixes were written; v3 turned it into a series and v5
replaced its body with the list above.
v6 changes two things the review found. Patch 1 now names the file as
well as the metric, because the tables are read through a worker pool
outside the directory walk and the path was lost on the way out. The
test's one-line description ends in "(no_mlock)", so perf test lists it
whole and the test does not take a memlock slot.
The check still runs as "make check-jevents" and as a perf test rather
than as part of the build, so the generated tables are byte identical, and
on the tree today it reports exactly the two misspellings above, which are
posted separately.
Link: https://lore.kernel.org/linux-perf-users/20261108183846.3804875-1-takano32@gmail.com/
Link: https://lore.kernel.org/linux-perf-users/20261108184600.3810059-1-takano32@gmail.com/
TAKANO Mitsuhiro (3):
perf jevents: Name the metric and the file when a MetricExpr is
missing
perf jevents: Make the model argument optional
perf jevents: Check the JSON keys a table may carry
tools/perf/Makefile | 13 +-
tools/perf/Makefile.perf | 1 +
tools/perf/pmu-events/jevents.py | 229 ++++++++++++++++++++----
tools/perf/tests/shell/jevents_check.sh | 61 +++++++
4 files changed, 272 insertions(+), 32 deletions(-)
create mode 100755 tools/perf/tests/shell/jevents_check.sh
base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
--
2.53.0
next prev parent reply other threads:[~2026-11-11 15:09 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 22:22 [PATCH 0/3] perf jevents: Report the JSON keys that jevents.py never reads TAKANO Mitsuhiro
2026-11-10 22:22 ` [PATCH 1/3] perf jevents: Name the metric when a MetricExpr is missing TAKANO Mitsuhiro
2026-11-10 22:22 ` [PATCH 2/3] perf jevents: Make the model argument optional TAKANO Mitsuhiro
2026-11-10 22:22 ` [PATCH 3/3] perf jevents: Check the JSON keys that jevents.py never reads TAKANO Mitsuhiro
2026-11-11 2:34 ` [PATCH v2 0/3] perf jevents: Report " TAKANO Mitsuhiro
2026-11-11 2:34 ` [PATCH v2 1/3] perf jevents: Name the metric when a MetricExpr is missing TAKANO Mitsuhiro
2026-11-11 2:34 ` [PATCH v2 2/3] perf jevents: Make the model argument optional TAKANO Mitsuhiro
2026-11-11 2:34 ` [PATCH v2 3/3] perf jevents: Check the JSON keys that jevents.py never reads TAKANO Mitsuhiro
2026-11-11 3:43 ` [PATCH v3 0/3] perf jevents: Report " TAKANO Mitsuhiro
2026-11-11 3:43 ` [PATCH v3 1/3] perf jevents: Name the metric when a MetricExpr is missing TAKANO Mitsuhiro
2026-11-11 3:43 ` [PATCH v3 2/3] perf jevents: Make the model argument optional TAKANO Mitsuhiro
2026-11-11 3:43 ` [PATCH v3 3/3] perf jevents: Check the JSON keys that jevents.py never reads TAKANO Mitsuhiro
2026-11-11 4:10 ` [PATCH v4 0/3] perf jevents: Report " TAKANO Mitsuhiro
2026-11-11 4:10 ` [PATCH v4 1/3] perf jevents: Name the metric when a MetricExpr is missing TAKANO Mitsuhiro
2026-11-11 4:10 ` [PATCH v4 2/3] perf jevents: Make the model argument optional TAKANO Mitsuhiro
2026-11-11 4:10 ` [PATCH v4 3/3] perf jevents: Check the JSON keys that jevents.py never reads TAKANO Mitsuhiro
2026-11-11 13:26 ` [PATCH v5 0/3] perf jevents: Check the JSON keys a table may carry TAKANO Mitsuhiro
2026-11-11 13:26 ` [PATCH v5 1/3] perf jevents: Name the metric when a MetricExpr is missing TAKANO Mitsuhiro
2026-11-11 13:26 ` [PATCH v5 2/3] perf jevents: Make the model argument optional TAKANO Mitsuhiro
2026-11-11 13:26 ` [PATCH v5 3/3] perf jevents: Check the JSON keys a table may carry TAKANO Mitsuhiro
2026-11-11 15:09 ` TAKANO Mitsuhiro [this message]
2026-11-11 15:09 ` [PATCH v6 1/3] perf jevents: Name the metric and the file when a MetricExpr is missing TAKANO Mitsuhiro
2026-11-11 15:09 ` [PATCH v6 2/3] perf jevents: Make the model argument optional TAKANO Mitsuhiro
2026-11-11 15:09 ` [PATCH v6 3/3] perf jevents: Check the JSON keys a table may carry TAKANO Mitsuhiro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261111150920.2383157-1-takano32@gmail.com \
--to=takano32@gmail.com \
--cc=acme@kernel.org \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=john.garry@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®