[JFFS2] Cleanup the debugging stuff
Thomas Gleixner
tglx at linutronix.de
Sun Jul 17 06:47:16 EDT 2005
On Sun, 2005-07-17 at 14:30 +0400, Artem B. Bityuckiy wrote:
> > All those D1 messages should have KERN_DEBUG syslog level, so its simple
> > to wrap them nicely.
> ... and sometimes one may need to print current->pid at the debugging
> messages prefix...
? jffs2_dgb1_msg("Bla: %d. Message\n", current->pid);
> In turn, "paranoia" functions use "dump" functions, for example:
>
> jffs2_dbg_fragtree_paranoia_check() uses jffs2_dbg_dump_fragtree();
> jffs2_dbg_prewrite_paranoia_check() uses jffs2_dbg_dump_buffer();
> etc.
>
> So, as "paranoia" functions do not depend on the debug level, "dump"
> functions should not depend on it as well. jffs2_dbg_dump_block_lists()
> is also a "dump" function and I did not make "a quick association" for
> it. It allows me to have debug level 0 and at the same "paranoia" checks
> enabled.
>
> But for "paranoia" functions I made the "quick association", so no Dx()
> is needed when you call, say, jffs2_dbg_fragtree_paranoia_check().
Remove all the Dx() crap or none. This is more mess than before. You can
achieve all this by defining the macros correct
#if DBGLEVEL > 1
#define jffs2_dbg2_dump_whatever jff2_dbg_dmp_whatever
#else
#define jffs2_dbg2_dump_whatever do {} while(0)
#endif
#if DBGLEVEL > 1 || PARANOIA > 0
extern void jffs2_dbg_dump_whatever(arg);
#else
#define jffs2_dbg_dump_whatever do {} while(0)
#endif
tglx
More information about the linux-mtd
mailing list