2 clear_trace() { # reset trace output
6 disable_tracing() { # stop trace recording
10 enable_tracing() { # start trace recording
14 reset_tracer() { # reset the current tracer
15 echo nop > current_tracer
18 reset_trigger() { # reset all current setting triggers
19 grep -v ^# events/*/*/trigger |
21 cmd=`echo $line | cut -f2- -d: | cut -f1 -d" "`
22 echo "!$cmd" > `echo $line | cut -f1 -d:`
26 reset_events_filter() { # reset all current setting filters
27 grep -v ^none events/*/*/filter |
29 echo 0 > `echo $line | cut -f1 -d:`
33 reset_ftrace_filter() { # reset all triggers in set_ftrace_filter
34 echo > set_ftrace_filter
35 grep -v '^#' set_ftrace_filter | while read t; do
36 tr=`echo $t | cut -d: -f2`
37 if [ "$tr" = "" ]; then
40 if ! grep -q "$t" set_ftrace_filter; then
43 name=`echo $t | cut -d: -f1 | cut -d' ' -f1`
44 if [ $tr = "enable_event" -o $tr = "disable_event" ]; then
45 tr=`echo $t | cut -d: -f2-4`
46 limit=`echo $t | cut -d: -f5`
48 tr=`echo $t | cut -d: -f2`
49 limit=`echo $t | cut -d: -f3`
51 if [ "$limit" != "unlimited" ]; then
54 echo "!$name:$tr" > set_ftrace_filter
59 echo 0 > events/enable
62 initialize_ftrace() { # Reset ftrace to initial-state
63 # As the initial state, ftrace will be set to nop tracer,
64 # no events, no triggers, no filters, no function filters,
65 # no probes, and tracing on.
71 echo > set_event_pid # event tracer is always on
72 [ -f set_ftrace_filter ] && echo | tee set_ftrace_*
73 [ -f set_graph_function ] && echo | tee set_graph_*
74 [ -f stack_trace_filter ] && echo > stack_trace_filter
75 [ -f kprobe_events ] && echo > kprobe_events
76 [ -f uprobe_events ] && echo > uprobe_events