Skip to contentSkip to conversation

perf test: Improve shellcheck source directives

PATCH Applied James Clark 4 participants 7 messages Sep 21 – Sep 24 perf events

lore
Share & tools
lore

James Clark

author reviewer
#0 lore raw

cover perf test: Improve shellcheck source directives

I was hacking away when I got blocked by a shellcheck warning about an unassigned variable, despite that variable being assigned in a sourced file and having visibly correct source= directive.

Confusingly two things turned out to be relevant to this. One is that -a doesn't make shellcheck follow "external" paths, which these are treated as. You need -x for that. Secondly, the source= directives don't cause it to follow the path either, they just suppress a warning message about dynamic paths in versions of shellcheck before 0.7.2. This warning can be silenced with "source=/dev/null" and doesn't require any particular path to be provided if -x isn't used.

---
James Clark (2):
perf test: Remove redundant shellcheck source paths perf build: Follow sourced files when running shellcheck

 tools/perf/Makefile.perf                                  | 2 +-
 tools/perf/tests/shell/annotate.sh                        | 1 -
 tools/perf/tests/shell/base_probe/test_adding_kernel.sh   | 1 -
 tools/perf/tests/shell/diff.sh                            | 1 -
 tools/perf/tests/shell/inject_aslr.sh                     | 1 -
 tools/perf/tests/shell/jitdump-python.sh                  | 1 -
 tools/perf/tests/shell/list.sh                            | 1 -
 tools/perf/tests/shell/pipe_test.sh                       | 1 -
 tools/perf/tests/shell/probe_vfs_getname.sh               | 2 --
 tools/perf/tests/shell/python-use.sh                      | 1 -
 tools/perf/tests/shell/record+probe_libc_inet_pton.sh     | 2 --
 tools/perf/tests/shell/record+script_probe_vfs_getname.sh | 2 --
 tools/perf/tests/shell/record.sh                          | 2 --
 tools/perf/tests/shell/record_weak_term.sh                | 1 -
 tools/perf/tests/shell/script_dlfilter.sh                 | 1 -
 tools/perf/tests/shell/stat+csv_output.sh                 | 1 -
 tools/perf/tests/shell/stat+json_output.sh                | 1 -
 tools/perf/tests/shell/stat+std_output.sh                 | 1 -
 tools/perf/tests/shell/stat_metrics_values.sh             | 1 -
 tools/perf/tests/shell/test_arm_callgraph_fp.sh           | 1 -
 tools/perf/tests/shell/test_brstack.sh                    | 1 -
 tools/perf/tests/shell/test_data_symbol.sh                | 1 -
 tools/perf/tests/shell/test_intel_pt.sh                   | 1 -
 tools/perf/tests/shell/test_perf_data_converter_json.sh   | 1 -
 tools/perf/tests/shell/test_test_junit_output.sh          | 1 -
 tools/perf/tests/shell/test_uprobe_from_different_cu.sh   | 1 -
 tools/perf/tests/shell/trace+probe_vfs_getname.sh         | 1 -
 tools/perf/tests/shell/trace_btf_enum.sh                  | 1 -
 tools/perf/tests/shell/trace_btf_general.sh               | 1 -
 tools/perf/tests/shell/trace_exit_race.sh                 | 1 -
 tools/perf/tests/shell/trace_record_replay.sh             | 2 --
 tools/perf/tests/shell/trace_summary.sh                   | 1 -
 32 files changed, 1 insertion(+), 37 deletions(-)

---
base-commit: 9453bc6a69ef43755f1c28d5688cacdd69fa16bd
change-id: 20260921-james-perf-shellcheck-source-f48df891cd4f

Best regards,

Signature · 1 line
James Clark <[email protected]>
author reviewer
#1 lore raw

PATCH 1/2 perf test: Remove redundant shellcheck source paths

The minimum required shellcheck version treats paths with leading variables as starting from the script's current directory, so shellcheck is able to source all of these files without needing the extra directives:

v0.7.2 - 2021-04-19

Changed
* SC1090: A leading $x/ or $(x)/ is now treated as ./ when locating files

Remove them to avoid future copy pasting and confusion that they are required. Because the paths weren't actually followed, they didn't have to be accurate and accepted any string to silence the warning.

---
 tools/perf/tests/shell/annotate.sh                        | 1 -
 tools/perf/tests/shell/base_probe/test_adding_kernel.sh   | 1 -
 tools/perf/tests/shell/diff.sh                            | 1 -
 tools/perf/tests/shell/inject_aslr.sh                     | 1 -
 tools/perf/tests/shell/jitdump-python.sh                  | 1 -
 tools/perf/tests/shell/list.sh                            | 1 -
 tools/perf/tests/shell/pipe_test.sh                       | 1 -
 tools/perf/tests/shell/probe_vfs_getname.sh               | 2 --
 tools/perf/tests/shell/python-use.sh                      | 1 -
 tools/perf/tests/shell/record+probe_libc_inet_pton.sh     | 2 --
 tools/perf/tests/shell/record+script_probe_vfs_getname.sh | 2 --
 tools/perf/tests/shell/record.sh                          | 2 --
 tools/perf/tests/shell/record_weak_term.sh                | 1 -
 tools/perf/tests/shell/script_dlfilter.sh                 | 1 -
 tools/perf/tests/shell/stat+csv_output.sh                 | 1 -
 tools/perf/tests/shell/stat+json_output.sh                | 1 -
 tools/perf/tests/shell/stat+std_output.sh                 | 1 -
 tools/perf/tests/shell/stat_metrics_values.sh             | 1 -
 tools/perf/tests/shell/test_arm_callgraph_fp.sh           | 1 -
 tools/perf/tests/shell/test_brstack.sh                    | 1 -
 tools/perf/tests/shell/test_data_symbol.sh                | 1 -
 tools/perf/tests/shell/test_intel_pt.sh                   | 1 -
 tools/perf/tests/shell/test_perf_data_converter_json.sh   | 1 -
 tools/perf/tests/shell/test_test_junit_output.sh          | 1 -
 tools/perf/tests/shell/test_uprobe_from_different_cu.sh   | 1 -
 tools/perf/tests/shell/trace+probe_vfs_getname.sh         | 1 -
 tools/perf/tests/shell/trace_btf_enum.sh                  | 1 -
 tools/perf/tests/shell/trace_btf_general.sh               | 1 -
 tools/perf/tests/shell/trace_exit_race.sh                 | 1 -
 tools/perf/tests/shell/trace_record_replay.sh             | 2 --
 tools/perf/tests/shell/trace_summary.sh                   | 1 -
 31 files changed, 36 deletions(-)
tools/perf/tests/shell/annotate.sh +0 -1
index 689de58e9238..26411edf5cb4 100755
@@ -6,7 +6,6 @@ set -e
 
 shelldir=$(dirname "$0")
 
-# shellcheck source=lib/perf_has_symbol.sh
 . "${shelldir}"/lib/perf_has_symbol.sh
 
 testsym="noploop"
tools/perf/tests/shell/base_probe/test_adding_kernel.sh +0 -1
index 555a825d55f2..eadac837f108 100755
@@ -19,7 +19,6 @@ TEST_RESULT=0
 # include working environment
 . "$DIR_PATH/../common/init.sh"
 
-# shellcheck source=lib/probe_vfs_getname.sh
 . "$DIR_PATH/../lib/probe_vfs_getname.sh"
 
 TEST_PROBE=${TEST_PROBE:-"inode_permission"}
tools/perf/tests/shell/diff.sh +0 -1
index fe05fdebcab5..88f37b8ef893 100755
@@ -11,7 +11,6 @@ perfdata3=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
 testprog="perf test -w thloop"
 
 shelldir=$(dirname "$0")
-# shellcheck source=lib/perf_has_symbol.sh
 . "${shelldir}"/lib/perf_has_symbol.sh
 
 testsym="test_loop"
tools/perf/tests/shell/inject_aslr.sh +0 -1
index d83c2591db8f..6ee4c8b5c850 100755
@@ -6,7 +6,6 @@ set -e
 set -o pipefail
 
 shelldir=$(dirname "$0")
-# shellcheck source=lib/perf_has_symbol.sh
 . "${shelldir}"/lib/perf_has_symbol.sh
 
 sym="noploop"
tools/perf/tests/shell/jitdump-python.sh +0 -1
index 05aaa3bd900b..ad345a35c16d 100755
@@ -3,7 +3,6 @@
 # SPDX-License-Identifier: GPL-2.0
 
 SHELLDIR=$(dirname $0)
-# shellcheck source=lib/setup_python.sh
 . "${SHELLDIR}"/lib/setup_python.sh
 
 OUTPUT=$(${PYTHON} -Xperf_jit -c 'import os, sys; print(os.getpid(), sys.is_stack_trampoline_active())' 2> /dev/null)
tools/perf/tests/shell/list.sh +0 -1
index 0c04b3159cef..14a03e0290ed 100755
@@ -5,7 +5,6 @@
 set -e
 
 shelldir=$(dirname "$0")
-# shellcheck source=lib/setup_python.sh
 . "${shelldir}"/lib/setup_python.sh
 
 list_output=$(mktemp /tmp/__perf_test.list_output.json.XXXXX)
tools/perf/tests/shell/pipe_test.sh +0 -1
index ce68d850c983..f4eb129afda2 100755
@@ -3,7 +3,6 @@
 # SPDX-License-Identifier: GPL-2.0
 
 shelldir=$(dirname "$0")
-# shellcheck source=lib/perf_has_symbol.sh
 . "${shelldir}"/lib/perf_has_symbol.sh
 
 sym="noploop"
tools/perf/tests/shell/probe_vfs_getname.sh +0 -2
index 5fe5682c28ce..36dc319eea0e 100755
@@ -4,13 +4,11 @@
 # SPDX-License-Identifier: GPL-2.0
 # Arnaldo Carvalho de Melo <[email protected]>, 2017
 
-# shellcheck source=lib/probe.sh
 . "$(dirname $0)"/lib/probe.sh
 
 skip_if_no_perf_probe || exit 2
 [ "$(id -u)" = 0 ] || exit 2
 
-# shellcheck source=lib/probe_vfs_getname.sh
 . "$(dirname $0)"/lib/probe_vfs_getname.sh
 
 add_probe_vfs_getname
tools/perf/tests/shell/python-use.sh +0 -1
index fd2ee5390060..2d6017d5dd9d 100755
@@ -5,7 +5,6 @@
 set -e
 
 shelldir=$(dirname "$0")
-# shellcheck source=lib/setup_python.sh
 . "${shelldir}"/lib/setup_python.sh
 
 MODULE_DIR=$(dirname "$(which perf)")/python
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +0 -2
index eca629ee83f0..4c9a308a450d 100755
@@ -10,9 +10,7 @@
 # SPDX-License-Identifier: GPL-2.0
 # Arnaldo Carvalho de Melo <[email protected]>, 2017
 
-# shellcheck source=lib/probe.sh
 . "$(dirname "$0")/lib/probe.sh"
-# shellcheck source=lib/probe_vfs_getname.sh
 . "$(dirname "$0")/lib/probe_vfs_getname.sh"
 
 libc=$(grep -w libc /proc/self/maps | head -1 | sed -r 's/.*[[:space:]](\/.*)/\1/g')
tools/perf/tests/shell/record+script_probe_vfs_getname.sh +0 -2
index 002f7037f182..ce20663601dc 100755
@@ -9,13 +9,11 @@
 # SPDX-License-Identifier: GPL-2.0
 # Arnaldo Carvalho de Melo <[email protected]>, 2017
 
-# shellcheck source=lib/probe.sh
 . "$(dirname "$0")/lib/probe.sh"
 
 skip_if_no_perf_probe || exit 2
 [ "$(id -u)" = 0 ] || exit 2
 
-# shellcheck source=lib/probe_vfs_getname.sh
 . "$(dirname "$0")/lib/probe_vfs_getname.sh"
 
 record_open_file() {
tools/perf/tests/shell/record.sh +0 -2
index 625240809fce..7c6657aa1c52 100755
@@ -8,10 +8,8 @@ shelldir=$(dirname "$0")
 . "${shelldir}"/lib/perf_record.sh
 
 
-# shellcheck source=lib/waiting.sh
 . "${shelldir}"/lib/waiting.sh
 
-# shellcheck source=lib/perf_has_symbol.sh
 . "${shelldir}"/lib/perf_has_symbol.sh
 
 testsym="test_loop"
tools/perf/tests/shell/record_weak_term.sh +0 -1
index 811b00ffb47a..da418669ab52 100755
@@ -5,7 +5,6 @@
 set -e
 
 shelldir=$(dirname "$0")
-# shellcheck source=lib/setup_python.sh
 . "${shelldir}"/lib/setup_python.sh
 
 # Find the first event with a specified period, such as
tools/perf/tests/shell/script_dlfilter.sh +0 -1
index aaed92bb7828..88222280f609 100755
@@ -5,7 +5,6 @@
 set -e
 
 shelldir=$(dirname "$0")
-# shellcheck source=lib/setup_python.sh
 . "${shelldir}"/lib/setup_python.sh
 
 # skip if there's no compiler
tools/perf/tests/shell/stat+csv_output.sh +0 -1
index cd6fff597091..a5b34c42e8d7 100755
@@ -6,7 +6,6 @@
 
 set -e
 
-# shellcheck source=lib/stat_output.sh
 . "$(dirname $0)"/lib/stat_output.sh
 
 csv_sep=@
tools/perf/tests/shell/stat+json_output.sh +0 -1
index 85d1ad7186c6..4969ad70b67b 100755
@@ -9,7 +9,6 @@ set -e
 skip_test=0
 
 shelldir=$(dirname "$0")
-# shellcheck source=lib/setup_python.sh
 . "${shelldir}"/lib/setup_python.sh
 pythonchecker=$(dirname $0)/lib/perf_json_output_lint.py
 
tools/perf/tests/shell/stat+std_output.sh +0 -1
index 9c4b92ecf448..64c2b81f02de 100755
@@ -6,7 +6,6 @@
 
 set -e
 
-# shellcheck source=lib/stat_output.sh
 . "$(dirname $0)"/lib/stat_output.sh
 
 stat_output=$(mktemp /tmp/__perf_test.stat_output.std.XXXXX)
tools/perf/tests/shell/stat_metrics_values.sh +0 -1
index 86c5c7f70933..0982f6b9737a 100755
@@ -3,7 +3,6 @@
 # SPDX-License-Identifier: GPL-2.0
 
 shelldir=$(dirname "$0")
-# shellcheck source=lib/setup_python.sh
 . "${shelldir}"/lib/setup_python.sh
 
 grep -q GenuineIntel /proc/cpuinfo || { echo Skipping non-Intel; exit 2; }
tools/perf/tests/shell/test_arm_callgraph_fp.sh +0 -1
index 9172dd68a81d..8adfe81fa8dc 100755
@@ -3,7 +3,6 @@
 # SPDX-License-Identifier: GPL-2.0
 
 shelldir=$(dirname "$0")
-# shellcheck source=lib/perf_has_symbol.sh
 . "${shelldir}"/lib/perf_has_symbol.sh
 
 if [ "$(uname -m)" != "aarch64" ]; then
tools/perf/tests/shell/test_brstack.sh +0 -1
index 71550e0b37ba..fd05ebb5ae74 100755
@@ -5,7 +5,6 @@
 # German Gomez <[email protected]>, 2022
 
 shelldir=$(dirname "$0")
-# shellcheck source=lib/perf_has_symbol.sh
 . "${shelldir}"/lib/perf_has_symbol.sh
 
 # skip the test if the hardware doesn't support branch stack sampling
tools/perf/tests/shell/test_data_symbol.sh +0 -1
index d61b5659a46d..edc528c11dda 100755
@@ -6,7 +6,6 @@
 
 shelldir=$(dirname "$0")
 
-# shellcheck source=lib/perf_has_symbol.sh
 . "${shelldir}"/lib/perf_has_symbol.sh
 
 skip_if_no_mem_event() {
tools/perf/tests/shell/test_intel_pt.sh +0 -1
index 26243ff760ec..a2e87ef09593 100755
@@ -8,7 +8,6 @@ set -e
 perf list pmu | grep -q 'intel_pt//' || exit 2
 
 shelldir=$(dirname "$0")
-# shellcheck source=lib/waiting.sh
 . "${shelldir}"/lib/waiting.sh
 
 skip_cnt=0
tools/perf/tests/shell/test_perf_data_converter_json.sh +0 -1
index 35d81e39a26c..c2c4ade7609a 100755
@@ -7,7 +7,6 @@ set -e
 err=0
 
 shelldir=$(dirname "$0")
-# shellcheck source=lib/setup_python.sh
 . "${shelldir}"/lib/setup_python.sh
 
 perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
tools/perf/tests/shell/test_test_junit_output.sh +0 -1
index 5104ac1e1e6d..38a29e646906 100755
@@ -7,7 +7,6 @@ set -e
 err=0
 
 shelldir=$(dirname "$0")
-# shellcheck source=lib/setup_python.sh
 . "${shelldir}"/lib/setup_python.sh
 
 result=$(mktemp /tmp/__perf_test.output.xml.XXXXX)
tools/perf/tests/shell/test_uprobe_from_different_cu.sh +0 -1
index 7adf9755d6de..83505093257d 100755
@@ -4,7 +4,6 @@
 
 set -e
 
-# shellcheck source=lib/probe.sh
 . "$(dirname $0)"/lib/probe.sh
 
 skip_if_no_perf_probe || exit 2
tools/perf/tests/shell/trace+probe_vfs_getname.sh +0 -1
index 7a0b1145d0cd..28d3aa8a9e33 100755
@@ -10,7 +10,6 @@
 # SPDX-License-Identifier: GPL-2.0
 # Arnaldo Carvalho de Melo <[email protected]>, 2017
 
-# shellcheck source=lib/probe.sh
 . "$(dirname $0)"/lib/probe.sh
 
 skip_if_no_perf_probe || exit 2
tools/perf/tests/shell/trace_btf_enum.sh +0 -1
index 03e9f680a4a6..b1a659e0245f 100755
@@ -9,7 +9,6 @@ non_syscall="timer:hrtimer_start"
 
 TESTPROG="perf test -w landlock"
 
-# shellcheck source=lib/probe.sh
 . "$(dirname $0)"/lib/probe.sh
 skip_if_no_perf_trace || exit 2
 [ "$(id -u)" = 0 ] || exit 2
tools/perf/tests/shell/trace_btf_general.sh +0 -1
index 7a94a5743924..06f4a704daf8 100755
@@ -4,7 +4,6 @@
 
 err=0
 
-# shellcheck source=lib/probe.sh
 . "$(dirname $0)"/lib/probe.sh
 
 file1=$(mktemp /tmp/file1_XXXX)
tools/perf/tests/shell/trace_exit_race.sh +0 -1
index db300cde94fb..024ff8f1d388 100755
@@ -6,7 +6,6 @@
 # lost. Specifically, trace the exiting syscall of "true" 10 times and ensure
 # the output contains 10 correct lines.
 
-# shellcheck source=lib/probe.sh
 . "$(dirname $0)"/lib/probe.sh
 
 skip_if_no_perf_trace || exit 2
tools/perf/tests/shell/trace_record_replay.sh +0 -2
index 38fcafcdfb91..76a7bba6ef23 100755
@@ -4,9 +4,7 @@
 
 # Check that perf trace works with record and replay
 
-# shellcheck source=lib/probe.sh
 . "$(dirname $0)"/lib/probe.sh
-# shellcheck source=lib/perf_record.sh
 . "$(dirname $0)"/lib/perf_record.sh
 
 skip_if_no_perf_trace || exit 2
tools/perf/tests/shell/trace_summary.sh +0 -1
index b80dea77cec6..d5da1d7d8d88 100755
@@ -4,7 +4,6 @@
 
 # Check that perf trace works with various summary mode
 
-# shellcheck source=lib/probe.sh
 . "$(dirname $0)"/lib/probe.sh
 
 skip_if_no_perf_trace || exit 2
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH 1/2] perf test: Remove redundant shellcheck source paths

Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 7 lines

The minimum required shellcheck version treats paths with leading variables as starting from the script's current directory, so shellcheck is able to source all of these files without needing the extra directives:

v0.7.2 - 2021-04-19

Quoted 8 lines

Changed
* SC1090: A leading $x/ or $(x)/ is now treated as ./ when locating files

Remove them to avoid future copy pasting and confusion that they are required. Because the paths weren't actually followed, they didn't have to be accurate and accepted any string to silence the warning.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/20260921-james-perf-shellcheck-source-v1-0-adcfc107c997@linaro.org?part=1
author reviewer
#3 lore raw

PATCH 2/2 perf build: Follow sourced files when running shellcheck

In reply to James Clark

Shellcheck follows sourced scripts when -a is provided, but only when that file is also provided on the command line along with the one being checked. We only ever provide one file at a time to shellcheck, so -a does nothing.

Improve coverage by following sources using the script's directory as the base path.

---
 tools/perf/Makefile.perf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Makefile.perf +1 -1
index 29cfd44c427f..76a17d3614a6 100644
@@ -258,7 +258,7 @@ ifneq ($(SHELLCHECK),)
         sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \< 072), 1)
     SHELLCHECK :=
   else
-    SHELLCHECK := $(SHELLCHECK) -s bash -a -S warning
+    SHELLCHECK := $(SHELLCHECK) -s bash -a -S warning -x -P SCRIPTDIR
   endif
 endif
 
Signature · 1 line
2.43.0
#4 lore raw

Re: [PATCH 2/2] perf build: Follow sourced files when running shellcheck

Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 9 lines

Shellcheck follows sourced scripts when -a is provided, but only when that file is also provided on the command line along with the one being checked. We only ever provide one file at a time to shellcheck, so -a does nothing.

Improve coverage by following sources using the script's directory as the base path.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/20260921-james-perf-shellcheck-source-v1-0-adcfc107c997@linaro.org?part=2
maintainer Acked-by on the v1 series
#5 lore raw
In reply to James Clark
Quoted 12 lines · James Clark

I was hacking away when I got blocked by a shellcheck warning about an unassigned variable, despite that variable being assigned in a sourced file and having visibly correct source= directive.

Confusingly two things turned out to be relevant to this. One is that -a doesn't make shellcheck follow "external" paths, which these are treated as. You need -x for that. Secondly, the source= directives don't cause it to follow the path either, they just suppress a warning message about dynamic paths in versions of shellcheck before 0.7.2. This warning can be silenced with "source=/dev/null" and doesn't require any particular path to be provided if -x isn't used.

Quoted 5 lines

---
James Clark (2):
perf test: Remove redundant shellcheck source paths perf build: Follow sourced files when running shellcheck

Thanks,
Namhyung

Quoted 42 lines
 tools/perf/Makefile.perf                                  | 2 +-
 tools/perf/tests/shell/annotate.sh                        | 1 -
 tools/perf/tests/shell/base_probe/test_adding_kernel.sh   | 1 -
 tools/perf/tests/shell/diff.sh                            | 1 -
 tools/perf/tests/shell/inject_aslr.sh                     | 1 -
 tools/perf/tests/shell/jitdump-python.sh                  | 1 -
 tools/perf/tests/shell/list.sh                            | 1 -
 tools/perf/tests/shell/pipe_test.sh                       | 1 -
 tools/perf/tests/shell/probe_vfs_getname.sh               | 2 --
 tools/perf/tests/shell/python-use.sh                      | 1 -
 tools/perf/tests/shell/record+probe_libc_inet_pton.sh     | 2 --
 tools/perf/tests/shell/record+script_probe_vfs_getname.sh | 2 --
 tools/perf/tests/shell/record.sh                          | 2 --
 tools/perf/tests/shell/record_weak_term.sh                | 1 -
 tools/perf/tests/shell/script_dlfilter.sh                 | 1 -
 tools/perf/tests/shell/stat+csv_output.sh                 | 1 -
 tools/perf/tests/shell/stat+json_output.sh                | 1 -
 tools/perf/tests/shell/stat+std_output.sh                 | 1 -
 tools/perf/tests/shell/stat_metrics_values.sh             | 1 -
 tools/perf/tests/shell/test_arm_callgraph_fp.sh           | 1 -
 tools/perf/tests/shell/test_brstack.sh                    | 1 -
 tools/perf/tests/shell/test_data_symbol.sh                | 1 -
 tools/perf/tests/shell/test_intel_pt.sh                   | 1 -
 tools/perf/tests/shell/test_perf_data_converter_json.sh   | 1 -
 tools/perf/tests/shell/test_test_junit_output.sh          | 1 -
 tools/perf/tests/shell/test_uprobe_from_different_cu.sh   | 1 -
 tools/perf/tests/shell/trace+probe_vfs_getname.sh         | 1 -
 tools/perf/tests/shell/trace_btf_enum.sh                  | 1 -
 tools/perf/tests/shell/trace_btf_general.sh               | 1 -
 tools/perf/tests/shell/trace_exit_race.sh                 | 1 -
 tools/perf/tests/shell/trace_record_replay.sh             | 2 --
 tools/perf/tests/shell/trace_summary.sh                   | 1 -
 32 files changed, 1 insertion(+), 37 deletions(-)

---
base-commit: 9453bc6a69ef43755f1c28d5688cacdd69fa16bd
change-id: 20260921-james-perf-shellcheck-source-f48df891cd4f

Best regards,

Signature · 1 line
James Clark <[email protected]>
maintainer Applied
#6 lore raw
Quoted 9 lines · Namhyung Kim
Quoted 7 lines · James Clark

Confusingly two things turned out to be relevant to this. One is that -a doesn't make shellcheck follow "external" paths, which these are treated as. You need -x for that. Secondly, the source= directives don't cause it to follow the path either, they just suppress a warning message about dynamic paths in versions of shellcheck before 0.7.2. This warning can be silenced with "source=/dev/null" and doesn't require any particular path to be provided if -x isn't used.

Quoted 5 lines
Quoted 3 lines

James Clark (2):
perf test: Remove redundant shellcheck source paths perf build: Follow sourced files when running shellcheck

Thanks, applied to perf-tools-next, for v7.4.

- Arnaldo