[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200922101225.183554-5-andre.przywara@arm.com>
Date: Tue, 22 Sep 2020 11:12:24 +0100
From: Andre Przywara <andre.przywara@....com>
To: Will Deacon <will@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Suzuki K Poulose <suzuki.poulose@....com>,
Leo Yan <leo.yan@...aro.org>,
Tan Xiaojun <tanxiaojun@...wei.com>,
James Clark <james.clark@....com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH 4/5] perf: arm_spe: Decode memory tagging properties
When SPE records a physical address, it can additionally tag the event
with information from the Memory Tagging architecture extension.
Decode the two additional fields in the SPE event payload.
Signed-off-by: Andre Przywara <andre.przywara@....com>
---
.../util/arm-spe-decoder/arm-spe-pkt-decoder.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 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 943e4155b246..a033f34846a6 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
@@ -8,13 +8,14 @@
#include <string.h>
#include <endian.h>
#include <byteswap.h>
+#include <linux/bits.h>
#include "arm-spe-pkt-decoder.h"
-#define BIT(n) (1ULL << (n))
-
#define NS_FLAG BIT(63)
#define EL_FLAG (BIT(62) | BIT(61))
+#define CH_FLAG BIT(62)
+#define PAT_FLAG GENMASK_ULL(59, 56)
#define SPE_HEADER0_PAD 0x0
#define SPE_HEADER0_END 0x1
@@ -447,10 +448,16 @@ int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf,
return snprintf(buf, buf_len, "%s 0x%llx el%d ns=%d",
(idx == 1) ? "TGT" : "PC", payload, el, ns);
case 2: return snprintf(buf, buf_len, "VA 0x%llx", payload);
- case 3: ns = !!(packet->payload & NS_FLAG);
+ case 3: {
+ int ch = !!(packet->payload & CH_FLAG);
+ int pat = (packet->payload & PAT_FLAG) >> 56;
+
+ ns = !!(packet->payload & NS_FLAG);
payload &= ~(0xffULL << 56);
- return snprintf(buf, buf_len, "PA 0x%llx ns=%d",
- payload, ns);
+ return snprintf(buf, buf_len,
+ "PA 0x%llx ns=%d ch=%d, pat=%x",
+ payload, ns, ch, pat);
+ }
default: return 0;
}
case ARM_SPE_CONTEXT:
--
2.17.1
Powered by blists - more mailing lists