tracing: Have event with function tracer check error return
authorSteven Rostedt <srostedt@redhat.com>
Mon, 23 May 2011 19:27:46 +0000 (15:27 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Thu, 26 May 2011 02:13:39 +0000 (22:13 -0400)
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>
kernel/trace/trace_events.c

index 2fe110341359539b0498d49472bbdee19e344dc2..686ec399f2a83a007ddacfdbd07fd7cced24783f 100644 (file)
@@ -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);