Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH v1 0/3] perf pmu: Add tool-provided NVMe PMU
@ 2026-06-09  7:03 Ian Rogers
  2026-06-09  7:03 ` [PATCH v1 1/3] perf build: Add libnvme feature detection Ian Rogers
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ian Rogers @ 2026-06-09  7:03 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Jiri Olsa, Ian Rogers, Adrian Hunter, James Clark,
	Tomas Glozar, Michael Jeanson, Dmitrii Dolgov, Alexandre Chartre,
	Yuzhuo Jing, Leo Yan, German Gomez, Anubhav Shelat, linux-kernel,
	linux-perf-users
  Cc: linux-nvme

This patch series introduces a tool-provided PMU for NVMe devices to expose
various hardware logs as perf events.

Using libnvme, the new nvme_pmu extracts metrics from standard NVMe log pages
including:
- SMART / Health Information (e.g. data units read/written, power cycles,
  temperature)
- Endurance Group Information
- FDP (Flexible Data Placement) Statistics
- Error Information
- Zoned Namespaces (ZNS) Changed Zones

Key features:
- Dynamic probing of supported log pages on /dev/nvmeX. Unsupported events
  are marked as deprecated and hidden from `perf list` by default.
- Generic configuration encoding where the log type, size, and offset are
  encoded directly into the event configuration.
- Correct interval delta tracking using baseline offset snapshots. This mimics
  the behavior of the hwmon PMU, allowing gauges like Temperature to be
  reported instantaneously in `perf stat -I`, while standard counters
  correctly accumulate deltas.
- Robust handling of cross-architecture endianness when reading 128-bit and
  64-bit fields from the NVMe specification.

The series is broken down into:
1. Adding the libnvme feature detection via pkg-config in tools/build.
2. The core implementation of the NVMe tool PMU.
3. A unit test suite verifying the parsing and encoding of the NVMe PMU
   events using a mocked device.

Ian Rogers (3):
  perf build: Add libnvme feature detection
  perf pmu: Implement tool-provided NVMe PMU
  perf tests: Add NVMe PMU event parsing test

 tools/build/Makefile.feature       |   2 +
 tools/build/feature/Makefile       |   3 +
 tools/build/feature/test-libnvme.c |  11 +
 tools/perf/Makefile.config         |  12 +
 tools/perf/tests/Build             |   1 +
 tools/perf/tests/builtin-test.c    |   1 +
 tools/perf/tests/nvme_pmu.c        | 176 ++++++++++
 tools/perf/tests/tests.h           |   1 +
 tools/perf/util/Build              |   1 +
 tools/perf/util/evsel.c            |  11 +-
 tools/perf/util/nvme_pmu.c         | 535 +++++++++++++++++++++++++++++
 tools/perf/util/nvme_pmu.h         | 143 ++++++++
 tools/perf/util/pmu.c              |  15 +
 tools/perf/util/pmu.h              |   8 +-
 tools/perf/util/pmus.c             |  31 +-
 tools/perf/util/pmus.h             |   1 +
 16 files changed, 945 insertions(+), 7 deletions(-)
 create mode 100644 tools/build/feature/test-libnvme.c
 create mode 100644 tools/perf/tests/nvme_pmu.c
 create mode 100644 tools/perf/util/nvme_pmu.c
 create mode 100644 tools/perf/util/nvme_pmu.h

-- 
2.54.0.1064.gd145956f57-goog


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-09  7:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09  7:03 [PATCH v1 0/3] perf pmu: Add tool-provided NVMe PMU Ian Rogers
2026-06-09  7:03 ` [PATCH v1 1/3] perf build: Add libnvme feature detection Ian Rogers
2026-06-09  7:12   ` sashiko-bot
2026-06-09  7:03 ` [PATCH v1 2/3] perf pmu: Implement tool-provided NVMe PMU Ian Rogers
2026-06-09  7:21   ` sashiko-bot
2026-06-09  7:03 ` [PATCH v1 3/3] perf tests: Add NVMe PMU event parsing test Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox