2 # SPDX-License-Identifier: GPL-2.0
3 # description: event trigger - test inter-event histogram trigger snapshot action
4 # requires: set_event snapshot events/sched/sched_process_fork/hist "onchange(var)":README "snapshot()":README
11 echo "Test snapshot action"
13 echo 1 > events
/sched
/enable
15 echo 'hist:keys=comm:newprio=prio:onchange($newprio).save(comm,prio):onchange($newprio).snapshot() if comm=="ping"' >> events
/sched
/sched_waking
/trigger
18 nice
-n 1 ping $LOCALHOST -c 3
22 if ! grep -q "changed:" events
/sched
/sched_waking
/hist
; then
23 fail
"Failed to create onchange action inter-event histogram"
26 if ! grep -q "comm=ping" snapshot
; then
27 fail
"Failed to create snapshot action inter-event histogram"