[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1375384865.2034.70.camel@joe-AO722>
Date: Thu, 01 Aug 2013 12:21:05 -0700
From: Joe Perches <joe@...ches.com>
To: Paul Gortmaker <paul.gortmaker@...driver.com>
Cc: Jan Kara <jack@...e.cz>, Andrew Morton <akpm@...ux-foundation.org>,
linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] jbd: use a single printk for jbd_debug()
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
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists