Skip to content

Commit 32f6e5d

Browse files
mhiramatShuah Khan (Samsung OSG)
authored and
Shuah Khan (Samsung OSG)
committed
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 <[email protected]> Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]>
1 parent b0898e8 commit 32f6e5d

File tree

1 file changed

+15
-0
lines changed
  • tools/testing/selftests/ftrace/test.d/kprobe

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
# SPDX-License-Identifier: GPL-2.0
3+
# description: Kprobe dynamic event - adding and removing
4+
5+
[ -f kprobe_events ] || exit_unsupported # this is configurable
6+
7+
! grep -q 'myevent' kprobe_profile
8+
echo p:myevent _do_fork > kprobe_events
9+
grep -q 'myevent[[:space:]]*0[[:space:]]*0$' kprobe_profile
10+
echo 1 > events/kprobes/myevent/enable
11+
( echo "forked" )
12+
grep -q 'myevent[[:space:]]*[[:digit:]]*[[:space:]]*0$' kprobe_profile
13+
echo 0 > events/kprobes/myevent/enable
14+
echo > kprobe_events
15+
! grep -q 'myevent' kprobe_profile

0 commit comments

Comments
 (0)