From: Leo Yan <leo....@linaro.org>

This patch is to store virtual and physical memory addresses in packet,
which will be used for memory samples.

Signed-off-by: Leo Yan <leo....@linaro.org>
Signed-off-by: James Clark <james.cl...@arm.com>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Ingo Molnar <mi...@redhat.com>
Cc: Arnaldo Carvalho de Melo <a...@kernel.org>
Cc: Mark Rutland <mark.rutl...@arm.com>
Cc: Alexander Shishkin <alexander.shish...@linux.intel.com>
Cc: Jiri Olsa <jo...@redhat.com>
Cc: Namhyung Kim <namhy...@kernel.org>
Cc: John Garry <john.ga...@huawei.com>
Cc: Will Deacon <w...@kernel.org>
Cc: Mathieu Poirier <mathieu.poir...@linaro.org>
Cc: Al Grant <al.gr...@arm.com>
Cc: Andre Przywara <andre.przyw...@arm.com>
Cc: Wei Li <liwei...@huawei.com>
Cc: Tan Xiaojun <tanxiao...@huawei.com>
Cc: Adrian Hunter <adrian.hun...@intel.com>
---
 tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 4 ++++
 tools/perf/util/arm-spe-decoder/arm-spe-decoder.h | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c 
b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
index 90d575cee1b9..7aac3048b090 100644
--- a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
+++ b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
@@ -172,6 +172,10 @@ static int arm_spe_read_record(struct arm_spe_decoder 
*decoder)
                                decoder->record.from_ip = ip;
                        else if (idx == SPE_ADDR_PKT_HDR_INDEX_BRANCH)
                                decoder->record.to_ip = ip;
+                       else if (idx == SPE_ADDR_PKT_HDR_INDEX_DATA_VIRT)
+                               decoder->record.virt_addr = ip;
+                       else if (idx == SPE_ADDR_PKT_HDR_INDEX_DATA_PHYS)
+                               decoder->record.phys_addr = ip;
                        break;
                case ARM_SPE_COUNTER:
                        break;
diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h 
b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h
index 24727b8ca7ff..7b845001afe7 100644
--- a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h
+++ b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h
@@ -30,6 +30,8 @@ struct arm_spe_record {
        u64 from_ip;
        u64 to_ip;
        u64 timestamp;
+       u64 virt_addr;
+       u64 phys_addr;
 };
 
 struct arm_spe_insn;
-- 
2.28.0

Reply via email to