perf build: Specify shellcheck should use bash
authorCollin Funk <collin.funk1@gmail.com>
Sat, 28 Jun 2025 03:41:25 +0000 (20:41 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Mon, 30 Jun 2025 16:43:06 +0000 (09:43 -0700)
commit114339ee4d66a328d186264ffa23a766542a9a15
treef3d373a0e69fd707ed6c3e53eca1137a72345dbc
parent146847932278fef1ce13b5a839077e51ca019395
perf build: Specify shellcheck should use bash

When someone has a global shellcheckrc file, for example at
~/.config/shellcheckrc, with the directive 'shell=sh', building perf
will fail with many shellcheck errors like:

    In tests/shell/base_probe/test_adding_kernel.sh line 294:
    (( TEST_RESULT += $? ))
    ^---------------------^ SC3006 (warning): In POSIX sh, standalone ((..)) is undefined.

    For more information:
      https://www.shellcheck.net/wiki/SC3006 -- In POSIX sh, standalone ((..)) is...
    make[5]: *** [tests/Build:91: tests/shell/base_probe/test_adding_kernel.sh.shellcheck_log] Error 1

Passing the '-s bash' option ensures that it runs correctly regardless
of a developers global configuration.

This patch adds '-s bash' and other options to the SHELLCHECK variable
in Makefile.perf and makes use of the variable consistently.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Link: https://lore.kernel.org/r/63491dbc8439edf2e949d80e264b9d22332fea61.1751082075.git.collin.funk1@gmail.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/Build
tools/perf/Makefile.perf
tools/perf/arch/x86/Build
tools/perf/arch/x86/tests/Build
tools/perf/tests/Build
tools/perf/trace/beauty/Build
tools/perf/util/Build