Skip to content

Commit 7105311

Browse files
robherringacmel
authored andcommitted
perf arm-spe: Add raw decoding for SPEv1.2 previous branch address
Arm SPEv1.2 adds a new optional address packet type: previous branch target. The recorded address is the target virtual address of the most recently taken branch in program order. Add support for decoding the address packet in raw dumps. Reviewed-by: Leo Yan <leo.yan@linaro.org> Signed-off-by: Rob Herring <robh@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20230203162401.132931-1-robh@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent b777b3d commit 7105311

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,16 +422,18 @@ static int arm_spe_pkt_desc_addr(const struct arm_spe_pkt *packet,
422422
int ch, pat;
423423
u64 payload = packet->payload;
424424
int err = 0;
425+
static const char *idx_name[] = {"PC", "TGT", "VA", "PA", "PBT"};
425426

426427
switch (idx) {
427428
case SPE_ADDR_PKT_HDR_INDEX_INS:
428429
case SPE_ADDR_PKT_HDR_INDEX_BRANCH:
430+
case SPE_ADDR_PKT_HDR_INDEX_PREV_BRANCH:
429431
ns = !!SPE_ADDR_PKT_GET_NS(payload);
430432
el = SPE_ADDR_PKT_GET_EL(payload);
431433
payload = SPE_ADDR_PKT_ADDR_GET_BYTES_0_6(payload);
432434
arm_spe_pkt_out_string(&err, &buf, &buf_len,
433435
"%s 0x%llx el%d ns=%d",
434-
(idx == 1) ? "TGT" : "PC", payload, el, ns);
436+
idx_name[idx], payload, el, ns);
435437
break;
436438
case SPE_ADDR_PKT_HDR_INDEX_DATA_VIRT:
437439
arm_spe_pkt_out_string(&err, &buf, &buf_len,

tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ struct arm_spe_pkt {
6565
#define SPE_ADDR_PKT_HDR_INDEX_BRANCH 0x1
6666
#define SPE_ADDR_PKT_HDR_INDEX_DATA_VIRT 0x2
6767
#define SPE_ADDR_PKT_HDR_INDEX_DATA_PHYS 0x3
68+
#define SPE_ADDR_PKT_HDR_INDEX_PREV_BRANCH 0x4
6869

6970
/* Address packet payload */
7071
#define SPE_ADDR_PKT_ADDR_BYTE7_SHIFT 56

0 commit comments

Comments
 (0)