Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f6eaa1e authored by Tom Zanussi's avatar Tom Zanussi Committed by Steven Rostedt (VMware)
Browse files

tracing: Add hist trigger onchange() handler test case

parent 146459fe
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test inter-event histogram trigger onchange action

fail() { #msg
    echo $1
    exit_fail
}

if [ ! -f set_event ]; then
    echo "event tracing is not supported"
    exit_unsupported
fi

grep -q "onchange(var)" README || exit_unsupported # version issue

echo "Test onchange action"

echo 'hist:keys=comm:newprio=prio:onchange($newprio).save(comm,prio) if comm=="ping"' >> /sys/kernel/debug/tracing/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