linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Jan Kara <jack@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] jbd: use a single printk for jbd_debug()
Date: Thu, 01 Aug 2013 12:21:05 -0700	[thread overview]
Message-ID: <1375384865.2034.70.camel@joe-AO722> (raw)
In-Reply-To: <1375383668-8072-5-git-send-email-paul.gortmaker@windriver.com>

On Thu, 2013-08-01 at 15:01 -0400, Paul Gortmaker wrote:
> Backport of jbd2 commit 169f1a2a87aae44034da4b9f81be1683d33de6d0
> ("jbd2: use a single printk for jbd_debug()")

Hey Paul.

> diff --git a/include/linux/jbd.h b/include/linux/jbd.h
[]
> @@ -56,16 +56,13 @@
>  #define JBD_EXPENSIVE_CHECKING
>  extern ushort journal_enable_debug;
>  
> -#define jbd_debug(n, f, a...)						\
> -	do {								\
> -		if ((n) <= journal_enable_debug) {			\
> -			printk (KERN_DEBUG "(%s, %d): %s: ",		\
> -				__FILE__, __LINE__, __func__);	\
> -			printk (f, ## a);				\
> -		}							\
> -	} while (0)
> +void __jbd_debug(int level, const char *file, const char *func,
> +		 unsigned int line, const char *fmt, ...
> +
> +#define jbd_debug(n, fmt, a...) \
> +	__jbd_debug((n), __FILE__, __func__, __LINE__, (fmt), ##a)
>  #else
> -#define jbd_debug(f, a...)	/**/
> +#define jbd_debug(n, fmt, a...)    /**/
>  #endif

It might have been (and may still be) simpler/better
to use a single macro like:

#define jbd_dbg(n, fmt, ...)			\
do {						\
	if ((n) < journal_enable_debug)		\
		pr_debug(fmt, ##__VA_ARGS__);	\
} while (0)

and then use dynamic_debug to add the __func__,
and __LINE__ when desired.

echo -n 'module jbd +pfl' <dynamic_debug>/control

  reply	other threads:[~2013-08-01 19:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01 19:01 [PATCH 0/4] Backports of jbd2 commits to jbd Paul Gortmaker
2013-08-01 19:01 ` [PATCH 1/4] jbd: use module parameters instead of debugfs for jbd_debug Paul Gortmaker
2013-08-01 21:24   ` Jan Kara
2013-08-01 23:18     ` Paul Gortmaker
2013-08-01 19:01 ` [PATCH 2/4] jbd: relocate assert after state lock in journal_commit_transaction() Paul Gortmaker
2013-08-01 21:24   ` Jan Kara
2013-08-01 19:01 ` [PATCH 3/4] jbd: drop checkpoint mutex when waiting in __log_wait_for_space() Paul Gortmaker
2013-08-01 22:35   ` Jan Kara
2013-08-01 19:01 ` [PATCH 4/4] jbd: use a single printk for jbd_debug() Paul Gortmaker
2013-08-01 19:21   ` Joe Perches [this message]
2013-08-01 22:23     ` Jan Kara
2013-08-01 22:19   ` Jan Kara
2013-08-01 19:08 ` [PATCH 0/4] Backports of jbd2 commits to jbd Paul Gortmaker

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=1375384865.2034.70.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.gortmaker@windriver.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;
as well as URLs for NNTP newsgroup(s).