perf test record user-regs: Fix mask for vg register
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
@@ -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
@@ -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
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_HWCAPwith 1 << 22 returns '1' as done inperf_regs.c. However, in subtests for support of SVE, the check for the 'vg' register is done by masking the variableAT_HWCAPwith the value0x200000which 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_attris off by one. Change the value of the mask from0x200000to0x400000to correct it.Signed-off-by Veronika Molnarova <[email protected]>
LGTM, except I think it's good to add fix tag:
With above fix tag:
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_HWCAPwith 1 << 22 returns '1' as done inperf_regs.c. However, in subtests for support of SVE, the check for the 'vg' register is done by masking the variableAT_HWCAPwith the value0x200000which 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_attris off by one. Change the value of the mask from0x200000to0x400000to correct it.Signed-off-by Veronika Molnarova <[email protected]>
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:
Reviewed-by Leo Yan <[email protected]>
b4 even collected the fixes, that I checked and is in tree, etc.
Thanks, applied.
- Arnaldo