diff options
author | Akanksha J N <akanksha@linux.ibm.com> | 2023-07-09 20:27:35 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-08-03 22:01:25 +0200 |
commit | 38beba673b43b168906fff54f59cf004d2eb8120 (patch) | |
tree | 4be0a542c273dfdd2b0ab5e8f3fda5c48a629daf | |
parent | perf tests task_analyzer: Check perf build options for libtraceevent support (diff) | |
download | linux-38beba673b43b168906fff54f59cf004d2eb8120.tar.xz linux-38beba673b43b168906fff54f59cf004d2eb8120.zip |
perf tests trace+probe_vfs_getname: Fix shellcheck warnings about word splitting/quoting
Running shellcheck -S on probe_vfs_getname.sh, throws below warnings:
Before fix:
$ shellcheck -S warning trace+probe_vfs_getname.sh
In trace+probe_vfs_getname.sh line 13:
. $(dirname $0)/lib/probe.sh
^-----------^ SC2046 (warning): Quote this to prevent word splitting.
In trace+probe_vfs_getname.sh line 18:
. $(dirname $0)/lib/probe_vfs_getname.sh
^-----------^ SC2046 (warning): Quote this to prevent word splitting.
In trace+probe_vfs_getname.sh line 21:
evts=$(echo $(perf list syscalls:sys_enter_open* 2>/dev/null | grep -E 'open(at)? ' | sed -r 's/.*sys_enter_([a-z]+) +\[.*$/\1/') | sed 's/ /,/')
^-- SC2046 (warning): Quote this to prevent word splitting.
Fix the shellcheck warnings by adding quotes to prevent word splitting.
Signed-off-by: Akanksha J N <akanksha@linux.ibm.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
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-2-atrajeev@linux.vnet.ibm.com
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-x | tools/perf/tests/shell/trace+probe_vfs_getname.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/tests/shell/trace+probe_vfs_getname.sh b/tools/perf/tests/shell/trace+probe_vfs_getname.sh index 0a4bac3dd77e..db2ff141f703 100755 --- a/tools/perf/tests/shell/trace+probe_vfs_getname.sh +++ b/tools/perf/tests/shell/trace+probe_vfs_getname.sh @@ -10,15 +10,15 @@ # SPDX-License-Identifier: GPL-2.0 # Arnaldo Carvalho de Melo <acme@kernel.org>, 2017 -. $(dirname $0)/lib/probe.sh +. "$(dirname $0)"/lib/probe.sh skip_if_no_perf_probe || exit 2 skip_if_no_perf_trace || exit 2 -. $(dirname $0)/lib/probe_vfs_getname.sh +. "$(dirname $0)"/lib/probe_vfs_getname.sh trace_open_vfs_getname() { - evts=$(echo $(perf list syscalls:sys_enter_open* 2>/dev/null | grep -E 'open(at)? ' | sed -r 's/.*sys_enter_([a-z]+) +\[.*$/\1/') | sed 's/ /,/') + evts="$(echo "$(perf list syscalls:sys_enter_open* 2>/dev/null | grep -E 'open(at)? ' | sed -r 's/.*sys_enter_([a-z]+) +\[.*$/\1/')" | sed ':a;N;s:\n:,:g')" perf trace -e $evts touch $file 2>&1 | \ grep -E " +[0-9]+\.[0-9]+ +\( +[0-9]+\.[0-9]+ ms\): +touch\/[0-9]+ open(at)?\((dfd: +CWD, +)?filename: +${file}, +flags: CREAT\|NOCTTY\|NONBLOCK\|WRONLY, +mode: +IRUGO\|IWUGO\) += +[0-9]+$" } |