* [PATCH v1] perf test: Fix hybrid testing of event fallback test
@ 2025-12-01 23:11 Ian Rogers
2025-12-02 1:21 ` Mi, Dapeng
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Ian Rogers @ 2025-12-01 23:11 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Alexander Shishkin, Jiri Olsa, Ian Rogers,
Adrian Hunter, Zide Chen, Dapeng Mi, linux-perf-users,
linux-kernel
The mem-loads-aux event exists on hybrid systems but the "cpu" PMU
does not. This causes an event parsing error which erroneously makes
the test look like it is failing. Avoid naming the PMU to avoid
this. Rather than cleaning up perf.data in the directory the test is
run, explicitly send the 'perf record' output to /dev/null and avoid
any cleanup scripts.
Fixes: fc9c17b22352 ("perf test: Add a perf event fallback test")
Signed-off-by: Ian Rogers <irogers@google.com>
---
.../tests/shell/test_event_open_fallback.sh | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
diff --git a/tools/perf/tests/shell/test_event_open_fallback.sh b/tools/perf/tests/shell/test_event_open_fallback.sh
index 9c411153c01b..9420a7557c13 100755
--- a/tools/perf/tests/shell/test_event_open_fallback.sh
+++ b/tools/perf/tests/shell/test_event_open_fallback.sh
@@ -6,24 +6,9 @@ skip_cnt=0
ok_cnt=0
err_cnt=0
-cleanup()
-{
- rm -f perf.data
- rm -f perf.data.old
- trap - EXIT TERM INT
-}
-
-trap_cleanup()
-{
- cleanup
- exit 1
-}
-
-trap trap_cleanup EXIT TERM INT
-
perf_record()
{
- perf record "$@" -- true 1>/dev/null 2>&1
+ perf record -o /dev/null "$@" -- true 1>/dev/null 2>&1
}
test_decrease_precise_ip()
@@ -49,7 +34,7 @@ test_decrease_precise_ip_complicated()
perf list pmu | grep -q 'mem-loads-aux' || return 2
- if ! perf_record -e '{cpu/mem-loads-aux/S,cpu/mem-loads/PS}'; then
+ if ! perf_record -e '{mem-loads-aux:S,mem-loads:PS}'; then
return 1
fi
return 0
--
2.52.0.158.g65b55ccf14-goog
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1] perf test: Fix hybrid testing of event fallback test
2025-12-01 23:11 [PATCH v1] perf test: Fix hybrid testing of event fallback test Ian Rogers
@ 2025-12-02 1:21 ` Mi, Dapeng
2025-12-02 21:41 ` Namhyung Kim
2025-12-03 17:58 ` Namhyung Kim
2 siblings, 0 replies; 6+ messages in thread
From: Mi, Dapeng @ 2025-12-02 1:21 UTC (permalink / raw)
To: Ian Rogers, Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Alexander Shishkin, Jiri Olsa, Adrian Hunter,
Zide Chen, linux-perf-users, linux-kernel
On 12/2/2025 7:11 AM, Ian Rogers wrote:
> The mem-loads-aux event exists on hybrid systems but the "cpu" PMU
> does not. This causes an event parsing error which erroneously makes
> the test look like it is failing. Avoid naming the PMU to avoid
> this. Rather than cleaning up perf.data in the directory the test is
> run, explicitly send the 'perf record' output to /dev/null and avoid
> any cleanup scripts.
>
> Fixes: fc9c17b22352 ("perf test: Add a perf event fallback test")
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
> .../tests/shell/test_event_open_fallback.sh | 19 ++-----------------
> 1 file changed, 2 insertions(+), 17 deletions(-)
>
> diff --git a/tools/perf/tests/shell/test_event_open_fallback.sh b/tools/perf/tests/shell/test_event_open_fallback.sh
> index 9c411153c01b..9420a7557c13 100755
> --- a/tools/perf/tests/shell/test_event_open_fallback.sh
> +++ b/tools/perf/tests/shell/test_event_open_fallback.sh
> @@ -6,24 +6,9 @@ skip_cnt=0
> ok_cnt=0
> err_cnt=0
>
> -cleanup()
> -{
> - rm -f perf.data
> - rm -f perf.data.old
> - trap - EXIT TERM INT
> -}
> -
> -trap_cleanup()
> -{
> - cleanup
> - exit 1
> -}
> -
> -trap trap_cleanup EXIT TERM INT
> -
> perf_record()
> {
> - perf record "$@" -- true 1>/dev/null 2>&1
> + perf record -o /dev/null "$@" -- true 1>/dev/null 2>&1
> }
>
> test_decrease_precise_ip()
> @@ -49,7 +34,7 @@ test_decrease_precise_ip_complicated()
>
> perf list pmu | grep -q 'mem-loads-aux' || return 2
>
> - if ! perf_record -e '{cpu/mem-loads-aux/S,cpu/mem-loads/PS}'; then
> + if ! perf_record -e '{mem-loads-aux:S,mem-loads:PS}'; then
> return 1
> fi
> return 0
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] perf test: Fix hybrid testing of event fallback test
2025-12-01 23:11 [PATCH v1] perf test: Fix hybrid testing of event fallback test Ian Rogers
2025-12-02 1:21 ` Mi, Dapeng
@ 2025-12-02 21:41 ` Namhyung Kim
2025-12-02 23:05 ` Ian Rogers
2025-12-03 17:58 ` Namhyung Kim
2 siblings, 1 reply; 6+ messages in thread
From: Namhyung Kim @ 2025-12-02 21:41 UTC (permalink / raw)
To: Ian Rogers
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Zide Chen,
Dapeng Mi, linux-perf-users, linux-kernel
On Mon, Dec 01, 2025 at 03:11:36PM -0800, Ian Rogers wrote:
> The mem-loads-aux event exists on hybrid systems but the "cpu" PMU
> does not. This causes an event parsing error which erroneously makes
> the test look like it is failing. Avoid naming the PMU to avoid
> this. Rather than cleaning up perf.data in the directory the test is
> run, explicitly send the 'perf record' output to /dev/null and avoid
> any cleanup scripts.
>
> Fixes: fc9c17b22352 ("perf test: Add a perf event fallback test")
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
> .../tests/shell/test_event_open_fallback.sh | 19 ++-----------------
> 1 file changed, 2 insertions(+), 17 deletions(-)
>
> diff --git a/tools/perf/tests/shell/test_event_open_fallback.sh b/tools/perf/tests/shell/test_event_open_fallback.sh
> index 9c411153c01b..9420a7557c13 100755
> --- a/tools/perf/tests/shell/test_event_open_fallback.sh
> +++ b/tools/perf/tests/shell/test_event_open_fallback.sh
> @@ -6,24 +6,9 @@ skip_cnt=0
> ok_cnt=0
> err_cnt=0
>
> -cleanup()
> -{
> - rm -f perf.data
> - rm -f perf.data.old
> - trap - EXIT TERM INT
> -}
> -
> -trap_cleanup()
> -{
> - cleanup
> - exit 1
> -}
> -
> -trap trap_cleanup EXIT TERM INT
> -
> perf_record()
> {
> - perf record "$@" -- true 1>/dev/null 2>&1
> + perf record -o /dev/null "$@" -- true 1>/dev/null 2>&1
> }
>
> test_decrease_precise_ip()
> @@ -49,7 +34,7 @@ test_decrease_precise_ip_complicated()
>
> perf list pmu | grep -q 'mem-loads-aux' || return 2
>
> - if ! perf_record -e '{cpu/mem-loads-aux/S,cpu/mem-loads/PS}'; then
> + if ! perf_record -e '{mem-loads-aux:S,mem-loads:PS}'; then
I think we need to either keep the trap handler or convert all perf
record commands including this to use -o /dev/null.
Thanks,
Namhyung
> return 1
> fi
> return 0
> --
> 2.52.0.158.g65b55ccf14-goog
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] perf test: Fix hybrid testing of event fallback test
2025-12-02 21:41 ` Namhyung Kim
@ 2025-12-02 23:05 ` Ian Rogers
2025-12-02 23:59 ` Namhyung Kim
0 siblings, 1 reply; 6+ messages in thread
From: Ian Rogers @ 2025-12-02 23:05 UTC (permalink / raw)
To: Namhyung Kim
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Zide Chen,
Dapeng Mi, linux-perf-users, linux-kernel
On Tue, Dec 2, 2025 at 1:41 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> On Mon, Dec 01, 2025 at 03:11:36PM -0800, Ian Rogers wrote:
> > The mem-loads-aux event exists on hybrid systems but the "cpu" PMU
> > does not. This causes an event parsing error which erroneously makes
> > the test look like it is failing. Avoid naming the PMU to avoid
> > this. Rather than cleaning up perf.data in the directory the test is
> > run, explicitly send the 'perf record' output to /dev/null and avoid
> > any cleanup scripts.
> >
> > Fixes: fc9c17b22352 ("perf test: Add a perf event fallback test")
> > Signed-off-by: Ian Rogers <irogers@google.com>
> > ---
> > .../tests/shell/test_event_open_fallback.sh | 19 ++-----------------
> > 1 file changed, 2 insertions(+), 17 deletions(-)
> >
> > diff --git a/tools/perf/tests/shell/test_event_open_fallback.sh b/tools/perf/tests/shell/test_event_open_fallback.sh
> > index 9c411153c01b..9420a7557c13 100755
> > --- a/tools/perf/tests/shell/test_event_open_fallback.sh
> > +++ b/tools/perf/tests/shell/test_event_open_fallback.sh
> > @@ -6,24 +6,9 @@ skip_cnt=0
> > ok_cnt=0
> > err_cnt=0
> >
> > -cleanup()
> > -{
> > - rm -f perf.data
> > - rm -f perf.data.old
> > - trap - EXIT TERM INT
> > -}
> > -
> > -trap_cleanup()
> > -{
> > - cleanup
> > - exit 1
> > -}
> > -
> > -trap trap_cleanup EXIT TERM INT
> > -
> > perf_record()
> > {
> > - perf record "$@" -- true 1>/dev/null 2>&1
> > + perf record -o /dev/null "$@" -- true 1>/dev/null 2>&1
> > }
> >
> > test_decrease_precise_ip()
> > @@ -49,7 +34,7 @@ test_decrease_precise_ip_complicated()
> >
> > perf list pmu | grep -q 'mem-loads-aux' || return 2
> >
> > - if ! perf_record -e '{cpu/mem-loads-aux/S,cpu/mem-loads/PS}'; then
> > + if ! perf_record -e '{mem-loads-aux:S,mem-loads:PS}'; then
>
> I think we need to either keep the trap handler or convert all perf
> record commands including this to use -o /dev/null.
So all the perf record commands use "-o /dev/null" as perf record is
always run using the "perf_record" function (ie the one updated here)
:-)
Thanks,
Ian
> Thanks,
> Namhyung
>
>
> > return 1
> > fi
> > return 0
> > --
> > 2.52.0.158.g65b55ccf14-goog
> >
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] perf test: Fix hybrid testing of event fallback test
2025-12-02 23:05 ` Ian Rogers
@ 2025-12-02 23:59 ` Namhyung Kim
0 siblings, 0 replies; 6+ messages in thread
From: Namhyung Kim @ 2025-12-02 23:59 UTC (permalink / raw)
To: Ian Rogers
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Zide Chen,
Dapeng Mi, linux-perf-users, linux-kernel
On Tue, Dec 02, 2025 at 03:05:12PM -0800, Ian Rogers wrote:
> On Tue, Dec 2, 2025 at 1:41 PM Namhyung Kim <namhyung@kernel.org> wrote:
> >
> > On Mon, Dec 01, 2025 at 03:11:36PM -0800, Ian Rogers wrote:
> > > The mem-loads-aux event exists on hybrid systems but the "cpu" PMU
> > > does not. This causes an event parsing error which erroneously makes
> > > the test look like it is failing. Avoid naming the PMU to avoid
> > > this. Rather than cleaning up perf.data in the directory the test is
> > > run, explicitly send the 'perf record' output to /dev/null and avoid
> > > any cleanup scripts.
> > >
> > > Fixes: fc9c17b22352 ("perf test: Add a perf event fallback test")
> > > Signed-off-by: Ian Rogers <irogers@google.com>
> > > ---
> > > .../tests/shell/test_event_open_fallback.sh | 19 ++-----------------
> > > 1 file changed, 2 insertions(+), 17 deletions(-)
> > >
> > > diff --git a/tools/perf/tests/shell/test_event_open_fallback.sh b/tools/perf/tests/shell/test_event_open_fallback.sh
> > > index 9c411153c01b..9420a7557c13 100755
> > > --- a/tools/perf/tests/shell/test_event_open_fallback.sh
> > > +++ b/tools/perf/tests/shell/test_event_open_fallback.sh
> > > @@ -6,24 +6,9 @@ skip_cnt=0
> > > ok_cnt=0
> > > err_cnt=0
> > >
> > > -cleanup()
> > > -{
> > > - rm -f perf.data
> > > - rm -f perf.data.old
> > > - trap - EXIT TERM INT
> > > -}
> > > -
> > > -trap_cleanup()
> > > -{
> > > - cleanup
> > > - exit 1
> > > -}
> > > -
> > > -trap trap_cleanup EXIT TERM INT
> > > -
> > > perf_record()
> > > {
> > > - perf record "$@" -- true 1>/dev/null 2>&1
> > > + perf record -o /dev/null "$@" -- true 1>/dev/null 2>&1
> > > }
> > >
> > > test_decrease_precise_ip()
> > > @@ -49,7 +34,7 @@ test_decrease_precise_ip_complicated()
> > >
> > > perf list pmu | grep -q 'mem-loads-aux' || return 2
> > >
> > > - if ! perf_record -e '{cpu/mem-loads-aux/S,cpu/mem-loads/PS}'; then
> > > + if ! perf_record -e '{mem-loads-aux:S,mem-loads:PS}'; then
> >
> > I think we need to either keep the trap handler or convert all perf
> > record commands including this to use -o /dev/null.
>
> So all the perf record commands use "-o /dev/null" as perf record is
> always run using the "perf_record" function (ie the one updated here)
> :-)
Oh.. I missed that. LGTM!
Thanks,
Namhyung
> >
> >
> > > return 1
> > > fi
> > > return 0
> > > --
> > > 2.52.0.158.g65b55ccf14-goog
> > >
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] perf test: Fix hybrid testing of event fallback test
2025-12-01 23:11 [PATCH v1] perf test: Fix hybrid testing of event fallback test Ian Rogers
2025-12-02 1:21 ` Mi, Dapeng
2025-12-02 21:41 ` Namhyung Kim
@ 2025-12-03 17:58 ` Namhyung Kim
2 siblings, 0 replies; 6+ messages in thread
From: Namhyung Kim @ 2025-12-03 17:58 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Zide Chen,
Dapeng Mi, linux-perf-users, linux-kernel, Ian Rogers
On Mon, 01 Dec 2025 15:11:36 -0800, Ian Rogers wrote:
> The mem-loads-aux event exists on hybrid systems but the "cpu" PMU
> does not. This causes an event parsing error which erroneously makes
> the test look like it is failing. Avoid naming the PMU to avoid
> this. Rather than cleaning up perf.data in the directory the test is
> run, explicitly send the 'perf record' output to /dev/null and avoid
> any cleanup scripts.
>
> [...]
Applied to perf-tools-next, thanks!
Best regards,
Namhyung
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-12-03 17:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-01 23:11 [PATCH v1] perf test: Fix hybrid testing of event fallback test Ian Rogers
2025-12-02 1:21 ` Mi, Dapeng
2025-12-02 21:41 ` Namhyung Kim
2025-12-02 23:05 ` Ian Rogers
2025-12-02 23:59 ` Namhyung Kim
2025-12-03 17:58 ` Namhyung Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).