]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/ftrace: Have reset_ftrace_filter handle multiple instances
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 6 Feb 2018 22:15:02 +0000 (17:15 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 8 Feb 2018 15:13:17 +0000 (10:13 -0500)
commitd23d1dd43feaa40c662d6f8eea7b66f22d5f1642
treeb28b6e0eca3746c59b96a6e4a86b0d9b8f61e71e
parent39565ee37ec5beb12ba0001aa1f4e7393c095c84
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>
tools/testing/selftests/ftrace/test.d/functions