Re: [RFC][PATCH] New message-logging API (kprint)

From: Rob Landley
Date: Sun Oct 07 2007 - 17:51:17 EST


On Saturday 06 October 2007 1:10:26 am Vegard Nossum wrote:
> On 10/5/07, Rob Landley <rob@xxxxxxxxxxx> wrote:
> > The original idea (selectively compile out printk() instances based on
> > log level to conserve space) is explicitly not addressed by this patch,
> > and in fact this patch might actually make it harder to implement (by
> > complicating the code).
>
> This is wrong. The patch provides log-level-based filtering at compile
> time, effectively making the kernel smaller.

I made it about halfway through the patch and the only compile time filtering
I found was:

--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -62,7 +62,10 @@
Â#define MdpMinorShift 6
Â
Â#define DEBUG 0
-#define dprintk(x...) ((void)(DEBUG && printk(x)))
+#define dprintk(x...)ÂÂÂÂÂÂÂÂÂÂ\
+ÂÂÂÂÂÂÂif(DEBUG) {ÂÂÂÂÂÂÂÂÂÂÂÂÂ\
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ printk(x);ÂÂÂÂÂ\
+ÂÂÂÂÂÂÂ}

If you say it does, I'll take your word for it, but there's so much churn in
there I didn't find it before my interest ran out...

Rob
--
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/