selftests/ftrace: Improve kretprobe testcase to check log data
authorMasami Hiramatsu <mhiramat@kernel.org>
Thu, 30 Aug 2018 14:18:35 +0000 (23:18 +0900)
committerShuah Khan (Samsung OSG) <shuah@kernel.org>
Wed, 24 Oct 2018 20:49:35 +0000 (14:49 -0600)
Improve kretprobe testcase to check the log data correctness
and ensure the event definition is corrctly including
argument definition.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc

index 4c6b21e30b02cb35af2ea79083231ea5af9927b3..ac9ab4a12e5320d5ceac512b8856d38ff1dcb6b1 100644 (file)
@@ -4,11 +4,16 @@
 
 [ -f kprobe_events ] || exit_unsupported # this is configurable
 
+# Add new kretprobe event
 echo 'r:testprobe2 _do_fork $retval' > kprobe_events
-grep testprobe2 kprobe_events
+grep testprobe2 kprobe_events | grep -q 'arg1=\$retval'
 test -d events/kprobes/testprobe2
+
 echo 1 > events/kprobes/testprobe2/enable
 ( echo "forked")
+
+cat trace | grep testprobe2 | grep -q '<- _do_fork'
+
 echo 0 > events/kprobes/testprobe2/enable
 echo '-:testprobe2' >> kprobe_events
 clear_trace