[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250829041104.4186320-18-irogers@google.com>
Date: Thu, 28 Aug 2025 21:10:58 -0700
From: Ian Rogers <irogers@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
Kan Liang <kan.liang@...ux.intel.com>, James Clark <james.clark@...aro.org>,
Xu Yang <xu.yang_2@....com>, linux-kernel@...r.kernel.org,
linux-perf-users@...r.kernel.org, John Garry <john.g.garry@...cle.com>,
Jing Zhang <renyu.zj@...ux.alibaba.com>, Sandipan Das <sandipan.das@....com>,
Benjamin Gray <bgray@...ux.ibm.com>, Perry Taylor <perry.taylor@...el.com>,
Samantha Alt <samantha.alt@...el.com>, Caleb Biggers <caleb.biggers@...el.com>,
Weilin Wang <weilin.wang@...el.com>, Edward Baker <edward.baker@...el.com>,
Thomas Falcon <thomas.falcon@...el.com>
Subject: [PATCH v5 17/22] perf jevents: Add local/remote "mem" breakdown
metrics for Intel
Breakdown local and remote memory bandwidth, read and writes. The
implementation uses the HA and CHA PMUs present in server models
broadwellde, broadwellx cascadelakex, emeraldrapids, haswellx,
icelakex, ivytown, sapphirerapids and skylakex.
Signed-off-by: Ian Rogers <irogers@...gle.com>
---
tools/perf/pmu-events/intel_metrics.py | 27 ++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/tools/perf/pmu-events/intel_metrics.py b/tools/perf/pmu-events/intel_metrics.py
index 82a5b037edf9..782bc7f8926b 100755
--- a/tools/perf/pmu-events/intel_metrics.py
+++ b/tools/perf/pmu-events/intel_metrics.py
@@ -800,6 +800,32 @@ def IntelLdSt() -> Optional[MetricGroup]:
], description = "Breakdown of load/store instructions")
+def UncoreMem() -> Optional[MetricGroup]:
+ try:
+ loc_rds = Event("UNC_CHA_REQUESTS.READS_LOCAL", "UNC_H_REQUESTS.READS_LOCAL")
+ rem_rds = Event("UNC_CHA_REQUESTS.READS_REMOTE", "UNC_H_REQUESTS.READS_REMOTE")
+ loc_wrs = Event("UNC_CHA_REQUESTS.WRITES_LOCAL", "UNC_H_REQUESTS.WRITES_LOCAL")
+ rem_wrs = Event("UNC_CHA_REQUESTS.WRITES_REMOTE", "UNC_H_REQUESTS.WRITES_REMOTE")
+ except:
+ return None
+
+ scale = 64 / 1_000_000
+ return MetricGroup("lpm_mem", [
+ MetricGroup("lpm_mem_local", [
+ Metric("lpm_mem_local_read", "Local memory read bandwidth not including directory updates",
+ d_ratio(loc_rds, interval_sec), f"{scale}MB/s"),
+ Metric("lpm_mem_local_write", "Local memory write bandwidth not including directory updates",
+ d_ratio(loc_wrs, interval_sec), f"{scale}MB/s"),
+ ]),
+ MetricGroup("lpm_mem_remote", [
+ Metric("lpm_mem_remote_read", "Remote memory read bandwidth not including directory updates",
+ d_ratio(rem_rds, interval_sec), f"{scale}MB/s"),
+ Metric("lpm_mem_remote_write", "Remote memory write bandwidth not including directory updates",
+ d_ratio(rem_wrs, interval_sec), f"{scale}MB/s"),
+ ]),
+ ], description = "Memory Bandwidth breakdown local vs. remote (remote requests in). directory updates not included")
+
+
def UncoreMemBw() -> Optional[MetricGroup]:
mem_events = []
try:
@@ -897,6 +923,7 @@ def main() -> None:
IntelMlp(),
IntelPorts(),
IntelSwpf(),
+ UncoreMem(),
UncoreMemBw(),
])
--
2.51.0.318.gd7df087d1a-goog
Powered by blists - more mailing lists