tracing: Add hist trigger onchange() handler test case
Add a test case verifying the basic functionality of the hist:onchange($var) handler. Link: http://lkml.kernel.org/r/bec87aa8ed7d81794510b3d465096a750c71fce7.1550100284.git.tom.zanussi@linux.intel.com Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
parent
146459fe67
commit
6f6eaa1eba
@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# description: event trigger - test inter-event histogram trigger onchange action
|
||||
|
||||
fail() { #msg
|
||||
echo $1
|
||||
exit_fail
|
||||
}
|
||||
|
||||
if [ ! -f set_event ]; then
|
||||
echo "event tracing is not supported"
|
||||
exit_unsupported
|
||||
fi
|
||||
|
||||
grep -q "onchange(var)" README || exit_unsupported # version issue
|
||||
|
||||
echo "Test onchange action"
|
||||
|
||||
echo 'hist:keys=comm:newprio=prio:onchange($newprio).save(comm,prio) if comm=="ping"' >> /sys/kernel/debug/tracing/events/sched/sched_waking/trigger
|
||||
|
||||
ping $LOCALHOST -c 3
|
||||
nice -n 1 ping $LOCALHOST -c 3
|
||||
|
||||
if ! grep -q "changed:" events/sched/sched_waking/hist; then
|
||||
fail "Failed to create onchange action inter-event histogram"
|
||||
fi
|
||||
|
||||
exit 0
|
Loading…
x
Reference in New Issue
Block a user