Commit 3a4367c1 authored by Athira Rajeev's avatar Athira Rajeev Committed by Arnaldo Carvalho de Melo

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: default avatarAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Acked-by: default avatarIan Rogers <irogers@google.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230709182800.53002-23-atrajeev@linux.vnet.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 84caba70
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment