diff options
author | Athira Rajeev <[email protected]> | 2023-07-09 23:57:56 +0530 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2023-08-03 17:01:27 -0300 |
commit | 3a4367c11884a0be3a74963b37d2b2fe243ee1d4 (patch) | |
tree | 8f968d08dac0a73a7315b05c9e5ab1b81f677a1a | |
parent | 84caba70d09c20638ee1ecdd24e0932520ad63fe (diff) |
perf tests record+zstd_comp_decomp: Fix the shellcheck warnings about word splitting/quoting
Running shellcheck on record+zstd_comp_decomp.sh testcases
throws below warning:
In tests/shell/record+zstd_comp_decomp.sh line 16:
$perf_tool record -o $trace_file $gflag -z -F 5000 -- \
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
$perf_tool record -o "$trace_file" $gflag -z -F 5000 -- \
In tests/shell/record+zstd_comp_decomp.sh line 22:
$perf_tool report -i $trace_file --header --stats | \
^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Added double quote around file names to fix these
shellcheck reported issues.
Signed-off-by: Athira Rajeev <[email protected]>
Acked-by: Ian Rogers <[email protected]>
Cc: Disha Goel <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kajol Jain <[email protected]>
Cc: Madhavan Srinivasan <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rwxr-xr-x | tools/perf/tests/shell/record+zstd_comp_decomp.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/perf/tests/shell/record+zstd_comp_decomp.sh b/tools/perf/tests/shell/record+zstd_comp_decomp.sh index 49bd875d5122..8929046e9057 100755 --- a/tools/perf/tests/shell/record+zstd_comp_decomp.sh +++ b/tools/perf/tests/shell/record+zstd_comp_decomp.sh @@ -13,25 +13,25 @@ skip_if_no_z_record() { collect_z_record() { echo "Collecting compressed record file:" [ "$(uname -m)" != s390x ] && gflag='-g' - $perf_tool record -o $trace_file $gflag -z -F 5000 -- \ + $perf_tool record -o "$trace_file" $gflag -z -F 5000 -- \ dd count=500 if=/dev/urandom of=/dev/null } check_compressed_stats() { echo "Checking compressed events stats:" - $perf_tool report -i $trace_file --header --stats | \ + $perf_tool report -i "$trace_file" --header --stats | \ grep -E "(# compressed : Zstd,)|(COMPRESSED events:)" } check_compressed_output() { - $perf_tool inject -i $trace_file -o $trace_file.decomp && - $perf_tool report -i $trace_file --stdio -F comm,dso,sym | head -n -3 > $trace_file.comp.output && - $perf_tool report -i $trace_file.decomp --stdio -F comm,dso,sym | head -n -3 > $trace_file.decomp.output && - diff $trace_file.comp.output $trace_file.decomp.output + $perf_tool inject -i "$trace_file" -o "$trace_file.decomp" && + $perf_tool report -i "$trace_file" --stdio -F comm,dso,sym | head -n -3 > "$trace_file.comp.output" && + $perf_tool report -i "$trace_file.decomp" --stdio -F comm,dso,sym | head -n -3 > "$trace_file.decomp.output" && + diff "$trace_file.comp.output" "$trace_file.decomp.output" } skip_if_no_z_record || exit 2 collect_z_record && check_compressed_stats && check_compressed_output err=$? -rm -f $trace_file* +rm -f "$trace_file*" exit $err |