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>
This commit is contained in:
parent
e42e5c46b0
commit
1e51263ef4
@ -4,11 +4,16 @@
|
|||||||
|
|
||||||
[ -f kprobe_events ] || exit_unsupported # this is configurable
|
[ -f kprobe_events ] || exit_unsupported # this is configurable
|
||||||
|
|
||||||
|
# Add new kretprobe event
|
||||||
echo 'r:testprobe2 _do_fork $retval' > kprobe_events
|
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
|
test -d events/kprobes/testprobe2
|
||||||
|
|
||||||
echo 1 > events/kprobes/testprobe2/enable
|
echo 1 > events/kprobes/testprobe2/enable
|
||||||
( echo "forked")
|
( echo "forked")
|
||||||
|
|
||||||
|
cat trace | grep testprobe2 | grep -q '<- _do_fork'
|
||||||
|
|
||||||
echo 0 > events/kprobes/testprobe2/enable
|
echo 0 > events/kprobes/testprobe2/enable
|
||||||
echo '-:testprobe2' >> kprobe_events
|
echo '-:testprobe2' >> kprobe_events
|
||||||
clear_trace
|
clear_trace
|
||||||
|
Loading…
Reference in New Issue
Block a user