Skip to content

Commit c049ace

Browse files
rostedtshuahkh
authored andcommitted
selftests/ftrace: Fix test to handle both old and new kernels
The function "scheduler_tick" was renamed to "sched_tick" and a selftest that used that function for testing function trace filtering used that function as part of the test. But the change causes it to fail when run on older kernels. As tests should not fail on older kernels, add a check to see which name is available before testing. Fixes: 86dd6c0 ("sched/balancing: Rename scheduler_tick() => sched_tick()") Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 99338cc commit c049ace

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ fail() { # mesg
1919

2020
FILTER=set_ftrace_filter
2121
FUNC1="schedule"
22-
FUNC2="sched_tick"
22+
if grep '^sched_tick\b' available_filter_functions; then
23+
FUNC2="sched_tick"
24+
elif grep '^scheduler_tick\b' available_filter_functions; then
25+
FUNC2="scheduler_tick"
26+
else
27+
exit_unresolved
28+
fi
29+
2330

2431
ALL_FUNCS="#### all functions enabled ####"
2532

0 commit comments

Comments
 (0)