109 lines
3.4 KiB
Diff
109 lines
3.4 KiB
Diff
From 3486742b3d287c5650ccec76aeb7fc7e1eaa69f5 Mon Sep 17 00:00:00 2001
|
|
From: Leo Yan <leo.yan@linaro.org>
|
|
Date: Fri, 31 Dec 2021 13:32:08 +0800
|
|
Subject: [PATCH 11/21] perf arm-spe: Add new function
|
|
arm_spe_pkt_desc_counter()
|
|
|
|
mainline inclusion
|
|
from mainline-v5.11-rc1
|
|
commit c52cfe9872132407eef6d734014d6fd7790146f5
|
|
category: feature
|
|
bugzilla: https://gitee.com/openeuler/kernel/issues/I4NGPV
|
|
CVE: NA
|
|
|
|
-------------------------------------------------
|
|
|
|
This patch moves out the counter packet parsing code from
|
|
arm_spe_pkt_desc() to the new function arm_spe_pkt_desc_counter().
|
|
|
|
Signed-off-by: Leo Yan <leo.yan@linaro.org>
|
|
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
|
|
Acked-by: Will Deacon <will@kernel.org>
|
|
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
|
|
Cc: Al Grant <Al.Grant@arm.com>
|
|
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
|
|
Cc: Dave Martin <Dave.Martin@arm.com>
|
|
Cc: Ingo Molnar <mingo@redhat.com>
|
|
Cc: James Clark <james.clark@arm.com>
|
|
Cc: Jiri Olsa <jolsa@redhat.com>
|
|
Cc: John Garry <john.garry@huawei.com>
|
|
Cc: Mark Rutland <mark.rutland@arm.com>
|
|
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
|
|
Cc: Namhyung Kim <namhyung@kernel.org>
|
|
Cc: Peter Zijlstra <peterz@infradead.org>
|
|
Cc: Wei Li <liwei391@huawei.com>
|
|
Link: https://lore.kernel.org/r/20201119152441.6972-8-leo.yan@linaro.org
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Wei Li <liwei391@huawei.com>
|
|
Reviewed-by: Yang Jihong <yangjihong1@huawei.com>
|
|
Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com>
|
|
Signed-off-by: hongrongxuan <hongrongxuan@huawei.com>
|
|
---
|
|
.../arm-spe-decoder/arm-spe-pkt-decoder.c | 43 ++++++++++++-------
|
|
1 file changed, 28 insertions(+), 15 deletions(-)
|
|
|
|
diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c
|
|
index 978f5551b82c..397ade5ffdeb 100644
|
|
--- a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c
|
|
+++ b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c
|
|
@@ -322,6 +322,33 @@ static int arm_spe_pkt_desc_addr(const struct arm_spe_pkt *packet,
|
|
return err;
|
|
}
|
|
|
|
+static int arm_spe_pkt_desc_counter(const struct arm_spe_pkt *packet,
|
|
+ char *buf, size_t buf_len)
|
|
+{
|
|
+ u64 payload = packet->payload;
|
|
+ const char *name = arm_spe_pkt_name(packet->type);
|
|
+ int err = 0;
|
|
+
|
|
+ arm_spe_pkt_out_string(&err, &buf, &buf_len, "%s %d ", name,
|
|
+ (unsigned short)payload);
|
|
+
|
|
+ switch (packet->index) {
|
|
+ case 0:
|
|
+ arm_spe_pkt_out_string(&err, &buf, &buf_len, "TOT");
|
|
+ break;
|
|
+ case 1:
|
|
+ arm_spe_pkt_out_string(&err, &buf, &buf_len, "ISSUE");
|
|
+ break;
|
|
+ case 2:
|
|
+ arm_spe_pkt_out_string(&err, &buf, &buf_len, "XLAT");
|
|
+ break;
|
|
+ default:
|
|
+ break;
|
|
+ }
|
|
+
|
|
+ return err;
|
|
+}
|
|
+
|
|
int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf,
|
|
size_t buf_len)
|
|
{
|
|
@@ -414,21 +441,7 @@ int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf,
|
|
name, (unsigned long)payload, idx + 1);
|
|
break;
|
|
case ARM_SPE_COUNTER:
|
|
- arm_spe_pkt_out_string(&err, &buf, &blen, "%s %d ", name,
|
|
- (unsigned short)payload);
|
|
- switch (idx) {
|
|
- case 0:
|
|
- arm_spe_pkt_out_string(&err, &buf, &blen, "TOT");
|
|
- break;
|
|
- case 1:
|
|
- arm_spe_pkt_out_string(&err, &buf, &blen, "ISSUE");
|
|
- break;
|
|
- case 2:
|
|
- arm_spe_pkt_out_string(&err, &buf, &blen, "XLAT");
|
|
- break;
|
|
- default:
|
|
- break;
|
|
- }
|
|
+ err = arm_spe_pkt_desc_counter(packet, buf, buf_len);
|
|
break;
|
|
default:
|
|
/* Unknown packet type */
|
|
--
|
|
2.27.0
|
|
|