mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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>
This commit is contained in:
parent
ac0ac38f68
commit
ffa10cb47a
4 changed files with 48 additions and 3 deletions
|
@ -47,6 +47,13 @@ extern int __dynamic_dev_dbg(struct _ddebug *descriptor,
|
|||
const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
|
||||
struct net_device;
|
||||
|
||||
extern int __dynamic_netdev_dbg(struct _ddebug *descriptor,
|
||||
const struct net_device *dev,
|
||||
const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
|
||||
#define dynamic_pr_debug(fmt, ...) do { \
|
||||
static struct _ddebug descriptor \
|
||||
__used \
|
||||
|
@ -67,6 +74,16 @@ extern int __dynamic_dev_dbg(struct _ddebug *descriptor,
|
|||
__dynamic_dev_dbg(&descriptor, dev, fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define dynamic_netdev_dbg(dev, fmt, ...) do { \
|
||||
static struct _ddebug descriptor \
|
||||
__used \
|
||||
__attribute__((section("__verbose"), aligned(8))) = \
|
||||
{ KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \
|
||||
_DPRINTK_FLAGS_DEFAULT }; \
|
||||
if (unlikely(descriptor.enabled)) \
|
||||
__dynamic_netdev_dbg(&descriptor, dev, fmt, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
|
||||
static inline int ddebug_remove_module(const char *mod)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue