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: <200709261401.l8QE1B3P025688@agora.fsl.cs.sunysb.edu>
Date:	Wed, 26 Sep 2007 10:01:11 -0400
From:	Erez Zadok <ezk@...sunysb.edu>
To:	Jan Engelhardt <jengelh@...putergmbh.de>
Cc:	Erez Zadok <ezk@...sunysb.edu>, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	viro@....linux.org.uk, hch@...radead.org
Subject: Re: [PATCH 03/25] Unionfs: display informational messages only if debug is on 

In message <Pine.LNX.4.64.0709261036140.3121@...rervta.pbzchgretzou.qr>, Jan Engelhardt writes:
> 
> On Sep 25 2007 23:09, Erez Zadok wrote:
> >--- a/fs/unionfs/commonfops.c
> >+++ b/fs/unionfs/commonfops.c
> >@@ -394,8 +394,8 @@ int unionfs_file_revalidate(struct file *file, bool willwrite)
> > 	if (willwrite && IS_WRITE_FLAG(file->f_flags) &&
> > 	    !IS_WRITE_FLAG(unionfs_lower_file(file)->f_flags) &&
> > 	    is_robranch(dentry)) {
> >-		printk(KERN_DEBUG "unionfs: do delay copyup of \"%s\"\n",
> >-		       dentry->d_name.name);
> >+		dprintk(KERN_DEBUG "unionfs: do delay copyup of \"%s\"\n",
> >+			dentry->d_name.name);
> 
> Don't we have pr_debug() for that?

Jan, what's the policy on people writing their own debugging printk systems.
I've looked at what other file systems do, and found out that it varies a
lot: some use a simple mapping wrapper from printk->dprintk, while others
define complex ways to have debugging levels/bitmaps where users can
selectively decide (say, by a mount option), what debugging output they'd
like to see or not.  Here's a small sampling of what some file systems use:

9p/fid.c:		P9_DPRINTK(P9_DEBUG_VFS, "fid %d dentry %s\n",
autofs/inode.c:		DPRINTK(("autofs: shutting down\n"));
lockd/svcproc.c:	dprintk("lockd: GRANTED_RES   called\n");
ncpfs/dir.c:		DDPRINTK("ncp_lookup_validate: result=%d\n", val);
nfs/client.c:		dprintk("<-- nfs_free_client()\n");
nfsd/export.c:		dprintk("found domain %s\n", buf);
partitions/efi.c:	Dprintk("GPT my_lba incorrect: %lld != %lld\n",

Not much standardization there :-) but "dprintk" does appear to be the more
common use.

I wanted something simple to allow me to not printk something that's just
for informational/debugging purposes, but w/o having to #ifdef the printk in
question, or define a complex debugging-level printk system.

Now, looking at pr_debug (in linux/kernel.h), and indeed some filesystems
(e.g., affs and configfs) use it.  But pr_debug is only active when #define
DEBUG is on (not CONFIG_DEBUG).  I didn't see a config option that enable
DEBUG: is there one?

>From other file systems, it appears that the more common convention is for
filesystem XYZ to offer a config option CONFIG_DEBUG_XYZ, which makes its
debugging more self-contained and keeps the config option closer to where
the f/s itself is enabled.

Thanks,
Erez.
-
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