Commit 89c5497d authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Steven Rostedt

tracing/kprobes: Add selftest scripts testing kprobe-tracer as startup test

Add two selftest scripts which tests kprobe-tracer as the startup
selftest does.
These test cases are testing that the kprobe_event can accept a
kprobe event with $stack related arguments and a kretprobe event
with $retval argument.

Link: http://lkml.kernel.org/p/20141008040307.13415.45145.stgit@kbuild-f20.novalocalSigned-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 915de2ad
#!/bin/sh
# description: Kprobe dynamic event with arguments
[ -f kprobe_events ] || exit_unsupported # this is configurable
echo 0 > events/enable
echo > kprobe_events
echo 'p:testprobe do_fork $stack $stack0 +0($stack)' > kprobe_events
grep testprobe kprobe_events
test -d events/kprobes/testprobe
echo 1 > events/kprobes/testprobe/enable
( echo "forked")
echo 0 > events/kprobes/testprobe/enable
echo "-:testprobe" >> kprobe_events
test -d events/kprobes/testprobe && exit 1 || exit 0
#!/bin/sh
# description: Kretprobe dynamic event with arguments
[ -f kprobe_events ] || exit_unsupported # this is configurable
echo 0 > events/enable
echo > kprobe_events
echo 'r:testprobe2 do_fork $retval' > kprobe_events
grep testprobe2 kprobe_events
test -d events/kprobes/testprobe2
echo 1 > events/kprobes/testprobe2/enable
( echo "forked")
echo 0 > events/kprobes/testprobe2/enable
echo '-:testprobe2' >> kprobe_events
test -d events/kprobes/testprobe2 && exit 1 || exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment