Subject: [PATCH 5.15 123/177] perf arm-spe: Fix addresses of synthesized SPE events

From: Greg Kroah-Hartman <[email-masked]>
Date: Wed, 4 May 2022 18:45:16 +0200

From: Timothy Hayes <[email-masked]>

[ Upstream commit 4e13f6706d5aee1a6b835a44f6cf4971a921dcb8 ]

This patch corrects a bug whereby synthesized events from SPE
samples are missing virtual addresses.

Fixes: 54f7815efef7fad9 ("perf arm-spe: Fill address info for samples")
Reviewed-by: Leo Yan <[email-masked]>
Signed-off-by: Timothy Hayes <[email-masked]>
Cc: Alexander Shishkin <[email-masked]>
Cc: [email-masked]
Cc: Jiri Olsa <[email-masked]>
Cc: John Fastabend <[email-masked]>
Cc: John Garry <[email-masked]>
Cc: KP Singh <[email-masked]>
Cc: Leo Yan <[email-masked]>
Cc: [email-masked]
Cc: Mark Rutland <[email-masked]>
Cc: Martin KaFai Lau <[email-masked]>
Cc: Mathieu Poirier <[email-masked]>
Cc: Namhyung Kim <[email-masked]>
Cc: [email-masked]
Cc: Song Liu <[email-masked]>
Cc: Will Deacon <[email-masked]>
Cc: Yonghong Song <[email-masked]>
Link: https://lore.kernel.org/r/[email-masked]
Signed-off-by: Arnaldo Carvalho de Melo <[email-masked]>
Signed-off-by: Sasha Levin <[email-masked]>
---
 tools/perf/util/arm-spe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c
index 7054f23150e1..235549bb28b9 100644
--- a/tools/perf/util/arm-spe.c
+++ b/tools/perf/util/arm-spe.c
@@ -927,7 +927,8 @@ arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session)
 	attr.type = PERF_TYPE_HARDWARE;
 	attr.sample_type = evsel->core.attr.sample_type & PERF_SAMPLE_MASK;
 	attr.sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID |
-			    PERF_SAMPLE_PERIOD | PERF_SAMPLE_DATA_SRC;
+			    PERF_SAMPLE_PERIOD | PERF_SAMPLE_DATA_SRC |
+			    PERF_SAMPLE_ADDR;
 	if (spe->timeless_decoding)
 		attr.sample_type &= ~(u64)PERF_SAMPLE_TIME;
 	else
-- 
2.35.1