[PATCH 2/6] tracing/branch-profiler: fix return value check on register_stat_tracer

Steven Rostedt
2009-06-04T05:26:46Z

[-- Attachment #1: 0002-tracing-branch-profiler-fix-return-value-check-on-re.patch --]
[-- Type: text/plain, Size: 805 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

The branch profiler incorrectly takes a zero return on register_stat_tracer
as an error. But zero means success.

[ Impact: remove annoying false warning on boot up ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace_branch.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c
index 7a7a9fd..19c618f 100644
--- a/kernel/trace/trace_branch.c
+++ b/kernel/trace/trace_branch.c
@@ -379,7 +379,7 @@ __init static int all_annotated_branch_stats(void)
int ret;

ret = register_stat_tracer(&all_branch_stats);
- if (!ret) {
+ if (ret) {
printk(KERN_WARNING "Warning: could not register "
"all branches stats\n");
return 1;
--
1.6.3.1

--