Since ftracetest framework calls initialize_ftrace() right before each test and after all tests, we don't need to init/cleanup ftrace for each test case. Just remove such unneeded init/cleanup code because it can increase logfile size. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
48 lines
1.1 KiB
Bash
48 lines
1.1 KiB
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# description: Kprobe dynamic event with function tracer
|
|
|
|
[ -f kprobe_events ] || exit_unsupported # this is configurable
|
|
grep function available_tracers || exit_unsupported # this is configurable
|
|
|
|
# prepare
|
|
echo nop > current_tracer
|
|
echo _do_fork > set_ftrace_filter
|
|
echo 'p:testprobe _do_fork' > kprobe_events
|
|
|
|
# kprobe on / ftrace off
|
|
echo 1 > events/kprobes/testprobe/enable
|
|
echo > trace
|
|
( echo "forked")
|
|
grep testprobe trace
|
|
! grep '_do_fork <-' trace
|
|
|
|
# kprobe on / ftrace on
|
|
echo function > current_tracer
|
|
echo > trace
|
|
( echo "forked")
|
|
grep testprobe trace
|
|
grep '_do_fork <-' trace
|
|
|
|
# kprobe off / ftrace on
|
|
echo 0 > events/kprobes/testprobe/enable
|
|
echo > trace
|
|
( echo "forked")
|
|
! grep testprobe trace
|
|
grep '_do_fork <-' trace
|
|
|
|
# kprobe on / ftrace on
|
|
echo 1 > events/kprobes/testprobe/enable
|
|
echo function > current_tracer
|
|
echo > trace
|
|
( echo "forked")
|
|
grep testprobe trace
|
|
grep '_do_fork <-' trace
|
|
|
|
# kprobe on / ftrace off
|
|
echo nop > current_tracer
|
|
echo > trace
|
|
( echo "forked")
|
|
grep testprobe trace
|
|
! grep '_do_fork <-' trace
|