Skip to contentSkip to conversation

perf test record user-regs: Fix mask for vg register

PATCH Applied [email protected] 3 participants 3 messages Dec 1, 2023 – Dec 4, 2023 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf test record user-regs: Fix mask for vg register

From: Veronika Molnarova <[email protected]>

The 'vg' register for arm64 shows up in --user_regs as available when masking the variable AT_HWCAP with 1 << 22 returns '1' as done in perf_regs.c. However, in subtests for support of SVE, the check for the 'vg' register is done by masking the variable AT_HWCAP with the value 0x200000 which is equals to 1 << 21 instead of 1 << 22. This results in inconsistencies on certain systems where the test expects that the 'vg' register is not operational when it is, and vice-versa.

During the testing on a machine that the test expected not to have the 'vg' register available, the perf record with option --user-regs showed records for the 'vg' register together with all of the others, which means that the mask for the subtest of perf_event_attr is off by one. Change the value of the mask from 0x200000 to 0x400000 to correct it.

---
 tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64 | 2 +-
 tools/perf/tests/attr/test-record-user-regs-sve-aarch64    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64 +1 -1
index fbb065842880..bed765450ca9 100644
@@ -6,4 +6,4 @@ args    = --no-bpf-event --user-regs=vg kill >/dev/null 2>&1
 ret     = 129
 test_ret = true
 arch    = aarch64
-auxv    = auxv["AT_HWCAP"] & 0x200000 == 0
+auxv    = auxv["AT_HWCAP"] & 0x400000 == 0
tools/perf/tests/attr/test-record-user-regs-sve-aarch64 +1 -1
index c598c803221d..a65113cd7311 100644
@@ -6,7 +6,7 @@ args    = --no-bpf-event --user-regs=vg kill >/dev/null 2>&1
 ret     = 1
 test_ret = true
 arch    = aarch64
-auxv    = auxv["AT_HWCAP"] & 0x200000 == 0x200000
+auxv    = auxv["AT_HWCAP"] & 0x400000 == 0x400000
 kernel_since = 6.1
 
 [event:base-record]
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · On Fri, Dec 01, 2023 at 08:46:17PM +0100, [email protected] wrote:

From: Veronika Molnarova <[email protected]>

The 'vg' register for arm64 shows up in --user_regs as available when masking the variable AT_HWCAP with 1 << 22 returns '1' as done in perf_regs.c. However, in subtests for support of SVE, the check for the 'vg' register is done by masking the variable AT_HWCAP with the value 0x200000 which is equals to 1 << 21 instead of 1 << 22. This results in inconsistencies on certain systems where the test expects that the 'vg' register is not operational when it is, and vice-versa.

Quoted 7 lines

During the testing on a machine that the test expected not to have the 'vg' register available, the perf record with option --user-regs showed records for the 'vg' register together with all of the others, which means that the mask for the subtest of perf_event_attr is off by one. Change the value of the mask from 0x200000 to 0x400000 to correct it.

LGTM, except I think it's good to add fix tag:

Fixes 9440ebdc333d ("perf test arm64: Add attr tests for new VG register")

With above fix tag:

maintainer Applied
#2 lore raw

Em Sun, Dec 03, 2023 at 02:13:53PM +0800, Leo Yan escreveu:

Quoted 19 lines · On Fri, Dec 01, 2023 at 08:46:17PM +0100, [email protected] wrote:
Quoted 10 lines

From: Veronika Molnarova <[email protected]>

The 'vg' register for arm64 shows up in --user_regs as available when masking the variable AT_HWCAP with 1 << 22 returns '1' as done in perf_regs.c. However, in subtests for support of SVE, the check for the 'vg' register is done by masking the variable AT_HWCAP with the value 0x200000 which is equals to 1 << 21 instead of 1 << 22. This results in inconsistencies on certain systems where the test expects that the 'vg' register is not operational when it is, and vice-versa.

Quoted 7 lines

During the testing on a machine that the test expected not to have the 'vg' register available, the perf record with option --user-regs showed records for the 'vg' register together with all of the others, which means that the mask for the subtest of perf_event_attr is off by one. Change the value of the mask from 0x200000 to 0x400000 to correct it.

Quoted 7 lines

LGTM, except I think it's good to add fix tag:

Fixes 9440ebdc333d ("perf test arm64: Add attr tests for new VG register")

With above fix tag:

b4 even collected the fixes, that I checked and is in tree, etc.

Thanks, applied.

- Arnaldo