]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
tracing: fix the return value of trace selftest
authorWenji Huang <wenji.huang@oracle.com>
Tue, 17 Feb 2009 06:09:47 +0000 (01:09 -0500)
committerSteven Rostedt <srostedt@redhat.com>
Tue, 17 Feb 2009 17:38:24 +0000 (12:38 -0500)
This patch is to fix the return value of trace_selftest_startup_sysprof
and trace_selftest_startup_branch on failure.

Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
kernel/trace/trace_selftest.c

index 0c9aa1457e51f729ee740bb78cccbd392c8b13d1..c72e749bcbefc80701b7c5c7053cc454d18b5be8 100644 (file)
@@ -622,7 +622,7 @@ trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr)
        ret = tracer_init(trace, tr);
        if (ret) {
                warn_failed_init_tracer(trace, ret);
-               return 0;
+               return ret;
        }
 
        /* Sleep for a 1/10 of a second */
@@ -634,6 +634,11 @@ trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr)
        trace->reset(tr);
        tracing_start();
 
+       if (!ret && !count) {
+               printk(KERN_CONT ".. no entries found ..");
+               ret = -1;
+       }
+
        return ret;
 }
 #endif /* CONFIG_SYSPROF_TRACER */
@@ -661,6 +666,11 @@ trace_selftest_startup_branch(struct tracer *trace, struct trace_array *tr)
        trace->reset(tr);
        tracing_start();
 
+       if (!ret && !count) {
+               printk(KERN_CONT ".. no entries found ..");
+               ret = -1;
+       }
+
        return ret;
 }
 #endif /* CONFIG_BRANCH_TRACER */