lkml.org 
[lkml]   [2009]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 18/20] ceph: debugging
> On Thu, 16 Jul 2009, Andi Kleen wrote:
> > Sage Weil <sage@newdream.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


\
 
 \ /
  Last update: 2009-07-17 20:09    [W:0.052 / U:5.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site