1 #!/bin/sh 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 ping:program 5 6 fail() { #msg 7 echo $1 8 exit_fail 9 } 10 11 echo "Test snapshot action" 12 13 echo 1 > events/sched/enable 14 15 echo 'hist:keys=comm:newprio=prio:onchange($newprio).save(comm,prio):onchange($newprio).snapshot() if comm=="ping"' >> events/sched/sched_waking/trigger 16 17 ping $LOCALHOST -c 3 18 nice -n 1 ping $LOCALHOST -c 3 19 20 echo 0 > tracing_on 21 22 if ! grep -q "changed:" events/sched/sched_waking/hist; then 23 fail "Failed to create onchange action inter-event histogram" 24 fi 25 26 if ! grep -q "comm=ping" snapshot; then 27 fail "Failed to create snapshot action inter-event histogram" 28 fi 29 30 exit 0
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.