Skip to content

Commit 0787ce3

Browse files
committed
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 <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent df9d36d commit 0787ce3

File tree

1 file changed

+3
-0
lines changed
  • tools/testing/selftests/ftrace/test.d

1 file changed

+3
-0
lines changed

tools/testing/selftests/ftrace/test.d/functions

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ reset_ftrace_filter() { # reset all triggers in set_ftrace_filter
3737
if [ "$tr" = "" ]; then
3838
continue
3939
fi
40+
if ! grep -q "$t" set_ftrace_filter; then
41+
continue;
42+
fi
4043
name=`echo $t | cut -d: -f1 | cut -d' ' -f1`
4144
if [ $tr = "enable_event" -o $tr = "disable_event" ]; then
4245
tr=`echo $t | cut -d: -f2-4`

0 commit comments

Comments
 (0)