lkml.org 
[lkml]   [2011]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 1/4] dynamic_debug: consolidate repetitive struct _ddebug descriptor definitions
On Tue, 30 Aug 2011 14:28:41 -0400
Jason Baron <jbaron@redhat.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__); \
_


\
 
 \ /
  Last update: 2011-09-09 01:55    [W:0.066 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site