xref: /linux/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onchange-action-hist.tc (revision a4eb44a6435d6d8f9e642407a4a06f65eb90ca04)
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
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