mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-09 23:34:42 +08:00
1e51263ef4
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>
21 lines
599 B
Bash
21 lines
599 B
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# description: Kretprobe dynamic event with arguments
|
|
|
|
[ -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 -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
|
|
test -d events/kprobes/testprobe2 && exit_fail || exit_pass
|