diff options
author | Jason Baron <jbaron@redhat.com> | 2011-08-11 14:36:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-22 21:23:06 -0400 |
commit | ffa10cb47a94c9b456c83301c8047e2a898dd409 (patch) | |
tree | dd0fb674235c51d54fd80540420c23002795048e /include/linux | |
parent | ac0ac38f68be73b92dc390ceace50a0d143d76ae (diff) |
dynamic_debug: make netdev_dbg() call __netdev_printk()
Previously, if dynamic debug was enabled netdev_dbg() was using
dynamic_dev_dbg() to print out the underlying msg. Fix this by making
sure netdev_dbg() uses __netdev_printk().
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/dynamic_debug.h | 17 | ||||
-rw-r--r-- | include/linux/netdevice.h | 6 |
2 files changed, 21 insertions, 2 deletions
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 843cb9eb4226..feaac1ee3001 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h | |||
@@ -47,6 +47,13 @@ extern int __dynamic_dev_dbg(struct _ddebug *descriptor, | |||
47 | const char *fmt, ...) | 47 | const char *fmt, ...) |
48 | __attribute__ ((format (printf, 3, 4))); | 48 | __attribute__ ((format (printf, 3, 4))); |
49 | 49 | ||
50 | struct net_device; | ||
51 | |||
52 | extern int __dynamic_netdev_dbg(struct _ddebug *descriptor, | ||
53 | const struct net_device *dev, | ||
54 | const char *fmt, ...) | ||
55 | __attribute__ ((format (printf, 3, 4))); | ||
56 | |||
50 | #define dynamic_pr_debug(fmt, ...) do { \ | 57 | #define dynamic_pr_debug(fmt, ...) do { \ |
51 | static struct _ddebug descriptor \ | 58 | static struct _ddebug descriptor \ |
52 | __used \ | 59 | __used \ |
@@ -67,6 +74,16 @@ extern int __dynamic_dev_dbg(struct _ddebug *descriptor, | |||
67 | __dynamic_dev_dbg(&descriptor, dev, fmt, ##__VA_ARGS__); \ | 74 | __dynamic_dev_dbg(&descriptor, dev, fmt, ##__VA_ARGS__); \ |
68 | } while (0) | 75 | } while (0) |
69 | 76 | ||
77 | #define dynamic_netdev_dbg(dev, fmt, ...) do { \ | ||
78 | static struct _ddebug descriptor \ | ||
79 | __used \ | ||
80 | __attribute__((section("__verbose"), aligned(8))) = \ | ||
81 | { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ | ||
82 | _DPRINTK_FLAGS_DEFAULT }; \ | ||
83 | if (unlikely(descriptor.enabled)) \ | ||
84 | __dynamic_netdev_dbg(&descriptor, dev, fmt, ##__VA_ARGS__);\ | ||
85 | } while (0) | ||
86 | |||
70 | #else | 87 | #else |
71 | 88 | ||
72 | static inline int ddebug_remove_module(const char *mod) | 89 | static inline int ddebug_remove_module(const char *mod) |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ddee79bb8f15..9333a0300c5e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -2617,6 +2617,9 @@ static inline const char *netdev_name(const struct net_device *dev) | |||
2617 | return dev->name; | 2617 | return dev->name; |
2618 | } | 2618 | } |
2619 | 2619 | ||
2620 | extern int __netdev_printk(const char *level, const struct net_device *dev, | ||
2621 | struct va_format *vaf); | ||
2622 | |||
2620 | extern int netdev_printk(const char *level, const struct net_device *dev, | 2623 | extern int netdev_printk(const char *level, const struct net_device *dev, |
2621 | const char *format, ...) | 2624 | const char *format, ...) |
2622 | __attribute__ ((format (printf, 3, 4))); | 2625 | __attribute__ ((format (printf, 3, 4))); |
@@ -2644,8 +2647,7 @@ extern int netdev_info(const struct net_device *dev, const char *format, ...) | |||
2644 | #elif defined(CONFIG_DYNAMIC_DEBUG) | 2647 | #elif defined(CONFIG_DYNAMIC_DEBUG) |
2645 | #define netdev_dbg(__dev, format, args...) \ | 2648 | #define netdev_dbg(__dev, format, args...) \ |
2646 | do { \ | 2649 | do { \ |
2647 | dynamic_dev_dbg((__dev)->dev.parent, "%s: " format, \ | 2650 | dynamic_netdev_dbg(__dev, format, ##args); \ |
2648 | netdev_name(__dev), ##args); \ | ||
2649 | } while (0) | 2651 | } while (0) |
2650 | #else | 2652 | #else |
2651 | #define netdev_dbg(__dev, format, args...) \ | 2653 | #define netdev_dbg(__dev, format, args...) \ |