Skip to content

tools/perf: Fix shellcheck coding/formatting issues of perf tool shell scripts

Athira Rajeev linux-perf-users linuxppc-dev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest26 patches 6 repliesIn review
  2. v122 patches 3 repliesSuperseded

Changes in v2 from the cover letter

- Rebased on top of perf-tools-next from:
https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/log/?h=perf-tools-next

- Fixed shellcheck errors and warnings reported for newly added changes from perf-tools-next branch

- Addressed review comment from James clark for patch number 13 from V1. The changes in patch 13 were not necessary since the file "tests/shell/lib/coresight.sh" is sourced from other test files.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/26tools/perf/tests: Fix shellcheck warnings for trace+probe_vfs_getname.shtools/perf/tests/shell/trace+probe_vfs_getname.sh+3 -30 replies
2/26tools/perf/tests: Fix shellcheck warning for probe_vfs_getname.sh testcasetools/perf/tests/shell/probe_vfs_getname.sh+2 -20 replies
3/26tools/perf/tests: Fix shellcheck warning for record_offcpu.sh testcasetools/perf/tests/shell/record_offcpu.sh+3 -30 replies
4/26tools/perf/tests: Fix shellcheck issue for lock_contention.sh testcasetools/perf/tests/shell/lock_contention.sh+6 -60 replies
5/26tools/perf/tests: Fix shellcheck issue for stat_bpf_counters_cgrp.sh testcasetools/perf/tests/shell/stat_bpf_counters_cgrp.sh+12 -160 replies
6/26tools/perf/tests: fix test_arm_spe_fork.sh signal case issuestools/perf/tests/shell/test_arm_spe_fork.sh+1 -10 replies
7/26tools/perf/tests: Fix unused variable references in stat+csv_summary.sh testcasetools/perf/tests/shell/stat+csv_summary.sh+2 -20 replies
8/26tools/perf/tests: fix shellcheck warning for test_perf_data_converter_json.sh testcasetools/perf/tests/shell/test_perf_data_converter_json.sh+1 -10 replies
9/26tools/perf/tests: Fix shellcheck issue for stat_bpf_counters.sh testcasetools/perf/tests/shell/stat_bpf_counters.sh+2 -20 replies
10/26tools/perf/tests: Fix shellcheck issues in tests/shell/stat+shadow_stat.sh tetscasetools/perf/tests/shell/stat+shadow_stat.sh+2 -20 replies
11/26tools/perf/tests: Fix shellcheck warning for asm_pure_loop.sh shell scripttools/perf/tests/shell/coresight/asm_pure_loop.sh+1 -10 replies
12/26tools/perf/tests: Fix shellcheck warning for memcpy_thread_16k_10.sh shell scripttools/perf/tests/shell/coresight/memcpy_thread_16k_10.sh+1 -10 replies
13/26tools/perf/tests: Fix shellcheck warning for probe.sh shell scripttools/perf/tests/shell/lib/probe.sh+1 -00 replies
14/26tools/perf/trace: Fix shellcheck issue for arch_errno_names.sh scripttools/perf/trace/beauty/arch_errno_names.sh+6 -90 replies
15/26tools/perf: Fix shellcheck issue for check-headers.sh scripttools/perf/check-headers.sh+3 -30 replies
16/26tools/perf/tests: Fix shellcheck warnings for thread_loop_check_tid_10.shtools/perf/tests/shell/coresight/thread_loop_check_tid_10.sh+1 -10 replies
17/26tools/perf/tests: Fix shellcheck warnings for unroll_loop_thread_10.shtools/perf/tests/shell/coresight/unroll_loop_thread_10.sh+1 -10 replies
18/26tools/perf/tests: Fix shellcheck warnings for lib/probe_vfs_getname.shtools/perf/tests/shell/lib/probe_vfs_getname.sh+3 -20 replies
19/26tools/perf/tests: Fix the shellcheck warnings in lib/waiting.shtools/perf/tests/shell/lib/waiting.sh+1 -00 replies
20/26tools/perf/trace: Fix x86_arch_prctl.sh to address shellcheck warningstools/perf/trace/beauty/x86_arch_prctl.sh+3 -30 replies
21/26tools/perf/arch/x86: Fix syscalltbl.sh to address shellcheck warningstools/perf/arch/x86/entry/syscalls/syscalltbl.sh+1 -10 replies
22/26tools/perf/tests/shell: Fix the shellcheck warnings in record+zstd_comp_decomp.shtools/perf/tests/shell/record+zstd_comp_decomp.sh+7 -70 replies
23/26tools/shell/coresight: Fix shellcheck warning for thread_loop_check_tid_2.sh shell scripttools/perf/tests/shell/coresight/thread_loop_check_tid_2.sh+1 -10 replies
24/26tools/perf/tests/shell/lib: Fix shellcheck warning for stat_output.sh shell scripttools/perf/tests/shell/lib/stat_output.sh+1 -00 replies
25/26tools/perf/tests/shell: Fix shellcheck warning for stat+std_output.sh testcasetools/perf/tests/shell/stat+csv_output.sh+1 -10 replies
26/26tools/perf/tests: Fix shellcheck warning for stat+std_output.sh testcasetools/perf/tests/shell/stat+std_output.sh+1 -20 replies

Reviews trailers per patch

None of the 26 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchIan Rogers
SeriesA-b
1/26
2/26
3/26
4/26
5/26
6/26
7/26
8/26
9/26
10/26
11/26
12/26
13/26
14/26
15/26
16/26
17/26
18/26
19/26
20/26
21/26
22/26
23/26
24/26
25/26
26/26

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH V2 00/26] tools/perf: Fix shellcheck coding/formatting issues of perf tool shell scripts

Patchset covers a set of fixes for coding/formatting issues observed while running shellcheck tool on the perf shell scripts.

This cleanup is a pre-requisite to include a build option for shellcheck discussed here: https://www.spinics.net/lists/linux-perf-users/msg25553.html
First set of patches were posted here:
https://lore.kernel.org/linux-perf-users/[email protected]/T/#t

This patchset covers remaining set of shell scripts which needs fix. Patch 1 is resubmission of patch 6 from the initial series. Patch 15, 16 and 22 touches code from tools/perf/trace/beauty. Other patches are fixes for scripts from tools/perf/tests.

The shellcheck is run for severity level for errors and warnings. Command used:

# for F in $(find tests/shell/ -perm -o=x -name '*.sh'); do shellcheck -S warning $F; done
# echo $?
0

Changelog:
v1 -> v2:
- Rebased on top of perf-tools-next from:
https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/log/?h=perf-tools-next

- Fixed shellcheck errors and warnings reported for newly added changes from perf-tools-next branch

- Addressed review comment from James clark for patch number 13 from V1. The changes in patch 13 were not necessary since the file "tests/shell/lib/coresight.sh" is sourced from other test files.

Akanksha J N (1):
tools/perf/tests: Fix shellcheck warnings for
trace+probe_vfs_getname.sh

Athira Rajeev (14):
tools/perf/tests: fix test_arm_spe_fork.sh signal case issues tools/perf/tests: Fix unused variable references in
stat+csv_summary.sh testcase
tools/perf/tests: fix shellcheck warning for
test_perf_data_converter_json.sh testcase
tools/perf/tests: Fix shellcheck issue for stat_bpf_counters.sh
testcase
tools/perf/tests: Fix shellcheck issues in
tests/shell/stat+shadow_stat.sh tetscase
tools/perf/tests: Fix shellcheck warnings for

    thread_loop_check_tid_10.sh

tools/perf/tests: Fix shellcheck warnings for unroll_loop_thread_10.sh tools/perf/tests: Fix shellcheck warnings for lib/probe_vfs_getname.sh tools/perf/tests: Fix the shellcheck warnings in lib/waiting.sh tools/perf/trace: Fix x86_arch_prctl.sh to address shellcheck warnings tools/perf/arch/x86: Fix syscalltbl.sh to address shellcheck warnings tools/perf/tests/shell: Fix the shellcheck warnings in
record+zstd_comp_decomp.sh
tools/perf/tests/shell: Fix shellcheck warning for stat+std_output.sh
testcase
tools/perf/tests: Fix shellcheck warning for stat+std_output.sh
testcase

Kajol Jain (11):
tools/perf/tests: Fix shellcheck warning for probe_vfs_getname.sh
testcase
tools/perf/tests: Fix shellcheck warning for record_offcpu.sh testcase tools/perf/tests: Fix shellcheck issue for lock_contention.sh testcase tools/perf/tests: Fix shellcheck issue for stat_bpf_counters_cgrp.sh
testcase
tools/perf/tests: Fix shellcheck warning for asm_pure_loop.sh shell
script
tools/perf/tests: Fix shellcheck warning for memcpy_thread_16k_10.sh
shell script
tools/perf/tests: Fix shellcheck warning for probe.sh shell script tools/perf/trace: Fix shellcheck issue for arch_errno_names.sh script tools/perf: Fix shellcheck issue for check-headers.sh script tools/shell/coresight: Fix shellcheck warning for
thread_loop_check_tid_2.sh shell script
tools/perf/tests/shell/lib: Fix shellcheck warning for stat_output.sh
shell script

 .../arch/x86/entry/syscalls/syscalltbl.sh     |  2 +-
 tools/perf/check-headers.sh                   |  6 ++--
 .../tests/shell/coresight/asm_pure_loop.sh    |  2 +-
 .../shell/coresight/memcpy_thread_16k_10.sh   |  2 +-
 .../coresight/thread_loop_check_tid_10.sh     |  2 +-
 .../coresight/thread_loop_check_tid_2.sh      |  2 +-
 .../shell/coresight/unroll_loop_thread_10.sh  |  2 +-
 tools/perf/tests/shell/lib/probe.sh           |  1 +
 .../perf/tests/shell/lib/probe_vfs_getname.sh |  5 ++--
 tools/perf/tests/shell/lib/stat_output.sh     |  1 +
 tools/perf/tests/shell/lib/waiting.sh         |  1 +
 tools/perf/tests/shell/lock_contention.sh     | 12 ++++----
 tools/perf/tests/shell/probe_vfs_getname.sh   |  4 +--
 .../tests/shell/record+zstd_comp_decomp.sh    | 14 +++++-----
 tools/perf/tests/shell/record_offcpu.sh       |  6 ++--
 tools/perf/tests/shell/stat+csv_output.sh     |  2 +-
 tools/perf/tests/shell/stat+csv_summary.sh    |  4 +--
 tools/perf/tests/shell/stat+shadow_stat.sh    |  4 +--
 tools/perf/tests/shell/stat+std_output.sh     |  3 +-
 tools/perf/tests/shell/stat_bpf_counters.sh   |  4 +--
 .../tests/shell/stat_bpf_counters_cgrp.sh     | 28 ++++++++-----------
 tools/perf/tests/shell/test_arm_spe_fork.sh   |  2 +-
 .../shell/test_perf_data_converter_json.sh    |  2 +-
 .../tests/shell/trace+probe_vfs_getname.sh    |  6 ++--
 tools/perf/trace/beauty/arch_errno_names.sh   | 15 ++++------
 tools/perf/trace/beauty/x86_arch_prctl.sh     |  6 ++--
 26 files changed, 67 insertions(+), 71 deletions(-)
Signature · 1 line
2.39.1