summaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2018-02-06 17:15:02 -0500
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2018-02-08 10:13:17 -0500
commit0787ce336075ac0fa2d356de4e3c2a2488e851a6 (patch)
treeb28b6e0eca3746c59b96a6e4a86b0d9b8f61e71e /tools/testing
parentdf9d36d9e8adefe0975c7b5888967651b3db3af3 (diff)
downloadop-kernel-dev-0787ce336075ac0fa2d356de4e3c2a2488e851a6.zip
op-kernel-dev-0787ce336075ac0fa2d356de4e3c2a2488e851a6.tar.gz
selftests/ftrace: Have reset_ftrace_filter handle multiple instances
If a probe is attached to a static function that is in multiple files with the same name, removing it by name will remove all instances: # grep jump_label_unlock set_ftrace_filter jump_label_unlock:traceoff:unlimited jump_label_unlock:traceoff:unlimited # echo '!jump_label_unlock:traceoff' >> set_ftrace_filter # grep jump_label_unlock set_ftrace_filter # But the loop in reset_ftrace_filter will try to remove multiple instances multiple times. If this happens the second time will error and cause the test to fail. At each iteration of the loop, check to see if the probe being removed still exists. Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/ftrace/test.d/functions3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
index e7c4c7b..df3dd7f 100644
--- a/tools/testing/selftests/ftrace/test.d/functions
+++ b/tools/testing/selftests/ftrace/test.d/functions
@@ -37,6 +37,9 @@ reset_ftrace_filter() { # reset all triggers in set_ftrace_filter
if [ "$tr" = "" ]; then
continue
fi
+ if ! grep -q "$t" set_ftrace_filter; 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: -f2-4`
OpenPOWER on IntegriCloud