Re: [PATCH] checkpatch: Suggest pr_<level> over printk(KERN_<LEVEL>

From: Joe Perches
Date: Tue Mar 13 2012 - 22:31:53 EST


On Tue, 2012-03-13 at 22:19 -0400, Ted Ts'o wrote:
> On Tue, Mar 13, 2012 at 06:17:11PM -0700, Joe Perches wrote:
> > The patch was all apiece, every bit associated to logging output.
> > It was bundled to make it easier to apply.
> >
> > You call it junk, I call it cleanups.
>
> Changing stuff to pr_foo is ***NOISE***. It adds no value, and it
> makes it my life much, MUCH harder.

I dispute that it add no value.

pr_<foo> adds value to the dmesg output because
it can be consistently prefixed via pr_fmt.

Right now many fs ext4 messages are somewhat opaque
without any reference to what kernel subsystem produced
the message.

For instance:

fs/ext4/ialloc.c: printk(KERN_DEBUG "group %lu: stored = %d, counted = %lu\n",

This is a somewhat senseless output in dmesg without
any linkage to ext4.

Using pr_fmt and pr_debug as I sent a patch to do
instead emits in dmesg:

EXT4-fs: group: etc...

Using subsystem prefixes makes it easy and consistent to
grep dmesg.

cheers, Joe

--
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/