Skip to contentSkip to conversation

perf test record.sh: Fix shellcheck warning

PATCH Applied Ian Rogers 2 participants 2 messages Feb 7 – Feb 8 perf events

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 perf test record.sh: Fix shellcheck warning

Add quotes to avoid the following warning:

```
In tests/shell/record.sh line 264:
 [ $(uname -m) = "s390x" ] && {
   ^---------^ SC2046 (warning): Quote this to prevent word splitting.

For more information:
 https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt...
```
Fixes c73a56ed3c97 ("perf test: Fix test case Leader sampling on s390")
---
 tools/perf/tests/shell/record.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/record.sh +1 -1
index 46b96d565680..7cb81cf3444a 100755
@@ -261,7 +261,7 @@ test_uid() {
 test_leader_sampling() {
   echo "Basic leader sampling test"
   events="{cycles,cycles}:Su"
-  [ $(uname -m) = "s390x" ] && {
+  [ "$(uname -m)" = "s390x" ] && {
     [ ! -d /sys/devices/cpum_sf ] && {
       echo "No CPUMF [Skipped record]"
       return
Signature · 1 line
2.53.0.239.g8d8fc8a987-goog
maintainer Applied
#1 lore raw
Quoted 11 lines · Ian Rogers

Add quotes to avoid the following warning:

```
In tests/shell/record.sh line 264:
 [ $(uname -m) = "s390x" ] && {
   ^---------^ SC2046 (warning): Quote this to prevent word splitting.

For more information:
 https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt...
```
Fixes c73a56ed3c97 ("perf test: Fix test case Leader sampling on s390")

Thanks, applied to perf-tools-next,

- Arnaldo

Quoted 21 lines
---
 tools/perf/tests/shell/record.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/record.sh +1 -1
index 46b96d565680..7cb81cf3444a 100755
@@ -261,7 +261,7 @@ test_uid() {
 test_leader_sampling() {
   echo "Basic leader sampling test"
   events="{cycles,cycles}:Su"
-  [ $(uname -m) = "s390x" ] && {
+  [ "$(uname -m)" = "s390x" ] && {
     [ ! -d /sys/devices/cpum_sf ] && {
       echo "No CPUMF [Skipped record]"
       return
Signature · 1 line
2.53.0.239.g8d8fc8a987-goog