OSDN Git Service

selftests/ftrace: Have reset_ftrace_filter handle modules
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 6 Feb 2018 22:10:12 +0000 (17:10 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 8 Feb 2018 15:13:09 +0000 (10:13 -0500)
If a function probe in set_ftrace_filter belongs to a module, it will
contain the module name. Like:

 wmi_query_block [wmi]:traceoff:unlimited

But writing:

 '!wmi_query_block [wmi]:traceoff' > set_ftrace_filter

will cause an error. We still need to write:

 '!wmi_query_block:traceoff' > set_ftrace_filter

Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
tools/testing/selftests/ftrace/test.d/functions

index f2019b3..e7c4c7b 100644 (file)
@@ -37,17 +37,18 @@ reset_ftrace_filter() { # reset all triggers in set_ftrace_filter
        if [ "$tr" = "" ]; then
            continue
        fi
+       name=`echo $t | cut -d: -f1 | cut -d' ' -f1`
        if [ $tr = "enable_event" -o $tr = "disable_event" ]; then
-           tr=`echo $t | cut -d: -f1-4`
+           tr=`echo $t | cut -d: -f2-4`
            limit=`echo $t | cut -d: -f5`
        else
-           tr=`echo $t | cut -d: -f1-2`
+           tr=`echo $t | cut -d: -f2`
            limit=`echo $t | cut -d: -f3`
        fi
        if [ "$limit" != "unlimited" ]; then
            tr="$tr:$limit"
        fi
-       echo "!$tr" > set_ftrace_filter
+       echo "!$name:$tr" > set_ftrace_filter
     done
 }