summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onchange-action-hist.tc
blob: 91339c1308324b8a4dddf85905085c767aa60c98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test inter-event histogram trigger onchange action
# requires: set_event "onchange(var)":README ping:program

fail() { #msg
    echo $1
    exit_fail
}

echo "Test onchange action"

echo 'hist:keys=comm:newprio=prio:onchange($newprio).save(comm,prio) if comm=="ping"' >> events/sched/sched_waking/trigger

ping $LOCALHOST -c 3
nice -n 1 ping $LOCALHOST -c 3

if ! grep -q "changed:" events/sched/sched_waking/hist; then
    fail "Failed to create onchange action inter-event histogram"
fi

exit 0