summaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2018-08-30 16:18:06 +0200
committerShuah Khan (Samsung OSG) <shuah@kernel.org>2018-10-24 22:49:35 +0200
commite42e5c46b07d09b6b985ceea954eae165103c7ed (patch)
tree7e87bd7a324b1871f405c4c02cb031a240a63abd /tools/testing
parentselftests/ftrace: Improve kprobe on module testcase to load/unload module (diff)
downloadlinux-e42e5c46b07d09b6b985ceea954eae165103c7ed.tar.xz
linux-e42e5c46b07d09b6b985ceea954eae165103c7ed.zip
selftests/ftrace: Improve kprobe testcase to check log data
Improve kprobe 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')
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc
index 9578535ccd67..bcdecf80a8f1 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc
@@ -5,10 +5,14 @@
[ -f kprobe_events ] || exit_unsupported # this is configurable
echo 'p:testprobe _do_fork $stack $stack0 +0($stack)' > kprobe_events
-grep testprobe kprobe_events
+grep testprobe kprobe_events | grep -q 'arg1=\$stack arg2=\$stack0 arg3=+0(\$stack)'
test -d events/kprobes/testprobe
+
echo 1 > events/kprobes/testprobe/enable
( echo "forked")
+grep testprobe trace | grep '_do_fork' | \
+ grep -q 'arg1=0x[[:xdigit:]]* arg2=0x[[:xdigit:]]* arg3=0x[[:xdigit:]]*$'
+
echo 0 > events/kprobes/testprobe/enable
echo "-:testprobe" >> kprobe_events
clear_trace