Commit | Line | Data |
---|---|---|
6f6eaa1e TZ |
1 | #!/bin/sh |
2 | # SPDX-License-Identifier: GPL-2.0 | |
3 | # description: event trigger - test inter-event histogram trigger onchange action | |
1b8eec51 | 4 | # requires: set_event "onchange(var)":README |
6f6eaa1e TZ |
5 | |
6 | fail() { #msg | |
7 | echo $1 | |
8 | exit_fail | |
9 | } | |
10 | ||
6f6eaa1e TZ |
11 | echo "Test onchange action" |
12 | ||
ba1b9c50 | 13 | echo 'hist:keys=comm:newprio=prio:onchange($newprio).save(comm,prio) if comm=="ping"' >> events/sched/sched_waking/trigger |
6f6eaa1e TZ |
14 | |
15 | ping $LOCALHOST -c 3 | |
16 | nice -n 1 ping $LOCALHOST -c 3 | |
17 | ||
18 | if ! grep -q "changed:" events/sched/sched_waking/hist; then | |
19 | fail "Failed to create onchange action inter-event histogram" | |
20 | fi | |
21 | ||
22 | exit 0 |