public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] perf pmu-events AMD: Switch l2_itlb_misses to bp_l1_tlb_miss_l2_tlb_miss.all
@ 2026-04-14 17:58 Ian Rogers
  2026-04-15  6:03 ` Sandipan Das
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Rogers @ 2026-04-14 17:58 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Alexander Shishkin, Jiri Olsa, Ian Rogers,
	Adrian Hunter, James Clark, Ravi Bangoria, Sandipan Das,
	linux-perf-users, linux-kernel

l2_itlb_misses is a valid legacy cache event name, hence allowing it
in all_events in metric.py. l2_itlb_misses was also a json event for
AMD zen1, zen2 and zen3. For zen4, zen5 and zen6 the checking that
metric events are within the json was skipping l2_itlb_misses as it is
a valid legacy event, however, the PMU driver lacks the event mapping
causing it to be a bad event when used in the metric. Add
bp_l1_tlb_miss_l2_tlb_miss.all as the l2 itlb miss event (bp = branch
predictor, the AMD way to say itlb), so that is used in preference to
l2_itlb_misses when the event exists. Remove l2_itlb_misses from
metric.py as the legacy event isn't used by any metrics and having it
is error prone for newer AMD zen models.

Fixes: e596f329668e ("perf jevents: Add itlb metric group for AMD")
Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/pmu-events/amd_metrics.py | 2 +-
 tools/perf/pmu-events/metric.py      | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/pmu-events/amd_metrics.py b/tools/perf/pmu-events/amd_metrics.py
index 63e5098606c4..ee5381646a8d 100755
--- a/tools/perf/pmu-events/amd_metrics.py
+++ b/tools/perf/pmu-events/amd_metrics.py
@@ -287,7 +287,7 @@ def AmdDtlb() -> Optional[MetricGroup]:
 def AmdItlb():
     global _zen_model
     l2h = Event("bp_l1_tlb_miss_l2_tlb_hit", "bp_l1_tlb_miss_l2_hit")
-    l2m = Event("l2_itlb_misses")
+    l2m = Event("bp_l1_tlb_miss_l2_tlb_miss.all", "l2_itlb_misses",)
     l2r = l2h + l2m
 
     itlb_l1_mg = None
diff --git a/tools/perf/pmu-events/metric.py b/tools/perf/pmu-events/metric.py
index 0c41a502cf21..c1931b2a5170 100644
--- a/tools/perf/pmu-events/metric.py
+++ b/tools/perf/pmu-events/metric.py
@@ -25,7 +25,6 @@ def LoadEvents(directory: str) -> None:
       "cycles",
       "duration_time",
       "instructions",
-      "l2_itlb_misses",
   }
   for file in os.listdir(os.fsencode(directory)):
     filename = os.fsdecode(file)
-- 
2.54.0.rc0.605.g598a273b03-goog


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

* Re: [PATCH v1] perf pmu-events AMD: Switch l2_itlb_misses to bp_l1_tlb_miss_l2_tlb_miss.all
  2026-04-14 17:58 [PATCH v1] perf pmu-events AMD: Switch l2_itlb_misses to bp_l1_tlb_miss_l2_tlb_miss.all Ian Rogers
@ 2026-04-15  6:03 ` Sandipan Das
  0 siblings, 0 replies; 2+ messages in thread
From: Sandipan Das @ 2026-04-15  6:03 UTC (permalink / raw)
  To: Ian Rogers, Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Alexander Shishkin, Jiri Olsa, Adrian Hunter,
	James Clark, Ravi Bangoria, linux-perf-users, linux-kernel

On 14-04-2026 23:28, Ian Rogers wrote:
> l2_itlb_misses is a valid legacy cache event name, hence allowing it
> in all_events in metric.py. l2_itlb_misses was also a json event for
> AMD zen1, zen2 and zen3. For zen4, zen5 and zen6 the checking that
> metric events are within the json was skipping l2_itlb_misses as it is
> a valid legacy event, however, the PMU driver lacks the event mapping
> causing it to be a bad event when used in the metric. Add
> bp_l1_tlb_miss_l2_tlb_miss.all as the l2 itlb miss event (bp = branch
> predictor, the AMD way to say itlb), so that is used in preference to
> l2_itlb_misses when the event exists. Remove l2_itlb_misses from
> metric.py as the legacy event isn't used by any metrics and having it
> is error prone for newer AMD zen models.
> 
> Fixes: e596f329668e ("perf jevents: Add itlb metric group for AMD")
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
>  tools/perf/pmu-events/amd_metrics.py | 2 +-
>  tools/perf/pmu-events/metric.py      | 1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tools/perf/pmu-events/amd_metrics.py b/tools/perf/pmu-events/amd_metrics.py
> index 63e5098606c4..ee5381646a8d 100755
> --- a/tools/perf/pmu-events/amd_metrics.py
> +++ b/tools/perf/pmu-events/amd_metrics.py
> @@ -287,7 +287,7 @@ def AmdDtlb() -> Optional[MetricGroup]:
>  def AmdItlb():
>      global _zen_model
>      l2h = Event("bp_l1_tlb_miss_l2_tlb_hit", "bp_l1_tlb_miss_l2_hit")
> -    l2m = Event("l2_itlb_misses")
> +    l2m = Event("bp_l1_tlb_miss_l2_tlb_miss.all", "l2_itlb_misses",)
>      l2r = l2h + l2m
>  
>      itlb_l1_mg = None
> diff --git a/tools/perf/pmu-events/metric.py b/tools/perf/pmu-events/metric.py
> index 0c41a502cf21..c1931b2a5170 100644
> --- a/tools/perf/pmu-events/metric.py
> +++ b/tools/perf/pmu-events/metric.py
> @@ -25,7 +25,6 @@ def LoadEvents(directory: str) -> None:
>        "cycles",
>        "duration_time",
>        "instructions",
> -      "l2_itlb_misses",
>    }
>    for file in os.listdir(os.fsencode(directory)):
>      filename = os.fsdecode(file)

Reviewed-by: Sandipan Das <sandipan.das@amd.com>


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

end of thread, other threads:[~2026-04-15  6:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-14 17:58 [PATCH v1] perf pmu-events AMD: Switch l2_itlb_misses to bp_l1_tlb_miss_l2_tlb_miss.all Ian Rogers
2026-04-15  6:03 ` Sandipan Das

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