diff options
author | Wenji Huang <wenji.huang@oracle.com> | 2009-02-17 01:09:47 -0500 |
---|---|---|
committer | Steven Rostedt <srostedt@redhat.com> | 2009-02-17 12:38:24 -0500 |
commit | d2ef7c2f0f9ab48c25eafc0ebad0df5f7930420b (patch) | |
tree | f728344561b02428d875e30a0d07143dafd52bcc /kernel/trace/trace_selftest.c | |
parent | af513098452b8887d7c0e15a39d7cb74479501bd (diff) |
tracing: fix the return value of trace selftest
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>
Diffstat (limited to 'kernel/trace/trace_selftest.c')
-rw-r--r-- | kernel/trace/trace_selftest.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c index 0c9aa1457e51..c72e749bcbef 100644 --- a/kernel/trace/trace_selftest.c +++ b/kernel/trace/trace_selftest.c | |||
@@ -622,7 +622,7 @@ trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr) | |||
622 | ret = tracer_init(trace, tr); | 622 | ret = tracer_init(trace, tr); |
623 | if (ret) { | 623 | if (ret) { |
624 | warn_failed_init_tracer(trace, ret); | 624 | warn_failed_init_tracer(trace, ret); |
625 | return 0; | 625 | return ret; |
626 | } | 626 | } |
627 | 627 | ||
628 | /* Sleep for a 1/10 of a second */ | 628 | /* Sleep for a 1/10 of a second */ |
@@ -634,6 +634,11 @@ trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr) | |||
634 | trace->reset(tr); | 634 | trace->reset(tr); |
635 | tracing_start(); | 635 | tracing_start(); |
636 | 636 | ||
637 | if (!ret && !count) { | ||
638 | printk(KERN_CONT ".. no entries found .."); | ||
639 | ret = -1; | ||
640 | } | ||
641 | |||
637 | return ret; | 642 | return ret; |
638 | } | 643 | } |
639 | #endif /* CONFIG_SYSPROF_TRACER */ | 644 | #endif /* CONFIG_SYSPROF_TRACER */ |
@@ -661,6 +666,11 @@ trace_selftest_startup_branch(struct tracer *trace, struct trace_array *tr) | |||
661 | trace->reset(tr); | 666 | trace->reset(tr); |
662 | tracing_start(); | 667 | tracing_start(); |
663 | 668 | ||
669 | if (!ret && !count) { | ||
670 | printk(KERN_CONT ".. no entries found .."); | ||
671 | ret = -1; | ||
672 | } | ||
673 | |||
664 | return ret; | 674 | return ret; |
665 | } | 675 | } |
666 | #endif /* CONFIG_BRANCH_TRACER */ | 676 | #endif /* CONFIG_BRANCH_TRACER */ |