[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251112-perf_support_arm_spev1-3-v3-20-e63c9829f9d9@arm.com>
Date: Wed, 12 Nov 2025 18:24:46 +0000
From: Leo Yan <leo.yan@....com>
To: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
James Clark <james.clark@...aro.org>, Mark Rutland <mark.rutland@....com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>,
linux-perf-users@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, Leo Yan <leo.yan@....com>
Subject: [PATCH v3 20/25] perf mem: Print extended fields
Print the extended operation types and affiliate info.
Signed-off-by: Leo Yan <leo.yan@....com>
---
tools/perf/util/mem-events.c | 66 ++++++++++++++++++++++++++++++++++++++++----
1 file changed, 60 insertions(+), 6 deletions(-)
diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c
index 80b3069427bc4bb5ffc3ab0856c01c76d9ba3ba6..c0aee982fb4f1a849c28a8bb01693855922832f6 100644
--- a/tools/perf/util/mem-events.c
+++ b/tools/perf/util/mem-events.c
@@ -413,11 +413,15 @@ static const char * const mem_hops[] = {
static int perf_mem__op_scnprintf(char *out, size_t sz, const struct mem_info *mem_info)
{
- u64 op = PERF_MEM_LOCK_NA;
+ union perf_mem_data_src data_src;
+ u64 op = PERF_MEM_OP_NA, ext_op = 0;
int l;
- if (mem_info)
- op = mem_info__const_data_src(mem_info)->mem_op;
+ if (mem_info) {
+ data_src = *mem_info__const_data_src(mem_info);
+ op = data_src.mem_op;
+ ext_op = data_src.mem_op_ext;
+ }
if (op & PERF_MEM_OP_NA)
l = scnprintf(out, sz, "N/A");
@@ -432,6 +436,19 @@ static int perf_mem__op_scnprintf(char *out, size_t sz, const struct mem_info *m
else
l = scnprintf(out, sz, "No");
+ if (ext_op == PERF_MEM_EXT_OP_MTE_TAG)
+ l += scnprintf(out + l, sz - l, " MTE");
+ else if (ext_op == PERF_MEM_EXT_OP_NESTED_VIRT)
+ l += scnprintf(out + l, sz - l, " NV");
+ else if (ext_op == PERF_MEM_EXT_OP_MEMCPY)
+ l += scnprintf(out + l, sz - l, " MEMCPY");
+ else if (ext_op == PERF_MEM_EXT_OP_MEMSET)
+ l += scnprintf(out + l, sz - l, " MEMSET");
+ else if (ext_op == PERF_MEM_EXT_OP_SIMD)
+ l += scnprintf(out + l, sz - l, " SIMD");
+ else if (ext_op == PERF_MEM_EXT_OP_GCS)
+ l += scnprintf(out + l, sz - l, " GCS");
+
return l;
}
@@ -582,9 +599,6 @@ int perf_mem__blk_scnprintf(char *out, size_t sz, const struct mem_info *mem_inf
size_t l = 0;
u64 mask = PERF_MEM_BLK_NA;
- sz -= 1; /* -1 for null termination */
- out[0] = '\0';
-
if (mem_info)
mask = mem_info__const_data_src(mem_info)->mem_blk;
@@ -600,6 +614,44 @@ int perf_mem__blk_scnprintf(char *out, size_t sz, const struct mem_info *mem_inf
return l;
}
+static int perf_mem__aff_scnprintf(char *out, size_t sz,
+ const struct mem_info *mem_info)
+{
+ union perf_mem_data_src data_src;
+ size_t l = 0;
+
+ sz -= 1; /* -1 for null termination */
+ out[0] = '\0';
+
+ if (!mem_info)
+ goto out;
+
+ data_src = *mem_info__const_data_src(mem_info);
+
+ if (data_src.mem_dp)
+ l += scnprintf(out + l, sz - l, " DP");
+ if (data_src.mem_fp)
+ l += scnprintf(out + l, sz - l, " FP");
+ if (data_src.mem_pred)
+ l += scnprintf(out + l, sz - l, " PRED");
+ if (data_src.mem_atomic)
+ l += scnprintf(out + l, sz - l, " ATOMIC");
+ if (data_src.mem_excl)
+ l += scnprintf(out + l, sz - l, " EX");
+ if (data_src.mem_ar)
+ l += scnprintf(out + l, sz - l, " AR");
+ if (data_src.mem_sg)
+ l += scnprintf(out + l, sz - l, " SG");
+ if (data_src.mem_cond)
+ l += scnprintf(out + l, sz - l, " COND");
+
+out:
+ if (!l)
+ l += scnprintf(out + l, sz - l, " N/A");
+
+ return l;
+}
+
int perf_script__meminfo_scnprintf(char *out, size_t sz, const struct mem_info *mem_info)
{
int i = 0;
@@ -616,6 +668,8 @@ int perf_script__meminfo_scnprintf(char *out, size_t sz, const struct mem_info *
i += perf_mem__lck_scnprintf(out + i, sz - i, mem_info);
i += scnprintf(out + i, sz - i, "|BLK ");
i += perf_mem__blk_scnprintf(out + i, sz - i, mem_info);
+ i += scnprintf(out + i, sz - i, "|AFF");
+ i += perf_mem__aff_scnprintf(out + i, sz - i, mem_info);
return i;
}
--
2.34.1
Powered by blists - more mailing lists