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