mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 20:53:53 +08:00
selftests/ftrace: Add kprobe profile testcase
Add a testcase for testing kprobe_profile interface which provides per-kprobe event hit/misshit counts. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
This commit is contained in:
parent
b0898e8485
commit
32f6e5da83
15
tools/testing/selftests/ftrace/test.d/kprobe/profile.tc
Normal file
15
tools/testing/selftests/ftrace/test.d/kprobe/profile.tc
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# description: Kprobe dynamic event - adding and removing
|
||||
|
||||
[ -f kprobe_events ] || exit_unsupported # this is configurable
|
||||
|
||||
! grep -q 'myevent' kprobe_profile
|
||||
echo p:myevent _do_fork > kprobe_events
|
||||
grep -q 'myevent[[:space:]]*0[[:space:]]*0$' kprobe_profile
|
||||
echo 1 > events/kprobes/myevent/enable
|
||||
( echo "forked" )
|
||||
grep -q 'myevent[[:space:]]*[[:digit:]]*[[:space:]]*0$' kprobe_profile
|
||||
echo 0 > events/kprobes/myevent/enable
|
||||
echo > kprobe_events
|
||||
! grep -q 'myevent' kprobe_profile
|
Loading…
Reference in New Issue
Block a user