Skip to contentSkip to conversation

selftests/ftrace: Add missing spaces after ! in probe syntax tests

PATCH Superseded Jaewon Jung 3 participants 5 messages Oct 25 – Oct 29

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/ftrace: Add missing spaces after ! in probe syntax tests

Add the missing space between ! and grep. Otherwise, the shell tries to run !grep and reports "!grep: not found". This always skips the conditional checks without checking for kernel return probe argument support.

---
 .../selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc  | 4 ++--
 .../selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc +2 -2
index 384209968325..70751573e8de 100644
@@ -33,7 +33,7 @@ check_error 'f vfs_read ^$stack10000'	# BAD_STACK_NUM
 
 check_error 'f vfs_read ^$arg10000'	# BAD_ARG_NUM
 
-if !grep -q 'kernel return probes support:' README; then
+if ! grep -q 'kernel return probes support:' README; then
 check_error 'f vfs_read $retval ^$arg1' # BAD_VAR
 fi
 check_error 'f vfs_read ^$none_var'	# BAD_VAR
@@ -100,7 +100,7 @@ if grep -q "<argname>" README; then
 check_error 'f vfs_read args=^$arg*'		# BAD_VAR_ARGS
 check_error 'f vfs_read +0(^$arg*)'		# BAD_VAR_ARGS
 check_error 'f vfs_read $arg* ^$arg*'		# DOUBLE_ARGS
-if !grep -q 'kernel return probes support:' README; then
+if ! grep -q 'kernel return probes support:' README; then
 check_error 'f vfs_read%return ^$arg*'		# NOFENTRY_ARGS
 fi
 check_error 'f vfs_read ^hoge'			# NO_BTFARG
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc +1 -1
index b0e6b80ccb01..06efa67e01ff 100644
@@ -108,7 +108,7 @@ if grep -q "<argname>" README; then
 check_error 'p vfs_read args=^$arg*'		# BAD_VAR_ARGS
 check_error 'p vfs_read +0(^$arg*)'		# BAD_VAR_ARGS
 check_error 'p vfs_read $arg* ^$arg*'		# DOUBLE_ARGS
-if !grep -q 'kernel return probes support:' README; then
+if ! grep -q 'kernel return probes support:' README; then
 check_error 'r vfs_read ^$arg*'			# NOFENTRY_ARGS
 fi
 check_error 'p vfs_read+20 ^$arg*'		# NOFENTRY_ARGS
Signature · 1 line
2.43.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jaewon Jung

Add the missing space between ! and grep. Otherwise, the shell tries to run !grep and reports "!grep: not found". This always skips the conditional checks without checking for kernel return probe argument support.

Looks good to me! Also we need followings.

Fixes 25f00e40ce79 ("tracing/probes: Support $argN in return probe (kprobe and fprobe)")

Shuah, can you pick this fix?

Thanks,

Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
#2 lore raw

PATCH v2 1/1 selftests/ftrace: Add missing spaces after ! in probe syntax tests

In reply to Jaewon Jung

Add the missing space between ! and grep. Otherwise, the shell tries to run !grep and reports "!grep: not found". This always skips the conditional checks without checking for kernel return probe argument support.

Fixes 25f00e40ce79 ("tracing/probes: Support $argN in return probe (kprobe and fprobe)")

---
Changes in v2:
- Add Fixes, Cc stable and Acked-by tags as suggested by Masami.

 .../selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc  | 4 ++--
 .../selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc +2 -2
index 384209968325..70751573e8de 100644
@@ -33,7 +33,7 @@ check_error 'f vfs_read ^$stack10000'	# BAD_STACK_NUM
 
 check_error 'f vfs_read ^$arg10000'	# BAD_ARG_NUM
 
-if !grep -q 'kernel return probes support:' README; then
+if ! grep -q 'kernel return probes support:' README; then
 check_error 'f vfs_read $retval ^$arg1' # BAD_VAR
 fi
 check_error 'f vfs_read ^$none_var'	# BAD_VAR
@@ -100,7 +100,7 @@ if grep -q "<argname>" README; then
 check_error 'f vfs_read args=^$arg*'		# BAD_VAR_ARGS
 check_error 'f vfs_read +0(^$arg*)'		# BAD_VAR_ARGS
 check_error 'f vfs_read $arg* ^$arg*'		# DOUBLE_ARGS
-if !grep -q 'kernel return probes support:' README; then
+if ! grep -q 'kernel return probes support:' README; then
 check_error 'f vfs_read%return ^$arg*'		# NOFENTRY_ARGS
 fi
 check_error 'f vfs_read ^hoge'			# NO_BTFARG
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc +1 -1
index b0e6b80ccb01..06efa67e01ff 100644
@@ -108,7 +108,7 @@ if grep -q "<argname>" README; then
 check_error 'p vfs_read args=^$arg*'		# BAD_VAR_ARGS
 check_error 'p vfs_read +0(^$arg*)'		# BAD_VAR_ARGS
 check_error 'p vfs_read $arg* ^$arg*'		# DOUBLE_ARGS
-if !grep -q 'kernel return probes support:' README; then
+if ! grep -q 'kernel return probes support:' README; then
 check_error 'r vfs_read ^$arg*'			# NOFENTRY_ARGS
 fi
 check_error 'p vfs_read+20 ^$arg*'		# NOFENTRY_ARGS
Signature · 1 line
2.43.0
maintainer
#3 lore raw
Quoted 5 lines · Jaewon Jung

Add the missing space between ! and grep. Otherwise, the shell tries to run !grep and reports "!grep: not found". This always skips the conditional checks without checking for kernel return probe argument support.

Quoted 8 lines
Fixes 25f00e40ce79 ("tracing/probes: Support $argN in return probe (kprobe and fprobe)")

---
Changes in v2:
- Add Fixes, Cc stable and Acked-by tags as suggested by Masami.

Thank you. I will take this for 7.4-rc2.

thanks,
-- Shuah

#4 lore raw
Quoted 15 lines · Shuah Khan
Quoted 5 lines · Jaewon Jung

Add the missing space between ! and grep. Otherwise, the shell tries to run !grep and reports "!grep: not found". This always skips the conditional checks without checking for kernel return probe argument support.

Quoted 8 lines
Fixes 25f00e40ce79 ("tracing/probes: Support $argN in return probe (kprobe and fprobe)")

---
Changes in v2:
- Add Fixes, Cc stable and Acked-by tags as suggested by Masami.

Quoted 1 line

Thank you. I will take this for 7.4-rc2.

Thank you!

Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>