[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0907171010470.23194@cobra.newdream.net>
Date:	Fri, 17 Jul 2009 11:07:20 -0700 (PDT)
From:	Sage Weil <sage@...dream.net>
To:	Andi Kleen <andi@...stfloor.org>
cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 18/20] ceph: debugging
> On Thu, 16 Jul 2009, Andi Kleen wrote:
> > Sage Weil <sage@...dream.net> writes:
> > 
> > > Some debugging infrastructure, including the ability to adjust the
> > > level of debug output on a per-file basis.
> > 
> > That is already provided by pr_debug()/DYNAMIC_PRINTK in newer kernels.
> > You should switch to that.
I'll spare everyone the diff, but
 19 files changed, 721 insertions(+), 1107 deletions(-)
and ceph_debug.h is now just a wrapper to prefix each line with a filename 
and line number (below).
Thanks-
sage
---
#ifndef _FS_CEPH_DEBUG_H
#define _FS_CEPH_DEBUG_H
/*
 * wrap pr_debug to include a filename:lineno prefix on each line
 */
static inline const char *ceph_file_part(const char *s, int len)
{
	const char *e = s + len;
	while (e != s && *(e-1) != '/')
		e--;
	return e;
}
#define _dout(fmt, args...)						\
	pr_debug(" %12.12s:%-4d : " fmt "%s",				\
		 ceph_file_part(__FILE__, sizeof(__FILE__)),		\
		 __LINE__, args);
#define dout(args...) _dout(args, "")
#endif
--
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
 
