Skip to content

Commit 2f5d370

Browse files
james-c-linaronamhyung
authored andcommitted
perf test: Change all remaining #!/bin/sh to #!/bin/bash
There are 43 instances of posix shell tests and 35 instances of bash. To give us a single consistent language for testing in, replace all #!/bin/sh to #!/bin/bash. Common sources that are included in both different shells will now work as expected. And we no longer have to fix up bashisms that appear to work when someone's system has sh symlinked to bash, but don't work on other systems that have both shells installed. Although we could have chosen sh, it's not backwards compatible so it wouldn't be possible to bulk convert without re-writing the existing bash tests. Choosing bash also gives us some nicer features including 'local' variable definitions and regexes in if statements that are already widely used in the tests. It's not expected that there are any users with only sh available due to the large number of bash tests that exist. Discussed in relation to running shellcheck here: https://lore.kernel.org/linux-perf-users/e3751a74be34bbf3781c4644f518702a7270220b.1749785642.git.collin.funk1@gmail.com/ Signed-off-by: James Clark <[email protected]> Reviewed-by: Collin Funk <[email protected]> Acked-by: Arnaldo Carvalho de Melo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
1 parent f0d0f97 commit 2f5d370

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+43
-43
lines changed

tools/perf/tests/perf-targz-src-pkg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
# SPDX-License-Identifier: GPL-2.0
33
# Test one of the main kernel Makefile targets to generate a perf sources tarball
44
# suitable for build outside the full kernel sources.

tools/perf/tests/shell/amd-ibs-swfilt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
# AMD IBS software filtering
33

44
echo "check availability of IBS swfilt"

tools/perf/tests/shell/buildid.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
# build id cache operations
33
# SPDX-License-Identifier: GPL-2.0
44

tools/perf/tests/shell/coresight/asm_pure_loop.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh -e
1+
#!/bin/bash -e
22
# CoreSight / ASM Pure Loop (exclusive)
33

44
# SPDX-License-Identifier: GPL-2.0

tools/perf/tests/shell/coresight/memcpy_thread_16k_10.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh -e
1+
#!/bin/bash -e
22
# CoreSight / Memcpy 16k 10 Threads (exclusive)
33

44
# SPDX-License-Identifier: GPL-2.0

tools/perf/tests/shell/coresight/thread_loop_check_tid_10.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh -e
1+
#!/bin/bash -e
22
# CoreSight / Thread Loop 10 Threads - Check TID (exclusive)
33

44
# SPDX-License-Identifier: GPL-2.0

tools/perf/tests/shell/coresight/thread_loop_check_tid_2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh -e
1+
#!/bin/bash -e
22
# CoreSight / Thread Loop 2 Threads - Check TID (exclusive)
33

44
# SPDX-License-Identifier: GPL-2.0

tools/perf/tests/shell/coresight/unroll_loop_thread_10.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh -e
1+
#!/bin/bash -e
22
# CoreSight / Unroll Loop Thread 10 (exclusive)
33

44
# SPDX-License-Identifier: GPL-2.0

tools/perf/tests/shell/diff.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
# perf diff tests
33
# SPDX-License-Identifier: GPL-2.0
44

tools/perf/tests/shell/ftrace.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
# perf ftrace tests
33
# SPDX-License-Identifier: GPL-2.0
44

0 commit comments

Comments
 (0)