Commit 7f193c25 authored by Alexei Starovoitov's avatar Alexei Starovoitov

selftests/bpf: Test function_graph tracer and bpf trampoline together

Add simple test script to execute funciton graph tracer while BPF trampoline
attaches and detaches from the functions being graph traced.
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191209000114.1876138-4-ast@kernel.org
parent b91e014f
#!/bin/bash
TR=/sys/kernel/debug/tracing/
clear_trace() { # reset trace output
echo > $TR/trace
}
disable_tracing() { # stop trace recording
echo 0 > $TR/tracing_on
}
enable_tracing() { # start trace recording
echo 1 > $TR/tracing_on
}
reset_tracer() { # reset the current tracer
echo nop > $TR/current_tracer
}
disable_tracing
clear_trace
echo "" > $TR/set_ftrace_filter
echo '*printk* *console* *wake* *serial* *lock*' > $TR/set_ftrace_notrace
echo "bpf_prog_test*" > $TR/set_graph_function
echo "" > $TR/set_graph_notrace
echo function_graph > $TR/current_tracer
enable_tracing
./test_progs -t fentry
./test_progs -t fexit
disable_tracing
clear_trace
reset_tracer
exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment