lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1331694074.27389.42.camel@joe2Laptop>
Date:	Tue, 13 Mar 2012 20:01:14 -0700
From:	Joe Perches <joe@...ches.com>
To:	Ted Ts'o <tytso@....edu>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Andy Whitcroft <apw@...dowen.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] checkpatch: Suggest pr_<level> over printk(KERN_<LEVEL>

On Tue, 2012-03-13 at 22:41 -0400, Ted Ts'o wrote:
> On Tue, Mar 13, 2012 at 07:31:51PM -0700, Joe Perches wrote:
> > 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.
> 
> That's a debug message which is never by anyone other than ext4
> developers.  Your patch also hacked the Makefile to enable it by
> default,

It's just an example and no it didn't.
That output is still in an #ifdef EXT4FS_DEBUG
block and is unchanged.

What I did was #define DEBUG so pr_debug
(and so dynamic_debug if desired as well)
emits output to dmesg.

+ccflags-$(CONFIG_EXT4_FS) := -DDEBUG

ext4 doesn't currently use any #ifdef DEBUG blocks.

> which also enabled some performance degrading code paths
> (again, only enabled by developers who manually drop the #define in a
> header file when they are trying to figure out some obscure failure
> during the development process).  This is why I don't like people who
> are wanking around in code they don't understand just to fix style
> fixes, in the mistaken belief that it adds value.

cheers, Joe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ