* Please backport subset of 2f5d370dec3f ("perf test: Change all remaining #!/bin/sh to #!/bin/bash") for stat_bpf_counters.sh script to v6.12.y and older
@ 2026-09-18 19:08 Salvatore Bonaccorso
2026-09-18 19:20 ` Salvatore Bonaccorso
0 siblings, 1 reply; 3+ messages in thread
From: Salvatore Bonaccorso @ 2026-09-18 19:08 UTC (permalink / raw)
To: stable, Greg Kroah-Hartman, Sasha Levin
Cc: linux-perf-users, linux-kernel, James Clark, Collin Funk,
Arnaldo Carvalho de Melo, Namhyung Kim, Ian Rogers
Hi
Recently for v5.15.221, v6.1.188, v6.6.157, v6.12.110, v6.18.52 and
v7.2.6, the commit b02027776ac5 ("perf tests: Fix flakiness in BPF
counters test on hybrid systems") was backported, but it introduced
bash specific syntax. For versions after 2f5d370dec3f ("perf test:
Change all remaining #!/bin/sh to #!/bin/bash") aka before v6.17-rc1
this is not a problem.
The proposed patch is a stable series backports specific one, as one
cannot simply backport 2f5d370dec3f ("perf test: Change all remaining
#!/bin/sh to #!/bin/bash") without picking as well some other context
related changes to make it possible. So I was proposing to only change
shebang to #!/bin/bash in stable series were it is a problem, as in
the stat_bpf_counters.sh script.
Regards,
Salvatore
From 1e3d5b5f62047b147428d20bf2cb794bb0bb300d Mon Sep 17 00:00:00 2001
From: Salvatore Bonaccorso <carnil@debian.org>
Date: Fri, 18 Sep 2026 20:48:59 +0200
Subject: [PATCH] perf tests: Change shebang for stat_bpf_counters.sh to
#!/bin/bash
When commit b02027776ac5 ("perf tests: Fix flakiness in BPF counters
test on hybrid systems") was backported to several stable series
(v5.15.221, v6.1.188, v6.6.157, v6.12.110, v6.18.52, v7.2.6) it
introduced specific bash syntax. For versions after 2f5d370dec3f ("perf
test: Change all remaining #!/bin/sh to #!/bin/bash") in v6.17-rc1 this
is not a problem as the shebang was already hanged to #!/bin/bash. For
the older stable series this introduced invalid syntax if #!/bin/sh is
not bash:
$ sh -n tools/perf/tests/shell/stat_bpf_counters.sh
tools/perf/tests/shell/stat_bpf_counters.sh: 12: Syntax error: "(" unexpected
$ checkbashism tools/perf/tests/shell/stat_bpf_counters.sh
possible bashism in tools/perf/tests/shell/stat_bpf_counters.sh line 52 (bash arrays, ${name[0|*|@]}):
base_instructions=$(perf stat --no-big-num -e instructions:u -- "${workload[@]}" 2>&1 | \
awk -v i=0 -v c=0 '/instructions/ { \
if ($1 != "<not") { i++; c += $1 } \
} END { if (i > 0) printf "%.0f", c; else print "<not" }')
possible bashism in tools/perf/tests/shell/stat_bpf_counters.sh line 57 (bash arrays, ${name[0|*|@]}):
bpf_instructions=$(perf stat --no-big-num --bpf-counters -e instructions:u \
-- "${workload[@]}" 2>&1 | \
awk -v i=0 -v c=0 '/instructions/ { \
if ($1 != "<not") { i++; c += $1 } \
} END { if (i > 0) printf "%.0f", c; else print "<not" }')
possible bashism in tools/perf/tests/shell/stat_bpf_counters.sh line 68 (bash arrays, ${name[0|*|@]}):
stat_output=$(perf stat --no-big-num \
-e instructions/name=base_instructions/u,instructions/name=bpf_instructions/bu \
-- "${workload[@]}" 2>&1)
Change shebang for the stat_bpf_counters.sh script.
No upstream commit exists for this change as for versions post 6.17-rc1
the scripts were converted to #!/bin/bash already.
Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
---
tools/perf/tests/shell/stat_bpf_counters.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/tests/shell/stat_bpf_counters.sh b/tools/perf/tests/shell/stat_bpf_counters.sh
index 76d4a7f15a43..c4f71bfc0fc6 100755
--- a/tools/perf/tests/shell/stat_bpf_counters.sh
+++ b/tools/perf/tests/shell/stat_bpf_counters.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# perf stat --bpf-counters test
# SPDX-License-Identifier: GPL-2.0
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Please backport subset of 2f5d370dec3f ("perf test: Change all remaining #!/bin/sh to #!/bin/bash") for stat_bpf_counters.sh script to v6.12.y and older
2026-09-18 19:08 Please backport subset of 2f5d370dec3f ("perf test: Change all remaining #!/bin/sh to #!/bin/bash") for stat_bpf_counters.sh script to v6.12.y and older Salvatore Bonaccorso
@ 2026-09-18 19:20 ` Salvatore Bonaccorso
2026-09-18 19:41 ` Ian Rogers
0 siblings, 1 reply; 3+ messages in thread
From: Salvatore Bonaccorso @ 2026-09-18 19:20 UTC (permalink / raw)
To: stable, Greg Kroah-Hartman, Sasha Levin
Cc: linux-perf-users, linux-kernel, James Clark, Collin Funk,
Arnaldo Carvalho de Melo, Namhyung Kim, Ian Rogers
Hi,
On Fri, Sep 18, 2026 at 09:08:48PM +0200, Salvatore Bonaccorso wrote:
> Hi
>
> Recently for v5.15.221, v6.1.188, v6.6.157, v6.12.110, v6.18.52 and
> v7.2.6, the commit b02027776ac5 ("perf tests: Fix flakiness in BPF
> counters test on hybrid systems") was backported, but it introduced
> bash specific syntax. For versions after 2f5d370dec3f ("perf test:
> Change all remaining #!/bin/sh to #!/bin/bash") aka before v6.17-rc1
> this is not a problem.
>
> The proposed patch is a stable series backports specific one, as one
> cannot simply backport 2f5d370dec3f ("perf test: Change all remaining
> #!/bin/sh to #!/bin/bash") without picking as well some other context
> related changes to make it possible. So I was proposing to only change
> shebang to #!/bin/bash in stable series were it is a problem, as in
> the stat_bpf_counters.sh script.
"Obviously" there was a typo in the commit message and a missing
explanation, thus v2 of the proposed change as follows.
Regards,
Salvatore
From 804ae26dab32c846467d7b7887d8f7dcd3348fa5 Mon Sep 17 00:00:00 2001
From: Salvatore Bonaccorso <carnil@debian.org>
Date: Fri, 18 Sep 2026 20:48:59 +0200
Subject: [PATCH] perf tests: Change shebang for stat_bpf_counters.sh to
#!/bin/bash
When commit b02027776ac5 ("perf tests: Fix flakiness in BPF counters
test on hybrid systems") was backported to several stable series
(v5.15.221, v6.1.188, v6.6.157, v6.12.110, v6.18.52, v7.2.6) it
introduced specific bash syntax. For versions after 2f5d370dec3f ("perf
test: Change all remaining #!/bin/sh to #!/bin/bash") in v6.17-rc1 this
is not a problem as the shebang was already changed to #!/bin/bash. For
the older stable series this introduced invalid syntax if #!/bin/sh is
not bash:
$ sh -n tools/perf/tests/shell/stat_bpf_counters.sh
tools/perf/tests/shell/stat_bpf_counters.sh: 12: Syntax error: "(" unexpected
$ checkbashism tools/perf/tests/shell/stat_bpf_counters.sh
possible bashism in tools/perf/tests/shell/stat_bpf_counters.sh line 52 (bash arrays, ${name[0|*|@]}):
base_instructions=$(perf stat --no-big-num -e instructions:u -- "${workload[@]}" 2>&1 | \
awk -v i=0 -v c=0 '/instructions/ { \
if ($1 != "<not") { i++; c += $1 } \
} END { if (i > 0) printf "%.0f", c; else print "<not" }')
possible bashism in tools/perf/tests/shell/stat_bpf_counters.sh line 57 (bash arrays, ${name[0|*|@]}):
bpf_instructions=$(perf stat --no-big-num --bpf-counters -e instructions:u \
-- "${workload[@]}" 2>&1 | \
awk -v i=0 -v c=0 '/instructions/ { \
if ($1 != "<not") { i++; c += $1 } \
} END { if (i > 0) printf "%.0f", c; else print "<not" }')
possible bashism in tools/perf/tests/shell/stat_bpf_counters.sh line 68 (bash arrays, ${name[0|*|@]}):
stat_output=$(perf stat --no-big-num \
-e instructions/name=base_instructions/u,instructions/name=bpf_instructions/bu \
-- "${workload[@]}" 2>&1)
Change shebang for the stat_bpf_counters.sh script to #!/bin/bash.
No upstream commit exists for this change as for versions post 6.17-rc1
the scripts were converted to #!/bin/bash already.
Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
---
v2:
- Fixed a typo in commit message: hanged -> changed
- Explicit state to what shebang was changed for stat_bpf_counters.sh
script.
tools/perf/tests/shell/stat_bpf_counters.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/tests/shell/stat_bpf_counters.sh b/tools/perf/tests/shell/stat_bpf_counters.sh
index 76d4a7f15a43..c4f71bfc0fc6 100755
--- a/tools/perf/tests/shell/stat_bpf_counters.sh
+++ b/tools/perf/tests/shell/stat_bpf_counters.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# perf stat --bpf-counters test
# SPDX-License-Identifier: GPL-2.0
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Please backport subset of 2f5d370dec3f ("perf test: Change all remaining #!/bin/sh to #!/bin/bash") for stat_bpf_counters.sh script to v6.12.y and older
2026-09-18 19:20 ` Salvatore Bonaccorso
@ 2026-09-18 19:41 ` Ian Rogers
0 siblings, 0 replies; 3+ messages in thread
From: Ian Rogers @ 2026-09-18 19:41 UTC (permalink / raw)
To: Salvatore Bonaccorso, stable, Greg Kroah-Hartman, Sasha Levin
Cc: linux-perf-users, linux-kernel, James Clark, Collin Funk,
Arnaldo Carvalho de Melo, Namhyung Kim
On Fri, Sep 18, 2026 at 12:20 PM Salvatore Bonaccorso <carnil@debian.org> wrote:
>
> Hi,
>
> On Fri, Sep 18, 2026 at 09:08:48PM +0200, Salvatore Bonaccorso wrote:
> > Hi
> >
> > Recently for v5.15.221, v6.1.188, v6.6.157, v6.12.110, v6.18.52 and
> > v7.2.6, the commit b02027776ac5 ("perf tests: Fix flakiness in BPF
> > counters test on hybrid systems") was backported, but it introduced
> > bash specific syntax. For versions after 2f5d370dec3f ("perf test:
> > Change all remaining #!/bin/sh to #!/bin/bash") aka before v6.17-rc1
> > this is not a problem.
> >
> > The proposed patch is a stable series backports specific one, as one
> > cannot simply backport 2f5d370dec3f ("perf test: Change all remaining
> > #!/bin/sh to #!/bin/bash") without picking as well some other context
> > related changes to make it possible. So I was proposing to only change
> > shebang to #!/bin/bash in stable series were it is a problem, as in
> > the stat_bpf_counters.sh script.
>
> "Obviously" there was a typo in the commit message and a missing
> explanation, thus v2 of the proposed change as follows.
>
> Regards,
> Salvatore
>
> From 804ae26dab32c846467d7b7887d8f7dcd3348fa5 Mon Sep 17 00:00:00 2001
> From: Salvatore Bonaccorso <carnil@debian.org>
> Date: Fri, 18 Sep 2026 20:48:59 +0200
> Subject: [PATCH] perf tests: Change shebang for stat_bpf_counters.sh to
> #!/bin/bash
>
> When commit b02027776ac5 ("perf tests: Fix flakiness in BPF counters
> test on hybrid systems") was backported to several stable series
> (v5.15.221, v6.1.188, v6.6.157, v6.12.110, v6.18.52, v7.2.6) it
> introduced specific bash syntax. For versions after 2f5d370dec3f ("perf
> test: Change all remaining #!/bin/sh to #!/bin/bash") in v6.17-rc1 this
> is not a problem as the shebang was already changed to #!/bin/bash. For
> the older stable series this introduced invalid syntax if #!/bin/sh is
> not bash:
>
> $ sh -n tools/perf/tests/shell/stat_bpf_counters.sh
> tools/perf/tests/shell/stat_bpf_counters.sh: 12: Syntax error: "(" unexpected
>
> $ checkbashism tools/perf/tests/shell/stat_bpf_counters.sh
> possible bashism in tools/perf/tests/shell/stat_bpf_counters.sh line 52 (bash arrays, ${name[0|*|@]}):
> base_instructions=$(perf stat --no-big-num -e instructions:u -- "${workload[@]}" 2>&1 | \
> awk -v i=0 -v c=0 '/instructions/ { \
> if ($1 != "<not") { i++; c += $1 } \
> } END { if (i > 0) printf "%.0f", c; else print "<not" }')
> possible bashism in tools/perf/tests/shell/stat_bpf_counters.sh line 57 (bash arrays, ${name[0|*|@]}):
> bpf_instructions=$(perf stat --no-big-num --bpf-counters -e instructions:u \
> -- "${workload[@]}" 2>&1 | \
> awk -v i=0 -v c=0 '/instructions/ { \
> if ($1 != "<not") { i++; c += $1 } \
> } END { if (i > 0) printf "%.0f", c; else print "<not" }')
> possible bashism in tools/perf/tests/shell/stat_bpf_counters.sh line 68 (bash arrays, ${name[0|*|@]}):
> stat_output=$(perf stat --no-big-num \
> -e instructions/name=base_instructions/u,instructions/name=bpf_instructions/bu \
> -- "${workload[@]}" 2>&1)
>
> Change shebang for the stat_bpf_counters.sh script to #!/bin/bash.
>
> No upstream commit exists for this change as for versions post 6.17-rc1
> the scripts were converted to #!/bin/bash already.
>
> Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
Reviewed-by: Ian Rogers <irogers@google.com>
This should have been caught by the perf tool build as that build runs
shellcheck on all tests when shellcheck is available. Maybe there
should be an action to run perf builds as part of the stable backports
when the tools/perf directory is touched.
Thanks,
Ian
> ---
> v2:
> - Fixed a typo in commit message: hanged -> changed
> - Explicit state to what shebang was changed for stat_bpf_counters.sh
> script.
>
> tools/perf/tests/shell/stat_bpf_counters.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/tests/shell/stat_bpf_counters.sh b/tools/perf/tests/shell/stat_bpf_counters.sh
> index 76d4a7f15a43..c4f71bfc0fc6 100755
> --- a/tools/perf/tests/shell/stat_bpf_counters.sh
> +++ b/tools/perf/tests/shell/stat_bpf_counters.sh
> @@ -1,4 +1,4 @@
> -#!/bin/sh
> +#!/bin/bash
> # perf stat --bpf-counters test
> # SPDX-License-Identifier: GPL-2.0
>
> --
> 2.55.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-18 19:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-18 19:08 Please backport subset of 2f5d370dec3f ("perf test: Change all remaining #!/bin/sh to #!/bin/bash") for stat_bpf_counters.sh script to v6.12.y and older Salvatore Bonaccorso
2026-09-18 19:20 ` Salvatore Bonaccorso
2026-09-18 19:41 ` Ian Rogers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®