aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/tests
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2022-09-12 11:34:08 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-10-04 08:55:23 -0300
commit5d7aac2bf87ab6b9f759c107b44bf8a0326c4c19 (patch)
tree20b1b0de41af2d7f097506a9ece28ec311981948 /tools/perf/tests
parentperf test: test_intel_pt.sh: Use grep -c instead of grep plus wc -l (diff)
downloadlinux-dev-5d7aac2bf87ab6b9f759c107b44bf8a0326c4c19.tar.xz
linux-dev-5d7aac2bf87ab6b9f759c107b44bf8a0326c4c19.zip
perf test: test_intel_pt.sh: Use quotes around variable expansion
As suggested by shellcheck, use quotes around variable expansion. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/r/20220912083412.7058-8-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests')
-rwxr-xr-xtools/perf/tests/shell/test_intel_pt.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/tests/shell/test_intel_pt.sh b/tools/perf/tests/shell/test_intel_pt.sh
index 3dfdef4fa6f4..075b780fe9ed 100755
--- a/tools/perf/tests/shell/test_intel_pt.sh
+++ b/tools/perf/tests/shell/test_intel_pt.sh
@@ -37,7 +37,7 @@ trap trap_cleanup EXIT TERM INT
can_cpu_wide()
{
- perf record -o ${tmpfile} -B -N --no-bpf-event -e dummy:u -C $1 true >/dev/null 2>&1 || return 2
+ perf record -o "${tmpfile}" -B -N --no-bpf-event -e dummy:u -C "$1" true >/dev/null 2>&1 || return 2
return 0
}
@@ -48,12 +48,12 @@ test_system_wide_side_band()
can_cpu_wide 1 || return $?
# Record on CPU 0 a task running on CPU 1
- perf record -B -N --no-bpf-event -o ${perfdatafile} -e intel_pt//u -C 0 -- taskset --cpu-list 1 uname
+ perf record -B -N --no-bpf-event -o "${perfdatafile}" -e intel_pt//u -C 0 -- taskset --cpu-list 1 uname
# Should get MMAP events from CPU 1 because they can be needed to decode
- mmap_cnt=$(perf script -i ${perfdatafile} --no-itrace --show-mmap-events -C 1 2>/dev/null | grep -c MMAP)
+ mmap_cnt=$(perf script -i "${perfdatafile}" --no-itrace --show-mmap-events -C 1 2>/dev/null | grep -c MMAP)
- if [ ${mmap_cnt} -gt 0 ] ; then
+ if [ "${mmap_cnt}" -gt 0 ] ; then
return 0
fi
@@ -63,11 +63,11 @@ test_system_wide_side_band()
count_result()
{
- if [ $1 -eq 2 ] ; then
+ if [ "$1" -eq 2 ] ; then
skip_cnt=$((skip_cnt + 1))
return
fi
- if [ $1 -eq 0 ] ; then
+ if [ "$1" -eq 0 ] ; then
ok_cnt=$((ok_cnt + 1))
return
fi