Skip to contentSkip to conversation

perf: arm-spe: Fix addresses of synthesized Arm SPE events

PATCH Applied Timothy Hayes 4 participants 11 messages Apr 21, 2022 – Apr 28, 2022

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover perf: arm-spe: Fix addresses of synthesized Arm SPE events

This patch set fixes problems related to address in synthesized events from SPE.

Committer testing:

perf record --no-bpf-event -e arm_spe_0/pa_enable=1/ -- sleep 1 perf inject -i perf.data -o perf-inj.data --itrace --strip perf script -i perf-inj.data --fields hw:+addr,+phys_addr

Before:

	sleep 49337 [004] 20133.731889:          1             l1d-access:  ffffcbebcde1d5b8 [unknown] ([unknown])
	sleep 49337 [004] 20133.731889:          1             tlb-access:  ffffcbebcde1d5b8 [unknown] ([unknown])
	sleep 49337 [004] 20133.731889:          1                 memory:  ffffcbebcde1d5b8 [unknown] ([unknown])

After:

	sleep 49337 [004] 20133.731889:          1             l1d-access: ffff800034123970 ffffcbebcde1d5b8 [unknown] ([unknown])       153d19970
	sleep 49337 [004] 20133.731889:          1             tlb-access: ffff800034123970 ffffcbebcde1d5b8 [unknown] ([unknown])       153d19970
	sleep 49337 [004] 20133.731889:          1                 memory: ffff800034123970 ffffcbebcde1d5b8 [unknown] ([unknown])       153d19970
tools/perf/arch/arm64/util/arm-spe.c                   | 10 ++++++++++
tools/perf/tests/attr/README                           |  1 +
tools/perf/tests/attr/test-record-spe-physical-address | 12 ++++++++++++
tools/perf/util/arm-spe.c                              |  5 +++--
4 files changed, 26 insertions(+), 2 deletions(-)
#1 lore raw

PATCH 1/3 perf: arm-spe: Fix addresses of synthesized SPE events

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

---
 tools/perf/util/arm-spe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/arm-spe.c +1 -1
index d2b64e3f588b..151cc38a171c 100644
@@ -1036,7 +1036,7 @@ arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session)
 	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_WEIGHT;
+			    PERF_SAMPLE_WEIGHT | PERF_SAMPLE_ADDR;
 	if (spe->timeless_decoding)
 		attr.sample_type &= ~(u64)PERF_SAMPLE_TIME;
 	else
Signature · 1 line
2.25.1
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] perf: arm-spe: Fix addresses of synthesized SPE events

Quoted 4 lines · Timothy Hayes

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

Quoted 20 lines
---
 tools/perf/util/arm-spe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/arm-spe.c +1 -1
index d2b64e3f588b..151cc38a171c 100644
@@ -1036,7 +1036,7 @@ arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session)
 	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_WEIGHT;
+			    PERF_SAMPLE_WEIGHT | PERF_SAMPLE_ADDR;
 	if (spe->timeless_decoding)
 		attr.sample_type &= ~(u64)PERF_SAMPLE_TIME;
 	else
Signature · 1 line
2.25.1
#3 lore raw

Re: [PATCH 1/3] perf: arm-spe: Fix addresses of synthesized SPE events

Quoted 7 lines · Leo Yan
Quoted 4 lines · Timothy Hayes

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

Supplement for fixed tag:

Since patches 01, 02 are fixing bugs, please add fixed tag [1]:

Fixes 54f7815efef7 ("perf arm-spe: Fill address info for samples")

Thanks,
Leo

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst#n138

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#4 lore raw

PATCH 2/3 perf: arm-spe: Fix SPE events with phys addresses

In reply to Timothy Hayes

This patch corrects a bug whereby SPE collection is invoked with pa_enable=1 but synthesized events fail to show physical addresses.

---
 tools/perf/arch/arm64/util/arm-spe.c | 10 ++++++++++
 tools/perf/util/arm-spe.c            |  3 ++-
 2 files changed, 12 insertions(+), 1 deletion(-)
tools/perf/arch/arm64/util/arm-spe.c +10 -0
index af4d63af8072..e8b577d33e53 100644
@@ -148,6 +148,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
 	bool privileged = perf_event_paranoid_check(-1);
 	struct evsel *tracking_evsel;
 	int err;
+	u64 bit;
 
 	sper->evlist = evlist;
 
@@ -245,6 +246,15 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
 	 */
 	evsel__set_sample_bit(arm_spe_evsel, DATA_SRC);
 
+	/*
+	 * The PHYS_ADDR flag does not affect the driver behaviour, it is used to
+	 * inform that the resulting output's SPE samples contain physical addresses
+	 * where applicable.
+	 */
+	bit = perf_pmu__format_bits(&arm_spe_pmu->format, "pa_enable");
+	if (arm_spe_evsel->core.attr.config & bit)
+		evsel__set_sample_bit(arm_spe_evsel, PHYS_ADDR);
+
 	/* Add dummy event to keep tracking */
 	err = parse_events(evlist, "dummy:u", NULL);
 	if (err)
tools/perf/util/arm-spe.c +2 -1
index 151cc38a171c..1a80151baed9 100644
@@ -1033,7 +1033,8 @@ arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session)
 	memset(&attr, 0, sizeof(struct perf_event_attr));
 	attr.size = sizeof(struct perf_event_attr);
 	attr.type = PERF_TYPE_HARDWARE;
-	attr.sample_type = evsel->core.attr.sample_type & PERF_SAMPLE_MASK;
+	attr.sample_type = evsel->core.attr.sample_type &
+				(PERF_SAMPLE_MASK | PERF_SAMPLE_PHYS_ADDR);
 	attr.sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID |
 			    PERF_SAMPLE_PERIOD | PERF_SAMPLE_DATA_SRC |
 			    PERF_SAMPLE_WEIGHT | PERF_SAMPLE_ADDR;
Signature · 1 line
2.25.1
#5 lore raw

Re: [PATCH 2/3] perf: arm-spe: Fix SPE events with phys addresses

Hi Timothy,

Quoted 42 lines · Timothy Hayes

This patch corrects a bug whereby SPE collection is invoked with pa_enable=1 but synthesized events fail to show physical addresses.

---
 tools/perf/arch/arm64/util/arm-spe.c | 10 ++++++++++
 tools/perf/util/arm-spe.c            |  3 ++-
 2 files changed, 12 insertions(+), 1 deletion(-)
tools/perf/arch/arm64/util/arm-spe.c +10 -0
index af4d63af8072..e8b577d33e53 100644
@@ -148,6 +148,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
 	bool privileged = perf_event_paranoid_check(-1);
 	struct evsel *tracking_evsel;
 	int err;
+	u64 bit;
 
 	sper->evlist = evlist;
 
@@ -245,6 +246,15 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
 	 */
 	evsel__set_sample_bit(arm_spe_evsel, DATA_SRC);
 
+	/*
+	 * The PHYS_ADDR flag does not affect the driver behaviour, it is used to
+	 * inform that the resulting output's SPE samples contain physical addresses
+	 * where applicable.
+	 */
+	bit = perf_pmu__format_bits(&arm_spe_pmu->format, "pa_enable");
+	if (arm_spe_evsel->core.attr.config & bit)
+		evsel__set_sample_bit(arm_spe_evsel, PHYS_ADDR);
+
 	/* Add dummy event to keep tracking */
 	err = parse_events(evlist, "dummy:u", NULL);
 	if (err)
tools/perf/util/arm-spe.c +0 -0
index 151cc38a171c..1a80151baed9 100644

tools/perf/util/arm-spe.c arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session) · line 1037

Quoted 6 lines
tools/perf/util/arm-spe.c +2 -1
@@ -1033,7 +1033,8 @@ arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session)
 	memset(&attr, 0, sizeof(struct perf_event_attr));
 	attr.size = sizeof(struct perf_event_attr);
 	attr.type = PERF_TYPE_HARDWARE;
-	attr.sample_type = evsel->core.attr.sample_type & PERF_SAMPLE_MASK;
+	attr.sample_type = evsel->core.attr.sample_type &
+				(PERF_SAMPLE_MASK | PERF_SAMPLE_PHYS_ADDR);

I verified this patch and I can confirm the physical address can be dumped successfully.

I have a more general question, seems to me, we need to change the macro PERF_SAMPLE_MASK in the file util/event.h as below, so here doesn't need to 'or' the flag PERF_SAMPLE_PHYS_ADDR anymore.

@Arnaldo, @Jiri, could you confirm if this is the right way to move forward? I am not sure why PERF_SAMPLE_MASK doesn't contain the bit PERF_SAMPLE_PHYS_ADDR in current code.

tools/perf/util/event.h +1 -1
index cdd72e05fd28..c905ac32ebad 100644
@@ -39,7 +39,7 @@ struct perf_event_attr;
         PERF_SAMPLE_TIME | PERF_SAMPLE_ADDR |          \
        PERF_SAMPLE_ID | PERF_SAMPLE_STREAM_ID |        \
         PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD |         \
-        PERF_SAMPLE_IDENTIFIER)
+        PERF_SAMPLE_IDENTIFIER | PERF_SAMPLE_PHYS_ADDR)
 

Thanks,
Leo

Quoted 6 lines
tools/perf/util/arm-spe.c +0 -0
 	attr.sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID |
 			    PERF_SAMPLE_PERIOD | PERF_SAMPLE_DATA_SRC |
 			    PERF_SAMPLE_WEIGHT | PERF_SAMPLE_ADDR;
Signature · 1 line
2.25.1
#6 lore raw

Re: [PATCH 2/3] perf: arm-spe: Fix SPE events with phys addresses

Quoted 55 lines · Leo Yan

Hi Timothy,

Quoted 42 lines · Timothy Hayes

This patch corrects a bug whereby SPE collection is invoked with pa_enable=1 but synthesized events fail to show physical addresses.

---
 tools/perf/arch/arm64/util/arm-spe.c | 10 ++++++++++
 tools/perf/util/arm-spe.c            |  3 ++-
 2 files changed, 12 insertions(+), 1 deletion(-)
tools/perf/arch/arm64/util/arm-spe.c +10 -0
index af4d63af8072..e8b577d33e53 100644
@@ -148,6 +148,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
 	bool privileged = perf_event_paranoid_check(-1);
 	struct evsel *tracking_evsel;
 	int err;
+	u64 bit;
 
 	sper->evlist = evlist;
 
@@ -245,6 +246,15 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
 	 */
 	evsel__set_sample_bit(arm_spe_evsel, DATA_SRC);
 
+	/*
+	 * The PHYS_ADDR flag does not affect the driver behaviour, it is used to
+	 * inform that the resulting output's SPE samples contain physical addresses
+	 * where applicable.
+	 */
+	bit = perf_pmu__format_bits(&arm_spe_pmu->format, "pa_enable");
+	if (arm_spe_evsel->core.attr.config & bit)
+		evsel__set_sample_bit(arm_spe_evsel, PHYS_ADDR);
+
 	/* Add dummy event to keep tracking */
 	err = parse_events(evlist, "dummy:u", NULL);
 	if (err)
tools/perf/util/arm-spe.c +0 -0
index 151cc38a171c..1a80151baed9 100644

tools/perf/util/arm-spe.c arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session) · line 1037

Quoted 6 lines
tools/perf/util/arm-spe.c +2 -1
@@ -1033,7 +1033,8 @@ arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session)
 	memset(&attr, 0, sizeof(struct perf_event_attr));
 	attr.size = sizeof(struct perf_event_attr);
 	attr.type = PERF_TYPE_HARDWARE;
-	attr.sample_type = evsel->core.attr.sample_type & PERF_SAMPLE_MASK;
+	attr.sample_type = evsel->core.attr.sample_type &
+				(PERF_SAMPLE_MASK | PERF_SAMPLE_PHYS_ADDR);

I verified this patch and I can confirm the physical address can be dumped successfully.

Quoted 7 lines

I have a more general question, seems to me, we need to change the macro PERF_SAMPLE_MASK in the file util/event.h as below, so here doesn't need to 'or' the flag PERF_SAMPLE_PHYS_ADDR anymore.

@Arnaldo, @Jiri, could you confirm if this is the right way to move forward? I am not sure why PERF_SAMPLE_MASK doesn't contain the bit PERF_SAMPLE_PHYS_ADDR in current code.

I think there is a reason that PERF_SAMPLE_MASK is a subset of all the bits. This comment below suggests it. Is it so the mask only includes fields that are 64bits? That makes the __evsel__sample_size() function a simple multiplication of a count of all the fields that are 64bits.

static int
perf_event__check_size(union perf_event *event, unsigned int sample_size)

  {
	/*
	 * The evsel's sample_size is based on PERF_SAMPLE_MASK which includes
	 * up to PERF_SAMPLE_PERIOD.  After that overflow() must be used to
	 * check the format does not go past the end of the event.
	 */
	if (sample_size + sizeof(event->header) > event->header.size)
		return -EFAULT;

	return 0;

}

Having said that, the mask was updated once to add PERF_SAMPLE_IDENTIFIER to it, so that comment is slightly out of date now.

Quoted 21 lines
tools/perf/util/event.h +1 -1
index cdd72e05fd28..c905ac32ebad 100644
@@ -39,7 +39,7 @@ struct perf_event_attr;
         PERF_SAMPLE_TIME | PERF_SAMPLE_ADDR |          \
        PERF_SAMPLE_ID | PERF_SAMPLE_STREAM_ID |        \
         PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD |         \
-        PERF_SAMPLE_IDENTIFIER)
+        PERF_SAMPLE_IDENTIFIER | PERF_SAMPLE_PHYS_ADDR)
 
 Thanks,

Leo

Quoted 6 lines
tools/perf/util/arm-spe.c +0 -0
 	attr.sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID |
 			    PERF_SAMPLE_PERIOD | PERF_SAMPLE_DATA_SRC |
 			    PERF_SAMPLE_WEIGHT | PERF_SAMPLE_ADDR;
Signature · 1 line
2.25.1
Reviewed-by
#7 lore raw

Re: [PATCH 2/3] perf: arm-spe: Fix SPE events with phys addresses

On Mon, Apr 25, 2022 at 10:12:36AM +0100, James Clark wrote:

[...]

Quoted 19 lines
Quoted 19 lines

tools/perf/util/arm-spe.c arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session) · line 1037

Quoted 11 lines
tools/perf/util/arm-spe.c +2 -1
index 151cc38a171c..1a80151baed9 100644
@@ -1033,7 +1033,8 @@ arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session)
 	memset(&attr, 0, sizeof(struct perf_event_attr));
 	attr.size = sizeof(struct perf_event_attr);
 	attr.type = PERF_TYPE_HARDWARE;
-	attr.sample_type = evsel->core.attr.sample_type & PERF_SAMPLE_MASK;
+	attr.sample_type = evsel->core.attr.sample_type &
+				(PERF_SAMPLE_MASK | PERF_SAMPLE_PHYS_ADDR);

I verified this patch and I can confirm the physical address can be dumped successfully.

I have a more general question, seems to me, we need to change the macro PERF_SAMPLE_MASK in the file util/event.h as below, so here doesn't need to 'or' the flag PERF_SAMPLE_PHYS_ADDR anymore.

Quoted 8 lines
Quoted 3 lines

@Arnaldo, @Jiri, could you confirm if this is the right way to move forward? I am not sure why PERF_SAMPLE_MASK doesn't contain the bit PERF_SAMPLE_PHYS_ADDR in current code.

I think there is a reason that PERF_SAMPLE_MASK is a subset of all the bits. This comment below suggests it. Is it so the mask only includes fields that are 64bits? That makes the __evsel__sample_size() function a simple multiplication of a count of all the fields that are 64bits.

After reading code, seems the conclusion "a count of all the fields that are 64bits" is not valid. PERF_SAMPLE_MASK contains bits PERF_SAMPLE_IP and PERF_SAMPLE_TID, the corresponding fields 'pid' and 'tid' in the structure perf_sample are u32 type.

Quoted 10 lines

static int
perf_event__check_size(union perf_event *event, unsigned int sample_size)

  {
	/*
	 * The evsel's sample_size is based on PERF_SAMPLE_MASK which includes
	 * up to PERF_SAMPLE_PERIOD.  After that overflow() must be used to
	 * check the format does not go past the end of the event.
	 */
	if (sample_size + sizeof(event->header) > event->header.size)
		return -EFAULT;

Okay, thanks for sharing the info, it does show that it's deliberately to not contain all fields in PERF_SAMPLE_MASK. If so, this patch is fine for me:

Quoted 28 lines
	return 0;

}

Having said that, the mask was updated once to add PERF_SAMPLE_IDENTIFIER to it, so that comment is slightly out of date now.

Quoted 21 lines
tools/perf/util/event.h +1 -1
index cdd72e05fd28..c905ac32ebad 100644
@@ -39,7 +39,7 @@ struct perf_event_attr;
         PERF_SAMPLE_TIME | PERF_SAMPLE_ADDR |          \
        PERF_SAMPLE_ID | PERF_SAMPLE_STREAM_ID |        \
         PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD |         \
-        PERF_SAMPLE_IDENTIFIER)
+        PERF_SAMPLE_IDENTIFIER | PERF_SAMPLE_PHYS_ADDR)
 
 Thanks,

Leo

Quoted 6 lines
tools/perf/util/arm-spe.c +0 -0
 	attr.sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID |
 			    PERF_SAMPLE_PERIOD | PERF_SAMPLE_DATA_SRC |
 			    PERF_SAMPLE_WEIGHT | PERF_SAMPLE_ADDR;
Signature · 1 line
2.25.1
#8 lore raw

PATCH 3/3 perf test: Add perf_event_attr test for Arm SPE

In reply to Timothy Hayes

Adds a perf_event_attr test for Arm SPE in which the presence of physical addresses are checked when SPE unit is run with pa_enable=1.

---
 tools/perf/tests/attr/README                         |  1 +
 .../perf/tests/attr/test-record-spe-physical-address | 12 ++++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 tools/perf/tests/attr/test-record-spe-physical-address
tools/perf/tests/attr/README +1 -0
index 454505d343fa..eb3f7d4bb324 100644
@@ -60,6 +60,7 @@ Following tests are defined (with perf commands):
   perf record -R kill                           (test-record-raw)
   perf record -c 2 -e arm_spe_0// -- kill       (test-record-spe-period)
   perf record -e arm_spe_0/period=3/ -- kill    (test-record-spe-period-term)
+  perf record -e arm_spe_0/pa_enable=1/ -- kill (test-record-spe-physical-address)
   perf stat -e cycles kill                      (test-stat-basic)
   perf stat kill                                (test-stat-default)
   perf stat -d kill                             (test-stat-detailed-1)
tools/perf/tests/attr/test-record-spe-physical-address new file +12 -0
new file mode 100644
index 000000000000..7ebcf5012ce3
@@ -0,0 +1,12 @@
+[config]
+command = record
+args    = --no-bpf-event -e arm_spe_0/pa_enable=1/ -- kill >/dev/null 2>&1
+ret     = 1
+arch    = aarch64
+
+[event-10:base-record-spe]
+# 622727 is the decimal of IP|TID|TIME|CPU|IDENTIFIER|DATA_SRC|PHYS_ADDR
+sample_type=622727
+
+# dummy event
+[event-1:base-record-spe]
\ No newline at end of file
Signature · 1 line
2.25.1
Reviewed-by Tested-by on v1 3/3
#9 lore raw

Re: [PATCH 3/3] perf test: Add perf_event_attr test for Arm SPE

Quoted 4 lines · Timothy Hayes

Adds a perf_event_attr test for Arm SPE in which the presence of physical addresses are checked when SPE unit is run with pa_enable=1.

Quoted 40 lines
---
 tools/perf/tests/attr/README                         |  1 +
 .../perf/tests/attr/test-record-spe-physical-address | 12 ++++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 tools/perf/tests/attr/test-record-spe-physical-address
tools/perf/tests/attr/README +1 -0
index 454505d343fa..eb3f7d4bb324 100644
@@ -60,6 +60,7 @@ Following tests are defined (with perf commands):
   perf record -R kill                           (test-record-raw)
   perf record -c 2 -e arm_spe_0// -- kill       (test-record-spe-period)
   perf record -e arm_spe_0/period=3/ -- kill    (test-record-spe-period-term)
+  perf record -e arm_spe_0/pa_enable=1/ -- kill (test-record-spe-physical-address)
   perf stat -e cycles kill                      (test-stat-basic)
   perf stat kill                                (test-stat-default)
   perf stat -d kill                             (test-stat-detailed-1)
tools/perf/tests/attr/test-record-spe-physical-address new file +12 -0
new file mode 100644
index 000000000000..7ebcf5012ce3
@@ -0,0 +1,12 @@
+[config]
+command = record
+args    = --no-bpf-event -e arm_spe_0/pa_enable=1/ -- kill >/dev/null 2>&1
+ret     = 1
+arch    = aarch64
+
+[event-10:base-record-spe]
+# 622727 is the decimal of IP|TID|TIME|CPU|IDENTIFIER|DATA_SRC|PHYS_ADDR
+sample_type=622727
+
+# dummy event
+[event-1:base-record-spe]
\ No newline at end of file
Signature · 1 line
2.25.1
maintainer Applied
#10 lore raw

Re: [PATCH 3/3] perf test: Add perf_event_attr test for Arm SPE

Em Sun, Apr 24, 2022 at 10:53:07PM +0800, Leo Yan escreveu:

Quoted 8 lines · Timothy Hayes
Quoted 4 lines

Adds a perf_event_attr test for Arm SPE in which the presence of physical addresses are checked when SPE unit is run with pa_enable=1.

Thanks, applied the set to perf/urgent.

- Arnaldo

Quoted 40 lines
Quoted 40 lines
---
 tools/perf/tests/attr/README                         |  1 +
 .../perf/tests/attr/test-record-spe-physical-address | 12 ++++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 tools/perf/tests/attr/test-record-spe-physical-address
tools/perf/tests/attr/README +1 -0
index 454505d343fa..eb3f7d4bb324 100644
@@ -60,6 +60,7 @@ Following tests are defined (with perf commands):
   perf record -R kill                           (test-record-raw)
   perf record -c 2 -e arm_spe_0// -- kill       (test-record-spe-period)
   perf record -e arm_spe_0/period=3/ -- kill    (test-record-spe-period-term)
+  perf record -e arm_spe_0/pa_enable=1/ -- kill (test-record-spe-physical-address)
   perf stat -e cycles kill                      (test-stat-basic)
   perf stat kill                                (test-stat-default)
   perf stat -d kill                             (test-stat-detailed-1)
tools/perf/tests/attr/test-record-spe-physical-address new file +12 -0
new file mode 100644
index 000000000000..7ebcf5012ce3
@@ -0,0 +1,12 @@
+[config]
+command = record
+args    = --no-bpf-event -e arm_spe_0/pa_enable=1/ -- kill >/dev/null 2>&1
+ret     = 1
+arch    = aarch64
+
+[event-10:base-record-spe]
+# 622727 is the decimal of IP|TID|TIME|CPU|IDENTIFIER|DATA_SRC|PHYS_ADDR
+sample_type=622727
+
+# dummy event
+[event-1:base-record-spe]
\ No newline at end of file
Signature · 1 line
2.25.1
Signature · 1 line
- Arnaldo