WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / ftrace / test.d / trigger / inter-event / trigger-snapshot-action-hist.tc
blob67fa328b830f5fc5574129a5c0ae6b3e2ae1c408
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
6 fail() { #msg
7 echo $1
8 exit_fail
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
17 ping $LOCALHOST -c 3
18 nice -n 1 ping $LOCALHOST -c 3
20 echo 0 > tracing_on
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"
30 exit 0