* [PATCH] perf test record user-regs: Fix mask for vg register
@ 2023-12-01 19:46 vmolnaro
2023-12-03 6:13 ` Leo Yan
0 siblings, 1 reply; 3+ messages in thread
From: vmolnaro @ 2023-12-01 19:46 UTC (permalink / raw)
To: linux-perf-users, acme, acme, vmolnaro; +Cc: mpetlan, leo.yan, james.clark
From: Veronika Molnarova <vmolnaro@redhat.com>
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.
Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>
---
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(-)
diff --git a/tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64 b/tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64
index fbb065842880..bed765450ca9 100644
--- a/tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64
+++ b/tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64
@@ -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
diff --git a/tools/perf/tests/attr/test-record-user-regs-sve-aarch64 b/tools/perf/tests/attr/test-record-user-regs-sve-aarch64
index c598c803221d..a65113cd7311 100644
--- a/tools/perf/tests/attr/test-record-user-regs-sve-aarch64
+++ b/tools/perf/tests/attr/test-record-user-regs-sve-aarch64
@@ -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]
--
2.41.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] perf test record user-regs: Fix mask for vg register
2023-12-01 19:46 [PATCH] perf test record user-regs: Fix mask for vg register vmolnaro
@ 2023-12-03 6:13 ` Leo Yan
2023-12-04 19:33 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 3+ messages in thread
From: Leo Yan @ 2023-12-03 6:13 UTC (permalink / raw)
To: vmolnaro; +Cc: linux-perf-users, acme, acme, mpetlan, james.clark
On Fri, Dec 01, 2023 at 08:46:17PM +0100, vmolnaro@redhat.com wrote:
> From: Veronika Molnarova <vmolnaro@redhat.com>
>
> 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.
>
> Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>
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 <leo.yan@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] perf test record user-regs: Fix mask for vg register
2023-12-03 6:13 ` Leo Yan
@ 2023-12-04 19:33 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-12-04 19:33 UTC (permalink / raw)
To: Leo Yan; +Cc: vmolnaro, linux-perf-users, acme, mpetlan, james.clark
Em Sun, Dec 03, 2023 at 02:13:53PM +0800, Leo Yan escreveu:
> On Fri, Dec 01, 2023 at 08:46:17PM +0100, vmolnaro@redhat.com wrote:
> > From: Veronika Molnarova <vmolnaro@redhat.com>
> >
> > 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.
> >
> > Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>
>
> 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 <leo.yan@linaro.org>
b4 even collected the fixes, that I checked and is in tree, etc.
Thanks, applied.
- Arnaldo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-04 19:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-01 19:46 [PATCH] perf test record user-regs: Fix mask for vg register vmolnaro
2023-12-03 6:13 ` Leo Yan
2023-12-04 19:33 ` Arnaldo Carvalho de Melo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.