[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110908165230.a7505321.akpm@linux-foundation.org>
Date: Thu, 8 Sep 2011 16:52:30 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Jason Baron <jbaron@...hat.com>
Cc: gregkh@...e.de, joe@...ches.com, jim.cromie@...il.com,
bvanassche@....org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] dynamic_debug: consolidate repetitive struct
_ddebug descriptor definitions
On Tue, 30 Aug 2011 14:28:41 -0400
Jason Baron <jbaron@...hat.com> wrote:
> Replace the repetitive struct _ddebug descriptor definitions with
> a new DECLARE_DYNAMIC_DEBUG_META_DATA(name, fmt) macro.
>
> ...
>
> +#define DECLARE_DYNAMIC_DEBUG_METADATA(name, fmt) \
> + static struct _ddebug __used __aligned(8) \
> + __attribute__((section("__verbose"))) name = { \
> + .modname = KBUILD_MODNAME, \
> + .function = __func__, \
> + .filename = __FILE__, \
> + .format = (fmt), \
> + .lineno = __LINE__, \
> + .flags = _DPRINTK_FLAGS_DEFAULT, \
> + .enabled = false, \
> + }
<anal>That macro implements a definition, not a declaration</anal>
--- a/include/linux/dynamic_debug.h~dynamic_debug-consolidate-repetitive-struct-_ddebug-descriptor-definitions-fix
+++ a/include/linux/dynamic_debug.h
@@ -54,7 +54,7 @@ extern int __dynamic_netdev_dbg(struct _
const char *fmt, ...)
__attribute__ ((format (printf, 3, 4)));
-#define DECLARE_DYNAMIC_DEBUG_METADATA(name, fmt) \
+#define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \
static struct _ddebug __used __aligned(8) \
__attribute__((section("__verbose"))) name = { \
.modname = KBUILD_MODNAME, \
@@ -68,7 +68,7 @@ extern int __dynamic_netdev_dbg(struct _
#define dynamic_pr_debug(fmt, ...) \
do { \
- DECLARE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
+ DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
if (unlikely(descriptor.enabled)) \
__dynamic_pr_debug(&descriptor, pr_fmt(fmt), \
##__VA_ARGS__); \
@@ -76,7 +76,7 @@ do { \
#define dynamic_dev_dbg(dev, fmt, ...) \
do { \
- DECLARE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
+ DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
if (unlikely(descriptor.enabled)) \
__dynamic_dev_dbg(&descriptor, dev, fmt, \
##__VA_ARGS__); \
@@ -84,7 +84,7 @@ do { \
#define dynamic_netdev_dbg(dev, fmt, ...) \
do { \
- DECLARE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
+ DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
if (unlikely(descriptor.enabled)) \
__dynamic_netdev_dbg(&descriptor, dev, fmt, \
##__VA_ARGS__); \
_
--
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