This is a repost of v2 with the tags collected, and with cc to linux-kselftest list: https://lore.kernel.org/all/cover.1666101523.git.naveen.n.rao@linux.vnet.ibm...
- Naveen
Naveen N. Rao (2): selftests/ftrace: Add check for ping command for trigger tests selftests/ftrace: Convert tracer tests to use 'requires' to specify program dependency
tools/testing/selftests/ftrace/test.d/functions | 8 +++++++- tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc | 7 +------ tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc | 7 +------ .../trigger/inter-event/trigger-field-variable-support.tc | 2 +- .../inter-event/trigger-inter-event-combined-hist.tc | 2 +- .../trigger/inter-event/trigger-onchange-action-hist.tc | 2 +- .../trigger/inter-event/trigger-onmatch-action-hist.tc | 2 +- .../inter-event/trigger-onmatch-onmax-action-hist.tc | 2 +- .../trigger/inter-event/trigger-onmax-action-hist.tc | 2 +- .../trigger/inter-event/trigger-snapshot-action-hist.tc | 2 +- .../inter-event/trigger-synthetic-event-dynstring.tc | 2 +- .../trigger/inter-event/trigger-trace-action-hist.tc | 2 +- 12 files changed, 18 insertions(+), 22 deletions(-)
base-commit: cb05c81ada76a30a25a5f79b249375e33473af33
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 --- tools/testing/selftests/ftrace/test.d/functions | 8 +++++++- .../trigger/inter-event/trigger-field-variable-support.tc | 2 +- .../inter-event/trigger-inter-event-combined-hist.tc | 2 +- .../trigger/inter-event/trigger-onchange-action-hist.tc | 2 +- .../trigger/inter-event/trigger-onmatch-action-hist.tc | 2 +- .../inter-event/trigger-onmatch-onmax-action-hist.tc | 2 +- .../trigger/inter-event/trigger-onmax-action-hist.tc | 2 +- .../trigger/inter-event/trigger-snapshot-action-hist.tc | 2 +- .../inter-event/trigger-synthetic-event-dynstring.tc | 2 +- .../trigger/inter-event/trigger-trace-action-hist.tc | 2 +- 10 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions index 5f6cbec847fc99..779f3e62ec9005 100644 --- a/tools/testing/selftests/ftrace/test.d/functions +++ b/tools/testing/selftests/ftrace/test.d/functions @@ -142,9 +142,15 @@ finish_ftrace() {
check_requires() { # Check required files and tracers for i in "$@" ; do + p=${i%:program} r=${i%:README} 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 echo "Required tracer $t is not configured." exit_unsupported diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc index 41119e0440e960..04c5dd7d0acc4b 100644 --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # 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 echo $1 diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc index 9098f1e7433fd0..f7447d800899ac 100644 --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # 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 echo $1 diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onchange-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onchange-action-hist.tc index adaabb873ed4ab..91339c1308324b 100644 --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onchange-action-hist.tc +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onchange-action-hist.tc @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # 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 echo $1 diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc index 20e39471052e9a..d645abcf11c4f7 100644 --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # 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 echo $1 diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc index f4b03ab7c28714..c369247efb3501 100644 --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # 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 echo $1 diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc index 71c9b5911c7067..e28dc5f11b2be0 100644 --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmax-action-hist.tc @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # 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 echo $1 diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc index 67fa328b830f5f..147967e86584ac 100644 --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc @@ -1,7 +1,7 @@ #!/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 +# requires: set_event snapshot events/sched/sched_process_fork/hist "onchange(var)":README "snapshot()":README ping:program
fail() { #msg echo $1 diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-dynstring.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-dynstring.tc index 3d65c856eca3e6..213d890ed1886e 100644 --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-dynstring.tc +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-dynstring.tc @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # 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 echo $1 diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc index c126d2350a6d41..d7312047ce2818 100644 --- a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # 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 echo $1
Now that we have a good way to specify dependency of tests on programs, convert some of the tracer tests to use this method for specifying dependency on 'chrt'.
Reviewed-by: Steven Rostedt (Google) rostedt@goodmis.org Signed-off-by: Naveen N. Rao naveen.n.rao@linux.vnet.ibm.com --- tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc | 7 +------ tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc b/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc index 11be10e1bf966a..e8f0fac9a110cc 100644 --- a/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc +++ b/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc @@ -1,12 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # description: Test wakeup tracer -# requires: wakeup:tracer - -if ! which chrt ; then - echo "chrt is not found. This test requires nice command." - exit_unresolved -fi +# requires: wakeup:tracer chrt:program
echo wakeup > current_tracer echo 1 > tracing_on diff --git a/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc b/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc index 3a77198b3c6902..79807656785b0f 100644 --- a/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc +++ b/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc @@ -1,12 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # description: Test wakeup RT tracer -# requires: wakeup_rt:tracer - -if ! which chrt ; then - echo "chrt is not found. This test requires chrt command." - exit_unresolved -fi +# requires: wakeup_rt:tracer chrt:program
echo wakeup_rt > current_tracer echo 1 > tracing_on
On Fri, 28 Oct 2022 12:46:10 +0530 "Naveen N. Rao" naveen.n.rao@linux.vnet.ibm.com wrote:
Now that we have a good way to specify dependency of tests on programs, convert some of the tracer tests to use this method for specifying dependency on 'chrt'.
Looks good to me.
Acked-by: Masami Hiramatsu (Google) mhiramat@kernel.org
Thanks!
Reviewed-by: Steven Rostedt (Google) rostedt@goodmis.org Signed-off-by: Naveen N. Rao naveen.n.rao@linux.vnet.ibm.com
tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc | 7 +------ tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc b/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc index 11be10e1bf966a..e8f0fac9a110cc 100644 --- a/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc +++ b/tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc @@ -1,12 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # description: Test wakeup tracer -# requires: wakeup:tracer
-if ! which chrt ; then
- echo "chrt is not found. This test requires nice command."
- exit_unresolved
-fi +# requires: wakeup:tracer chrt:program echo wakeup > current_tracer echo 1 > tracing_on diff --git a/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc b/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc index 3a77198b3c6902..79807656785b0f 100644 --- a/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc +++ b/tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc @@ -1,12 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 # description: Test wakeup RT tracer -# requires: wakeup_rt:tracer
-if ! which chrt ; then
- echo "chrt is not found. This test requires chrt command."
- exit_unresolved
-fi +# requires: wakeup_rt:tracer chrt:program echo wakeup_rt > current_tracer echo 1 > tracing_on -- 2.38.0
Hi Shuah,
Can you pick this series to your kselftest tree?
Thank you,
On Fri, 28 Oct 2022 12:46:08 +0530 "Naveen N. Rao" naveen.n.rao@linux.vnet.ibm.com wrote:
This is a repost of v2 with the tags collected, and with cc to linux-kselftest list: https://lore.kernel.org/all/cover.1666101523.git.naveen.n.rao@linux.vnet.ibm...
- Naveen
Naveen N. Rao (2): selftests/ftrace: Add check for ping command for trigger tests selftests/ftrace: Convert tracer tests to use 'requires' to specify program dependency
tools/testing/selftests/ftrace/test.d/functions | 8 +++++++- tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc | 7 +------ tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc | 7 +------ .../trigger/inter-event/trigger-field-variable-support.tc | 2 +- .../inter-event/trigger-inter-event-combined-hist.tc | 2 +- .../trigger/inter-event/trigger-onchange-action-hist.tc | 2 +- .../trigger/inter-event/trigger-onmatch-action-hist.tc | 2 +- .../inter-event/trigger-onmatch-onmax-action-hist.tc | 2 +- .../trigger/inter-event/trigger-onmax-action-hist.tc | 2 +- .../trigger/inter-event/trigger-snapshot-action-hist.tc | 2 +- .../inter-event/trigger-synthetic-event-dynstring.tc | 2 +- .../trigger/inter-event/trigger-trace-action-hist.tc | 2 +- 12 files changed, 18 insertions(+), 22 deletions(-)
base-commit: cb05c81ada76a30a25a5f79b249375e33473af33
2.38.0
On Fri, 28 Oct 2022 12:46:08 +0530 "Naveen N. Rao" naveen.n.rao@linux.vnet.ibm.com wrote:
This is a repost of v2 with the tags collected, and with cc to linux-kselftest list: https://lore.kernel.org/all/cover.1666101523.git.naveen.n.rao@linux.vnet.ibm...
Hi Shuah,
Can you take this (if you haven't already)?
Thanks,
-- Steve
- Naveen
Naveen N. Rao (2): selftests/ftrace: Add check for ping command for trigger tests selftests/ftrace: Convert tracer tests to use 'requires' to specify program dependency
tools/testing/selftests/ftrace/test.d/functions | 8 +++++++- tools/testing/selftests/ftrace/test.d/tracer/wakeup.tc | 7 +------ tools/testing/selftests/ftrace/test.d/tracer/wakeup_rt.tc | 7 +------ .../trigger/inter-event/trigger-field-variable-support.tc | 2 +- .../inter-event/trigger-inter-event-combined-hist.tc | 2 +- .../trigger/inter-event/trigger-onchange-action-hist.tc | 2 +- .../trigger/inter-event/trigger-onmatch-action-hist.tc | 2 +- .../inter-event/trigger-onmatch-onmax-action-hist.tc | 2 +- .../trigger/inter-event/trigger-onmax-action-hist.tc | 2 +- .../trigger/inter-event/trigger-snapshot-action-hist.tc | 2 +- .../inter-event/trigger-synthetic-event-dynstring.tc | 2 +- .../trigger/inter-event/trigger-trace-action-hist.tc | 2 +- 12 files changed, 18 insertions(+), 22 deletions(-)
base-commit: cb05c81ada76a30a25a5f79b249375e33473af33
On 11/22/22 14:49, Steven Rostedt wrote:
On Fri, 28 Oct 2022 12:46:08 +0530 "Naveen N. Rao" naveen.n.rao@linux.vnet.ibm.com wrote:
This is a repost of v2 with the tags collected, and with cc to linux-kselftest list: https://lore.kernel.org/all/cover.1666101523.git.naveen.n.rao@linux.vnet.ibm...
Hi Shuah,
Can you take this (if you haven't already)?
Already in linux-kselftest next - will send them for 6.2-rc1
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/lo...
thanks, -- Shuah
linux-kselftest-mirror@lists.linaro.org