summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2018-08-30 23:18:35 +0900
committerShuah Khan (Samsung OSG) <shuah@kernel.org>2018-10-24 14:49:35 -0600
commit1e51263ef4e637199b725df6811f0d2bea70156c (patch)
treeeb5f14245946d0b947bd3ccb85003d8f50acf165 /tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc
parente42e5c46b07d09b6b985ceea954eae165103c7ed (diff)
selftests/ftrace: Improve kretprobe testcase to check log data
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>
Diffstat (limited to 'tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc')
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc
index 4c6b21e30b02..ac9ab4a12e53 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc
@@ -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