[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251113032040.1994090-28-irogers@google.com>
Date: Wed, 12 Nov 2025 19:20:15 -0800
From: Ian Rogers <irogers@...gle.com>
To: Adrian Hunter <adrian.hunter@...el.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Benjamin Gray <bgray@...ux.ibm.com>,
Caleb Biggers <caleb.biggers@...el.com>, Edward Baker <edward.baker@...el.com>,
Ian Rogers <irogers@...gle.com>, Ingo Molnar <mingo@...hat.com>,
James Clark <james.clark@...aro.org>, Jing Zhang <renyu.zj@...ux.alibaba.com>,
Jiri Olsa <jolsa@...nel.org>, John Garry <john.g.garry@...cle.com>, Leo Yan <leo.yan@....com>,
Namhyung Kim <namhyung@...nel.org>, Perry Taylor <perry.taylor@...el.com>,
Peter Zijlstra <peterz@...radead.org>, Samantha Alt <samantha.alt@...el.com>,
Sandipan Das <sandipan.das@....com>, Thomas Falcon <thomas.falcon@...el.com>,
Weilin Wang <weilin.wang@...el.com>, Xu Yang <xu.yang_2@....com>, linux-kernel@...r.kernel.org,
linux-perf-users@...r.kernel.org
Subject: [PATCH v8 27/52] perf jevents: Add uop cache hit/miss rates for AMD
Add metrics giving ratio of uop cache hits to misses.
Signed-off-by: Ian Rogers <irogers@...gle.com>
---
tools/perf/pmu-events/amd_metrics.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/tools/perf/pmu-events/amd_metrics.py b/tools/perf/pmu-events/amd_metrics.py
index da50337557f5..b2e3e2883022 100755
--- a/tools/perf/pmu-events/amd_metrics.py
+++ b/tools/perf/pmu-events/amd_metrics.py
@@ -584,6 +584,23 @@ def AmdSwpf() -> Optional[MetricGroup]:
description="Software prefetch breakdown (CCX L3 = L3 of current thread, Loc CCX = CCX cache on some socket)")
+def AmdUopCache() -> Optional[MetricGroup]:
+ try:
+ op_cache_hit = Event("op_cache_hit_miss.op_cache_hit")
+ op_cache_miss = Event("op_cache_hit_miss.op_cache_miss")
+ except:
+ return None
+ op_cache_total = op_cache_hit + op_cache_miss
+ return MetricGroup("lpm_uop_cache", [
+ Metric("lpm_uop_cache_hit_ratio", "Uop cache full or partial hits rate",
+ d_ratio(op_cache_hit, op_cache_total),
+ "100%"),
+ Metric("lpm_uop_cache_miss_ratio", "Uop cache misses rate",
+ d_ratio(op_cache_miss, op_cache_total),
+ "100%"),
+ ], description="Micro-op (uop) hit and miss rates.")
+
+
def AmdUpc() -> Metric:
ops = Event("ex_ret_ops", "ex_ret_cops")
upc = d_ratio(ops, smt_cycles)
@@ -675,6 +692,7 @@ def main() -> None:
AmdLdSt(),
AmdHwpf(),
AmdSwpf(),
+ AmdUopCache(),
AmdUpc(),
Idle(),
Rapl(),
--
2.51.2.1041.gc1ab5b90ca-goog
Powered by blists - more mailing lists