Commit c4a1a776 authored by Spoorthy S's avatar Spoorthy S Committed by Arnaldo Carvalho de Melo

perf tests stat+shadow_stat.sh: Fix all POSIX sh warnings found using shellcheck

Running shellcheck -S on stat+shadow_stat.sh testcase, generates
SC2046 and SC2034 warnings,

$ shellcheck -S warning tests/shell/stat+shadow_stat.sh
	res=`printf "%.2f" $(echo "scale=6; $num / $cyc" | bc -q)`
			   : Quote this to prevent word splitting

To address the POSIX shell warnings used quotes in the printf
expressions, to prevent word splitting.
Signed-off-by: default avatarSpoorthy S <spoorts2@in.ibm.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230613164145.50488-15-atrajeev@linux.vnet.ibm.comSigned-off-by: default avatarAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: default avatarKajol Jain <kjain@linux.ibm.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 3b3bf0d1
......@@ -33,7 +33,7 @@ test_global_aggr()
fi
# use printf for rounding and a leading zero
res=`printf "%.2f" $(echo "scale=6; $num / $cyc" | bc -q)`
res=`printf "%.2f" "$(echo "scale=6; $num / $cyc" | bc -q)"`
if [ "$ipc" != "$res" ]; then
echo "IPC is different: $res != $ipc ($num / $cyc)"
exit 1
......@@ -67,7 +67,7 @@ test_no_aggr()
fi
# use printf for rounding and a leading zero
res=`printf "%.2f" $(echo "scale=6; $num / $cyc" | bc -q)`
res=`printf "%.2f" "$(echo "scale=6; $num / $cyc" | bc -q)"`
if [ "$ipc" != "$res" ]; then
echo "IPC is different for $cpu: $res != $ipc ($num / $cyc)"
exit 1
......
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