Commit 4aa4d4de authored by Naveen N. Rao's avatar Naveen N. Rao Committed by Shuah Khan

selftests/ftrace: Add check for ping command for trigger tests

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: default avatarAkanksha J N <akanksha@linux.vnet.ibm.com>
Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Suggested-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
Reviewed-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent ecc7d67a
...@@ -142,9 +142,15 @@ finish_ftrace() { ...@@ -142,9 +142,15 @@ finish_ftrace() {
check_requires() { # Check required files and tracers check_requires() { # Check required files and tracers
for i in "$@" ; do for i in "$@" ; do
p=${i%:program}
r=${i%:README} r=${i%:README}
t=${i%:tracer} t=${i%:tracer}
if [ $t != $i ]; then if [ $p != $i ]; then
if ! which $p ; then
echo "Required program $p is not found."
exit_unresolved
fi
elif [ $t != $i ]; then
if ! grep -wq $t available_tracers ; then if ! grep -wq $t available_tracers ; then
echo "Required tracer $t is not configured." echo "Required tracer $t is not configured."
exit_unsupported exit_unsupported
......
#!/bin/sh #!/bin/sh
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# description: event trigger - test field variable support # description: event trigger - test field variable support
# requires: set_event synthetic_events events/sched/sched_process_fork/hist # requires: set_event synthetic_events events/sched/sched_process_fork/hist ping:program
fail() { #msg fail() { #msg
echo $1 echo $1
......
#!/bin/sh #!/bin/sh
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# description: event trigger - test inter-event combined histogram trigger # description: event trigger - test inter-event combined histogram trigger
# requires: set_event synthetic_events events/sched/sched_process_fork/hist # requires: set_event synthetic_events events/sched/sched_process_fork/hist ping:program
fail() { #msg fail() { #msg
echo $1 echo $1
......
#!/bin/sh #!/bin/sh
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# description: event trigger - test inter-event histogram trigger onchange action # description: event trigger - test inter-event histogram trigger onchange action
# requires: set_event "onchange(var)":README # requires: set_event "onchange(var)":README ping:program
fail() { #msg fail() { #msg
echo $1 echo $1
......
#!/bin/sh #!/bin/sh
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# description: event trigger - test inter-event histogram trigger onmatch action # description: event trigger - test inter-event histogram trigger onmatch action
# requires: set_event synthetic_events events/sched/sched_process_fork/hist # requires: set_event synthetic_events events/sched/sched_process_fork/hist ping:program
fail() { #msg fail() { #msg
echo $1 echo $1
......
#!/bin/sh #!/bin/sh
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# description: event trigger - test inter-event histogram trigger onmatch-onmax action # description: event trigger - test inter-event histogram trigger onmatch-onmax action
# requires: set_event synthetic_events events/sched/sched_process_fork/hist # requires: set_event synthetic_events events/sched/sched_process_fork/hist ping:program
fail() { #msg fail() { #msg
echo $1 echo $1
......
#!/bin/sh #!/bin/sh
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# description: event trigger - test inter-event histogram trigger onmax action # description: event trigger - test inter-event histogram trigger onmax action
# requires: set_event synthetic_events events/sched/sched_process_fork/hist # requires: set_event synthetic_events events/sched/sched_process_fork/hist ping:program
fail() { #msg fail() { #msg
echo $1 echo $1
......
#!/bin/sh #!/bin/sh
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# description: event trigger - test inter-event histogram trigger snapshot action # 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 # requires: set_event snapshot events/sched/sched_process_fork/hist "onchange(var)":README "snapshot()":README ping:program
fail() { #msg fail() { #msg
echo $1 echo $1
......
#!/bin/sh #!/bin/sh
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# description: event trigger - test inter-event histogram trigger trace action with dynamic string param # description: event trigger - test inter-event histogram trigger trace action with dynamic string param
# requires: set_event synthetic_events events/sched/sched_process_exec/hist "char name[]' >> synthetic_events":README # requires: set_event synthetic_events events/sched/sched_process_exec/hist "char name[]' >> synthetic_events":README ping:program
fail() { #msg fail() { #msg
echo $1 echo $1
......
#!/bin/sh #!/bin/sh
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# description: event trigger - test inter-event histogram trigger trace action # description: event trigger - test inter-event histogram trigger trace action
# requires: set_event synthetic_events events/sched/sched_process_fork/hist "trace(<synthetic_event>":README # requires: set_event synthetic_events events/sched/sched_process_fork/hist "trace(<synthetic_event>":README ping:program
fail() { #msg fail() { #msg
echo $1 echo $1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment