2 # SPDX-License-Identifier: GPL-2.0
3 # description: event trigger - test inter-event histogram trigger snapshot action
10 if [ ! -f set_event
]; then
11 echo "event tracing is not supported"
15 if [ ! -f snapshot
]; then
16 echo "snapshot is not supported"
20 grep -q "onchange(var)" README || exit_unsupported
# version issue
22 grep -q "snapshot()" README || exit_unsupported
# version issue
24 echo "Test snapshot action"
26 echo 1 > /sys
/kernel
/debug
/tracing
/events
/sched
/enable
28 echo 'hist:keys=comm:newprio=prio:onchange($newprio).save(comm,prio):onchange($newprio).snapshot() if comm=="ping"' >> /sys
/kernel
/debug
/tracing
/events
/sched
/sched_waking
/trigger
31 nice
-n 1 ping $LOCALHOST -c 3
35 if ! grep -q "changed:" events
/sched
/sched_waking
/hist
; then
36 fail
"Failed to create onchange action inter-event histogram"
39 if ! grep -q "comm=ping" snapshot
; then
40 fail
"Failed to create snapshot action inter-event histogram"