Skip to content

Commit b0898e8

Browse files
mhiramatShuah Khan (Samsung OSG)
authored and
Shuah Khan (Samsung OSG)
committed
selftests/ftrace: Add kprobe event with $comm argument testcase
Add kprobe-event with $comm argument testcase to ftracetest. This not only checks syntax but also checks log file. Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]>
1 parent ddbc31e commit b0898e8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
# SPDX-License-Identifier: GPL-2.0
3+
# description: Kprobe event with comm arguments
4+
5+
[ -f kprobe_events ] || exit_unsupported # this is configurable
6+
7+
grep -A1 "fetcharg:" README | grep -q "\$comm" || exit_unsupported # this is too old
8+
9+
echo 'p:testprobe _do_fork comm=$comm ' > kprobe_events
10+
grep testprobe kprobe_events | grep -q 'comm=$comm'
11+
test -d events/kprobes/testprobe
12+
13+
echo 1 > events/kprobes/testprobe/enable
14+
( echo "forked")
15+
grep testprobe trace | grep -q 'comm=".*"'
16+
17+
exit 0

0 commit comments

Comments
 (0)