Skip to content

Commit 05cbbf6

Browse files
Steven Rostedtrostedt
authored andcommitted
tracing: Fix selftest function recursion accounting
The test that checks function recursion does things differently if the arch does not support all ftrace features. But that really doesn't make a difference with how the test runs, and either way the count variable should be 2 at the end. Currently the test wrongly fails for archs that don't support all the ftrace features. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent 34600f0 commit 05cbbf6

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

kernel/trace/trace_selftest.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ trace_selftest_function_recursion(void)
452452
char *func_name;
453453
int len;
454454
int ret;
455-
int cnt;
456455

457456
/* The previous test PASSED */
458457
pr_cont("PASSED\n");
@@ -510,19 +509,10 @@ trace_selftest_function_recursion(void)
510509

511510
unregister_ftrace_function(&test_recsafe_probe);
512511

513-
/*
514-
* If arch supports all ftrace features, and no other task
515-
* was on the list, we should be fine.
516-
*/
517-
if (!ftrace_nr_registered_ops() && !FTRACE_FORCE_LIST_FUNC)
518-
cnt = 2; /* Should have recursed */
519-
else
520-
cnt = 1;
521-
522512
ret = -1;
523-
if (trace_selftest_recursion_cnt != cnt) {
524-
pr_cont("*callback not called expected %d times (%d)* ",
525-
cnt, trace_selftest_recursion_cnt);
513+
if (trace_selftest_recursion_cnt != 2) {
514+
pr_cont("*callback not called expected 2 times (%d)* ",
515+
trace_selftest_recursion_cnt);
526516
goto out;
527517
}
528518

0 commit comments

Comments
 (0)