Skip to content

Commit

Permalink
tracing: Have event with function tracer check error return
Browse files Browse the repository at this point in the history
The self tests for event tracer does not check if the function
tracing was successfully activated. It needs to before it continues
the tests, otherwise the wrong errors may be reported.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed May 26, 2011
1 parent a1cd617 commit 17bb615
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kernel/trace/trace_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,12 @@ static struct ftrace_ops trace_ops __initdata =

static __init void event_trace_self_test_with_function(void)
{
register_ftrace_function(&trace_ops);
int ret;
ret = register_ftrace_function(&trace_ops);
if (WARN_ON(ret < 0)) {
pr_info("Failed to enable function tracer for event tests\n");
return;
}
pr_info("Running tests again, along with the function tracer\n");
event_trace_self_tests();
unregister_ftrace_function(&trace_ops);
Expand Down

0 comments on commit 17bb615

Please sign in to comment.