[PATCH v2 0/2] perf jevents: Add IOMMU PTW & device entry metrics
From: Jacob Lefkowitz via B4 Relay
Date: Mon Nov 02 2026 - 17:57:06 EST
Adds AMD specific metrics for the IOMMU with respect to page table
walks and device table entires. The metrics cover ratios, rates, and
percentages with respect to any event which might be triggered during
a page table walk or device table entry lookup.
The metrics target Zen 2+ processors and use the standard amd_iommu
PMU events. All metrics are tested with 'sleep 10' and behave as
expected. An example output of sleep 10 is provided within each
individual change.
The changes are split into two patches:
1. perf jevents: add iommu page table walk metrics
2. perf jevents: add amd specific device table entry metrics
The specific metris added are:
- lpm_iommu_dte_miss_rate
- lpm_iommu_dte_lookups
- lpm_iommu_ptw_reads_per_tlb_miss
- lpm_iommu_ptw_nested_read_ratio
- lpm_iommu_ptw_guest_read_ratio
- lpm_iommu_trans_per_sec
Signed-off-by: Jacob Lefkowitz <jlefkowi@xxxxxxxxxx>
---
Changes in v2:
- Drop min() wrappers d_ratio() for the IOMMU ratio metrics: min(NaN, 1)
evaluated to 1, reporting a false 100% on sockets with no amd_counts
- Did not test with previously mentioned custom workload and did not add
to the workloads collection. The workload stressed the CPU TLB,
but the IOMMU only translates device DMA, so the load never reaches
the IOMMU.
- Remove unused min import
- Remove global declaration of '_zen_model' within each function
- Link to v1: https://lore.kernel.org/r/20261029-perf-tools-next-v1-0-a75a2b64a15e@xxxxxxxxxx
---
Jacob Lefkowitz (2):
perf jevents: add iommu page table walk metrics
perf jevents: add amd specific device table entry metrics
tools/perf/pmu-events/amd_metrics.py | 75 ++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)
---
base-commit: 1c90f0a3c8a1c4e38f9edd97af9e20848805a7fb
change-id: 20261028-perf-tools-next-8fd1d433316a
Best regards,
--
Jacob Lefkowitz <jlefkowi@xxxxxxxxxx>