mirror of
https://github.com/torvalds/linux.git
synced 2026-04-30 20:42:33 -04:00
All these tests depend on the ping command and will fail if it is not found. Allow tests to specify dependencies on programs through the 'requires' field. Add dependency on 'ping' for some of the trigger tests. Link: https://lore.kernel.org/all/20221017104312.16af5467@gandalf.local.home/ Reported-by: Akanksha J N <akanksha@linux.vnet.ibm.com> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Suggested-by: Steven Rostedt (Google) <rostedt@goodmis.org> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
31 lines
830 B
Bash
31 lines
830 B
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# description: event trigger - test inter-event histogram trigger snapshot action
|
|
# requires: set_event snapshot events/sched/sched_process_fork/hist "onchange(var)":README "snapshot()":README ping:program
|
|
|
|
fail() { #msg
|
|
echo $1
|
|
exit_fail
|
|
}
|
|
|
|
echo "Test snapshot action"
|
|
|
|
echo 1 > events/sched/enable
|
|
|
|
echo 'hist:keys=comm:newprio=prio:onchange($newprio).save(comm,prio):onchange($newprio).snapshot() if comm=="ping"' >> events/sched/sched_waking/trigger
|
|
|
|
ping $LOCALHOST -c 3
|
|
nice -n 1 ping $LOCALHOST -c 3
|
|
|
|
echo 0 > tracing_on
|
|
|
|
if ! grep -q "changed:" events/sched/sched_waking/hist; then
|
|
fail "Failed to create onchange action inter-event histogram"
|
|
fi
|
|
|
|
if ! grep -q "comm=ping" snapshot; then
|
|
fail "Failed to create snapshot action inter-event histogram"
|
|
fi
|
|
|
|
exit 0
|