public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] get rid of fname[] for tracing functions
Date: Wed, 7 Mar 2007 08:27:53 +0000	[thread overview]
Message-ID: <20070307082753.GA5469@infradead.org> (raw)
In-Reply-To: <45EE2EF3.8090707@sandeen.net>

On Tue, Mar 06, 2007 at 09:18:11PM -0600, Eric Sandeen wrote:
> this gets rid of the
> 
> #ifdef XFS_BMAP_TRACE
>        static char             fname[] = "xfs_iextents_copy";
> #endif
> 
> ugliness littered in the bmap code for tracing, and instead just uses 
> gcc's __FUNCTION__, which never gets out of sync with the actual 
> function name....
> 
> It also makes some of this tracing more consistently use the
> 
> #define        XFS_BMBT_TRACE_ARGBI(c,b,i)     \
>        xfs_bmbt_trace_argbi(__FUNCTION__, c, b, i, __LINE__)
> 
> type constructs, to automatically pick up the gcc extensions.

Very nice.  I might hear some people to scream that we should use
the C99 __func__ and not the __FUNCTION__ gccism, but __FUNCTION__
is what the rest of the Linux kernel uses, and can be emulated with
a trivial

	#define __func__ __FUNCTION__

on any non-gcc C99 system.

> the vn tracing could probably get a similar treatment, so that every 
> call to vn_trace_foo wouldn't have to include a function name and a 
> __builtin_return_address, but could be done via macros... it's currently 
> a mishmash of __FUNCTION__ and "function" *shrug* what do you think?

It should probably use __FUNCTION__ and hide use of both __FUNCTION__
and __builtin_return_address behind a macro.

  reply	other threads:[~2007-03-07  8:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-07  3:18 [PATCH] get rid of fname[] for tracing functions Eric Sandeen
2007-03-07  8:27 ` Christoph Hellwig [this message]
2007-03-07 14:34   ` Eric Sandeen
2007-03-17  2:27 ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070307082753.GA5469@infradead.org \
    --to=hch@infradead.org \
    --cc=sandeen@sandeen.net \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox