blob: 2acbfe2c0c0c4acfd3aafd835b1abe9397de5783 [file] [log] [blame]
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: trace_marker trigger - test histogram trigger
# flags: instance
do_reset() {
reset_trigger
echo > set_event
clear_trace
}
fail() { #msg
do_reset
echo $1
exit_fail
}
if [ ! -f set_event ]; then
echo "event tracing is not supported"
exit_unsupported
fi
if [ ! -d events/ftrace/print ]; then
echo "event trace_marker is not supported"
exit_unsupported
fi
if [ ! -f events/ftrace/print/trigger ]; then
echo "event trigger is not supported"
exit_unsupported
fi
if [ ! -f events/ftrace/print/hist ]; then
echo "hist trigger is not supported"
exit_unsupported
fi
do_reset
echo "Test histogram trace_marker tigger"
echo 'hist:keys=common_pid' > events/ftrace/print/trigger
for i in `seq 1 10` ; do echo "hello" > trace_marker; done
grep 'hitcount: *10$' events/ftrace/print/hist > /dev/null || \
fail "hist trigger did not trigger correct times on trace_marker"
do_reset
exit 0