[JFFS2] Cleanup the debugging stuff
Artem B. Bityuckiy
dedekind at yandex.ru
Sun Jul 17 06:30:30 EDT 2005
Thomas Gleixner wrote:
> Why not ? I prefer a coherent cleanup over some halfarsed attempt.
> D1(printk(KERN_DEBUG "Scanned flash completely\n"));
> Whats wrong with
> jffs2_dbg1_msg("Scanned flash completely\n"); ?
>
> 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...
Well, if dwmw2 agrees with this, I may do this when I have time.
>- D2(jffs2_dump_block_lists(c));
>+ D2(jffs2_dbg_dump_block_lists(c));
>
> Why D2() here ? jffs2_dbg2_dump_block_lists(c) removes D2() and provides
> a quick association to the debug level.
>
I decided to make "paranoia" checks checks independent on the debug
level. I.e., one may enable JFFS2 "paranoia" check without enabling
JFFS2 debugging messages - this is often useful.
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().
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
More information about the linux-mtd
mailing list