mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-12 22:36:25 +07:00
f06eec4d0f
This adds inter-event hist triggers testcases which covers following: - create/remove synthetic event - disable histogram for synthetic event - extended error support - field variable support - histogram variables - histogram trigger onmatch action - histogram trigger onmax action - histogram trigger onmatch-onmax action - simple expression support - combined histogram Here is the test result. === Ftrace unit tests === [1] event trigger - test extended error support [PASS] [2] event trigger - test field variable support [PASS] [3] event trigger - test inter-event combined histogram trigger [PASS] [4] event trigger - test inter-event histogram trigger onmatch action [PASS] [5] event trigger - test inter-event histogram trigger onmatch-onmax action [PASS] [6] event trigger - test inter-event histogram trigger onmax action [PASS] [7] event trigger - test synthetic event create remove [PASS] Link: http://lkml.kernel.org/r/e07ef1e72f7bf0f84dc87c9b736d6dc91b4b0b49.1516069914.git.tom.zanussi@linux.intel.com Signed-off-by: Rajvi Jingar <rajvi.jingar@intel.com> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
86 lines
2.1 KiB
Plaintext
86 lines
2.1 KiB
Plaintext
|
|
clear_trace() { # reset trace output
|
|
echo > trace
|
|
}
|
|
|
|
disable_tracing() { # stop trace recording
|
|
echo 0 > tracing_on
|
|
}
|
|
|
|
enable_tracing() { # start trace recording
|
|
echo 1 > tracing_on
|
|
}
|
|
|
|
reset_tracer() { # reset the current tracer
|
|
echo nop > current_tracer
|
|
}
|
|
|
|
reset_trigger() { # reset all current setting triggers
|
|
grep -v ^# events/*/*/trigger |
|
|
while read line; do
|
|
cmd=`echo $line | cut -f2- -d: | cut -f1 -d" "`
|
|
echo "!$cmd" > `echo $line | cut -f1 -d:`
|
|
done
|
|
}
|
|
|
|
reset_events_filter() { # reset all current setting filters
|
|
grep -v ^none events/*/*/filter |
|
|
while read line; do
|
|
echo 0 > `echo $line | cut -f1 -d:`
|
|
done
|
|
}
|
|
|
|
reset_ftrace_filter() { # reset all triggers in set_ftrace_filter
|
|
echo > set_ftrace_filter
|
|
grep -v '^#' set_ftrace_filter | while read t; do
|
|
tr=`echo $t | cut -d: -f2`
|
|
if [ "$tr" = "" ]; then
|
|
continue
|
|
fi
|
|
if ! grep -q "$t" set_ftrace_filter; then
|
|
continue;
|
|
fi
|
|
name=`echo $t | cut -d: -f1 | cut -d' ' -f1`
|
|
if [ $tr = "enable_event" -o $tr = "disable_event" ]; then
|
|
tr=`echo $t | cut -d: -f2-4`
|
|
limit=`echo $t | cut -d: -f5`
|
|
else
|
|
tr=`echo $t | cut -d: -f2`
|
|
limit=`echo $t | cut -d: -f3`
|
|
fi
|
|
if [ "$limit" != "unlimited" ]; then
|
|
tr="$tr:$limit"
|
|
fi
|
|
echo "!$name:$tr" > set_ftrace_filter
|
|
done
|
|
}
|
|
|
|
disable_events() {
|
|
echo 0 > events/enable
|
|
}
|
|
|
|
clear_synthetic_events() { # reset all current synthetic events
|
|
grep -v ^# synthetic_events |
|
|
while read line; do
|
|
echo "!$line" >> synthetic_events
|
|
done
|
|
}
|
|
|
|
initialize_ftrace() { # Reset ftrace to initial-state
|
|
# As the initial state, ftrace will be set to nop tracer,
|
|
# no events, no triggers, no filters, no function filters,
|
|
# no probes, and tracing on.
|
|
disable_tracing
|
|
reset_tracer
|
|
reset_trigger
|
|
reset_events_filter
|
|
disable_events
|
|
echo > set_event_pid # event tracer is always on
|
|
[ -f set_ftrace_filter ] && echo | tee set_ftrace_*
|
|
[ -f set_graph_function ] && echo | tee set_graph_*
|
|
[ -f stack_trace_filter ] && echo > stack_trace_filter
|
|
[ -f kprobe_events ] && echo > kprobe_events
|
|
[ -f uprobe_events ] && echo > uprobe_events
|
|
enable_tracing
|
|
}
|