Skip to contentSkip to conversation

kmemtrace: Fix up tracer registration.

PATCH In review Paul Mundt 3 participants 4 messages Sep 28, 2009 – Oct 1, 2009 Tracing

lore
Share & tools
lore

Paul Mundt

author
#0 lore raw

PATCH 1/1 kmemtrace: Fix up tracer registration.

Commit ddc1637af217dbd8bc51f30e6d24e84476a869a6
("kmemtrace: Print binary output only if 'bin' option is set") ended up inverting the error detection logic. register_tracer() returns 0 on success, which this change caused to treat as an error, resulting in:

[    0.132000] Warning: could not register the kmem tracer

as well as bailing out of the initcall with an error value. This restores the old logic.

Cc Li Zefan <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc Eduard - Gabriel Munteanu <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>

---

 kernel/trace/kmemtrace.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/kmemtrace.c +1 -1
index 81b1645..a91da69 100644
@@ -501,7 +501,7 @@ static int __init init_kmem_tracer(void)
 		return 1;
 	}
 
-	if (!register_tracer(&kmem_tracer)) {
+	if (register_tracer(&kmem_tracer) != 0) {
 		pr_warning("Warning: could not register the kmem tracer\n");
 		return 1;
 	}
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Paul Mundt

Commit ddc1637af217dbd8bc51f30e6d24e84476a869a6
("kmemtrace: Print binary output only if 'bin' option is set") ended up inverting the error detection logic. register_tracer() returns 0 on success, which this change caused to treat as an error, resulting in:

[    0.132000] Warning: could not register the kmem tracer

as well as bailing out of the initcall with an error value. This restores the old logic.

Looks good to me. Thanks Paul!

Acked-by on v1 1/1
#2 lore raw
In reply to Paul Mundt
Quoted 7 lines · Paul Mundt

Commit ddc1637af217dbd8bc51f30e6d24e84476a869a6
("kmemtrace: Print binary output only if 'bin' option is set") ended up inverting the error detection logic. register_tracer() returns 0 on success, which this change caused to treat as an error, resulting in:

[    0.132000] Warning: could not register the kmem tracer
Quoted 8 lines

as well as bailing out of the initcall with an error value. This restores the old logic.

Cc Li Zefan <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc Eduard - Gabriel Munteanu <[email protected]>
Cc Steven Rostedt <[email protected]>

Thanks!

#3 lore raw

[tip:tracing/urgent] kmemtrace: Fix up tracer registration

In reply to Paul Mundt
Commit-ID:  f9ac5a69edee0ee7e06a05727226e3f275306c8d
Gitweb:     http://git.kernel.org/tip/f9ac5a69edee0ee7e06a05727226e3f275306c8d
Author:     Paul Mundt <[email protected]>
AuthorDate: Mon, 28 Sep 2009 16:55:40 +0900
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 1 Oct 2009 11:53:44 +0200

kmemtrace: Fix up tracer registration

Commit ddc1637af217dbd8bc51f30e6d24e84476a869a6 ("kmemtrace: Print binary output only if 'bin' option is set") ended up inverting the error detection logic. register_tracer() returns 0 on success, which this change caused to treat as an error, resulting in:

[    0.132000] Warning: could not register the kmem tracer

as well as bailing out of the initcall with an error value. This restores the old logic.

LKML-Reference: <[email protected]>

---
 kernel/trace/kmemtrace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/trace/kmemtrace.c +1 -1
index 81b1645..a91da69 100644
@@ -501,7 +501,7 @@ static int __init init_kmem_tracer(void)
 		return 1;
 	}
 
-	if (!register_tracer(&kmem_tracer)) {
+	if (register_tracer(&kmem_tracer) != 0) {
 		pr_warning("Warning: could not register the kmem tracer\n");
 		return 1;
 	}