From: Besar Wicaksono <bwicaksono@nvidia.com>
To: <acme@kernel.org>, <namhyung@kernel.org>, <irogers@google.com>
Cc: <linux-tegra@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-perf-users@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <vsethi@nvidia.com>,
<rwiley@nvidia.com>, <skelley@nvidia.com>, <mochs@nvidia.com>,
<rajjoshi@nvidia.com>, <treding@nvidia.com>,
<jonathanh@nvidia.com>, <john.garry@linux.dev>, <will@kernel.org>,
<james.clark@linaro.org>, <mike.leach@arm.com>,
<leo.yan@linux.dev>, <mark.rutland@arm.com>,
<alexander.shishkin@linux.intel.com>, <jolsa@kernel.org>,
<adrian.hunter@intel.com>, <ctshao@google.com>,
"Besar Wicaksono" <bwicaksono@nvidia.com>
Subject: [PATCH 1/6] perf jevents: Process model files before sys subdirectories
Date: Mon, 19 Oct 2026 16:42:36 +0000 [thread overview]
Message-ID: <20261019164241.403644-2-bwicaksono@nvidia.com> (raw)
In-Reply-To: <20261019164241.403644-1-bwicaksono@nvidia.com>
jevents walks each directory in name order, mixing files and
subdirectories. When it reaches a sys/ directory inside a model
directory, process_one_file() flushes the model's pending tables and
switches the pending table name to the sys table. After the walk
returns from sys/, nothing switches it back, so model JSON files whose
names sort after "sys" (for example tlb.json) are added to the sys
table. Sys tables are only matched by Compat against uncore PMU
identifiers, so these core events are lost: perf list doesn't show
them and perf stat rejects them.
Visit the files of a directory before its subdirectories, so that all
of a model's JSON files are added to the model's table before a sys/
subdirectory is processed. The generated pmu-events.c is unchanged for
the existing event directories.
Signed-off-by: Besar Wicaksono <bwicaksono@nvidia.com>
---
tools/perf/pmu-events/jevents.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py
index cc143f7e7cdf..ba974b2784b0 100755
--- a/tools/perf/pmu-events/jevents.py
+++ b/tools/perf/pmu-events/jevents.py
@@ -1463,7 +1463,9 @@ def main() -> None:
action: Callable[[Sequence[str], os.DirEntry], None]) -> None:
"""Replicate the directory/file walking behavior of C's file tree walk."""
assert _args is not None
- for item in sorted(os.scandir(path), key=lambda e: e.name):
+ # Visit a directory's files before its subdirectories, because
+ # entering a subdirectory switches the table that files are added to.
+ for item in sorted(os.scandir(path), key=lambda e: (e.is_dir(), e.name)):
if _args.model != 'all' and item.is_dir():
# Check if the model matches one in _args.model.
if len(parents) == _args.model.split(',')[0].count('/'):
--
2.43.0
next prev parent reply other threads:[~2026-10-19 16:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 16:42 [PATCH 0/6] perf jevents: Add NVIDIA Tegra410 uncore PMU events and metrics Besar Wicaksono
2026-10-19 16:42 ` Besar Wicaksono [this message]
2026-10-19 16:42 ` [PATCH 2/6] perf jevents: Add support for NVIDIA Tegra410 UCF PMU aliasing Besar Wicaksono
2026-10-19 16:42 ` [PATCH 3/6] perf jevents: Add support for NVIDIA Tegra410 PCIE " Besar Wicaksono
2026-10-19 17:50 ` Chun-Tse Shao
2026-10-19 16:42 ` [PATCH 4/6] perf jevents: Add support for NVIDIA Tegra410 PCIE-TGT " Besar Wicaksono
2026-10-19 23:18 ` Ian Rogers
2026-10-20 22:01 ` Besar Wicaksono
2026-10-20 23:12 ` Chun-Tse Shao
2026-10-19 16:42 ` [PATCH 5/6] perf jevents: Add support for NVIDIA Tegra410 CPU Memory Latency " Besar Wicaksono
2026-10-19 16:42 ` [PATCH 6/6] perf jevents: Add support for NVIDIA Tegra410 C2C " Besar Wicaksono
2026-10-19 17:23 ` [PATCH 0/6] perf jevents: Add NVIDIA Tegra410 uncore PMU events and metrics James Clark
2026-10-20 19:15 ` Arnaldo Carvalho de Melo
2026-10-20 20:32 ` Ian Rogers
2026-10-20 20:38 ` Arnaldo Melo
2026-10-20 22:14 ` Besar Wicaksono
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=20261019164241.403644-2-bwicaksono@nvidia.com \
--to=bwicaksono@nvidia.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=ctshao@google.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=john.garry@linux.dev \
--cc=jolsa@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=leo.yan@linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mike.leach@arm.com \
--cc=mochs@nvidia.com \
--cc=namhyung@kernel.org \
--cc=rajjoshi@nvidia.com \
--cc=rwiley@nvidia.com \
--cc=skelley@nvidia.com \
--cc=treding@nvidia.com \
--cc=vsethi@nvidia.com \
--cc=will@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®