Re: [PATCH 1/1 v6.16] perf test event_uniquifying: Skip test on platforms without 'clockticks' events
From: Chun-Tse Shao
Date: Fri Jun 06 2025 - 22:56:16 EST
Thank you Arnaldo for finding this problem. Please feel free to amend your fix.
-CT
On Fri, Jun 6, 2025 at 1:25 PM Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:
>
> On Fri, Jun 06, 2025 at 05:18:07PM -0300, Arnaldo Carvalho de Melo wrote:
> > On Fri, Jun 06, 2025 at 10:52:02AM -0700, Namhyung Kim wrote:
> > > On Thu, Jun 05, 2025 at 04:22:40PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > I'll add this to perf-tools for v6.16, please check.
>
> > > Plesae see
>
> > > https://lore.kernel.org/linux-perf-users/20250521224513.1104129-1-ctshao@xxxxxxxxxx/
>
> > Oh, great, I'll drop my fix and get that one instead.
>
> Nope, that one returns ok if the test can't be performed, it should
> return 2 so that it is skipped and since we don't have a way to show the
> reason for skipping a shell test, when using 'perf test -vv' the warning
> that is there already (the needed PMU not being available) will be
> shown.
>
> So I'm amending this on top, ok?
>
> diff --git a/tools/perf/tests/shell/stat+event_uniquifying.sh b/tools/perf/tests/shell/stat+event_uniquifying.sh
> index 5a51fbaa13bb9b3c..c39d77ab4ad95bfc 100755
> --- a/tools/perf/tests/shell/stat+event_uniquifying.sh
> +++ b/tools/perf/tests/shell/stat+event_uniquifying.sh
> @@ -47,6 +47,7 @@ test_event_uniquifying() {
> # Skip if the machine does not have `uncore_imc` device.
> if ! ${perf_tool} list pmu | grep -q ${pmu}; then
> echo "Target does not support pmu ${pmu} [Skipped]"
> + err=2
> return
> fi
>
> Then we get:
> root@number:~# perf test uniqu
> 93: perf stat events uniquifying : Skip
> root@number:~#
>
> Instead of the misleading:
>
> root@number:~# perf test uniqu
> 93: perf stat events uniquifying : Ok
> root@number:~#
>
> With -vv and the fix:
>
> root@number:~# perf test -vv uniqu
> 93: perf stat events uniquifying:
> --- start ---
> test child forked, pid 94671
> stat event uniquifying test
> Target does not support PMU uncore_imc [Skipped]
> ---- end(-2) ----
> 93: perf stat events uniquifying : Skip
> root@number:~#
>
> - Arnaldo