Commit 305c8388 authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Shuah Khan
Browse files

selftests/ftrace: Support ":tracer" suffix for requires



Add ":tracer" suffix support for the requires list, so that
the testcase can list up the required tracer (e.g. function)
to the requires list.

For example, if the testcase requires function_graph tracer,
it can write requires list as below instead of checking
available_tracers.

# requires: function_graph:tracer

Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: default avatarTom Zanussi <zanussi@kernel.org>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 74e60728
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: ftrace - function graph filters with stack tracer
# requires: stack_trace set_ftrace_filter
# requires: stack_trace set_ftrace_filter function_graph:tracer

# Make sure that function graph filtering works, and is not
# affected by other tracers enabled (like stack tracer)

if ! grep -q function_graph available_tracers; then
    echo "no function graph tracer configured"
    exit_unsupported
fi

do_reset() {
    if [ -e /proc/sys/kernel/stack_tracer_enabled ]; then
	    echo 0 > /proc/sys/kernel/stack_tracer_enabled
+1 −6
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: ftrace - function graph filters
# requires: set_ftrace_filter
# requires: set_ftrace_filter function_graph:tracer

# Make sure that function graph filtering works

if ! grep -q function_graph available_tracers; then
    echo "no function graph tracer configured"
    exit_unsupported
fi

fail() { # msg
    echo $1
    exit_fail
+1 −6
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: ftrace - function glob filters
# requires: set_ftrace_filter
# requires: set_ftrace_filter function:tracer

# Make sure that function glob matching filter works.

if ! grep -q function available_tracers; then
    echo "no function tracer configured"
    exit_unsupported
fi

disable_tracing
clear_trace

+1 −6
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: ftrace - function pid notrace filters
# requires: set_ftrace_notrace_pid set_ftrace_filter
# requires: set_ftrace_notrace_pid set_ftrace_filter function:tracer
# flags: instance

# Make sure that function pid matching filter with notrace works.

if ! grep -q function available_tracers; then
    echo "no function tracer configured"
    exit_unsupported
fi

do_function_fork=1

if [ ! -f options/function-fork ]; then
+1 −6
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: ftrace - function pid filters
# requires: set_ftrace_pid set_ftrace_filter
# requires: set_ftrace_pid set_ftrace_filter function:tracer
# flags: instance

# Make sure that function pid matching filter works.
# Also test it on an instance directory

if ! grep -q function available_tracers; then
    echo "no function tracer configured"
    exit_unsupported
fi

do_function_fork=1

if [ ! -f options/function-fork ]; then
Loading