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 <mhiramat@kernel.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
This commit is contained in:
Masami Hiramatsu 2018-08-30 23:19:59 +09:00 committed by Shuah Khan (Samsung OSG)
parent ddbc31e63a
commit b0898e8485

View file

@ -0,0 +1,17 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Kprobe event with comm arguments
[ -f kprobe_events ] || exit_unsupported # this is configurable
grep -A1 "fetcharg:" README | grep -q "\$comm" || exit_unsupported # this is too old
echo 'p:testprobe _do_fork comm=$comm ' > kprobe_events
grep testprobe kprobe_events | grep -q 'comm=$comm'
test -d events/kprobes/testprobe
echo 1 > events/kprobes/testprobe/enable
( echo "forked")
grep testprobe trace | grep -q 'comm=".*"'
exit 0