Thread (95 messages) 95 messages, 9 authors, 2008-12-04

Re: [PATCH 05/39] wimax: debug macros and debug settings for the WiMAX stack

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2008-11-27 09:28:56

On Wed, 2008-11-26 at 15:07 -0800, Inaky Perez-Gonzalez wrote:
This file contains a simple debug framework that is used in the stack;
                       ^^^^^ ??
it allows the debug level to be controlled at compile-time (so the
debug code is optimized out) and at run-time (for what wasn't compiled
out).
Recently we got new stuff for dynamic printk
(include/linux/dynamic_printk.h) and pr_debug with a start format
(include/linux/kernel.h, pr_fmt); can you use any of that to make this
smaller? If not, I think you ought to argue why not, and possibly
improve the generic facility.

Personally, I'm tired of seeing every Intel driver come with a new huge
set of debugging macros that are barely understandable.
+#define _d_printf(l, tag, dev, f, a...)					\
+do {									\
+	char head[64];							\
+	if (!d_test(l))							\
+		break;							\
+	__d_head(head, sizeof(head), dev);				\
+	printk(KERN_ERR "%s%s%s: " f, head, __func__, tag, ##a);	\
+} while (0 && dev)
That && dev is wrong.

johannes

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help