Skip to content

Commit

Permalink
tracing: Fix selftest function recursion accounting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Jan 23, 2013
1 parent 34600f0 commit 05cbbf6
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions kernel/trace/trace_selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ trace_selftest_function_recursion(void)
char *func_name;
int len;
int ret;
int cnt;

/* The previous test PASSED */
pr_cont("PASSED\n");
Expand Down Expand Up @@ -510,19 +509,10 @@ trace_selftest_function_recursion(void)

unregister_ftrace_function(&test_recsafe_probe);

/*
* If arch supports all ftrace features, and no other task
* was on the list, we should be fine.
*/
if (!ftrace_nr_registered_ops() && !FTRACE_FORCE_LIST_FUNC)
cnt = 2; /* Should have recursed */
else
cnt = 1;

ret = -1;
if (trace_selftest_recursion_cnt != cnt) {
pr_cont("*callback not called expected %d times (%d)* ",
cnt, trace_selftest_recursion_cnt);
if (trace_selftest_recursion_cnt != 2) {
pr_cont("*callback not called expected 2 times (%d)* ",
trace_selftest_recursion_cnt);
goto out;
}

Expand Down

0 comments on commit 05cbbf6

Please sign in to comment.