diff options
Diffstat (limited to 'lib/dynamic_debug.c')
-rw-r--r-- | lib/dynamic_debug.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 29ff2e4cfb75..2a29f4e04bdf 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c | |||
@@ -611,20 +611,40 @@ EXPORT_SYMBOL(__dynamic_dev_dbg); | |||
611 | #ifdef CONFIG_NET | 611 | #ifdef CONFIG_NET |
612 | 612 | ||
613 | int __dynamic_netdev_dbg(struct _ddebug *descriptor, | 613 | int __dynamic_netdev_dbg(struct _ddebug *descriptor, |
614 | const struct net_device *dev, const char *fmt, ...) | 614 | const struct net_device *dev, const char *fmt, ...) |
615 | { | 615 | { |
616 | struct va_format vaf; | 616 | struct va_format vaf; |
617 | va_list args; | 617 | va_list args; |
618 | int res; | 618 | int res; |
619 | char buf[PREFIX_SIZE]; | ||
620 | 619 | ||
621 | BUG_ON(!descriptor); | 620 | BUG_ON(!descriptor); |
622 | BUG_ON(!fmt); | 621 | BUG_ON(!fmt); |
623 | 622 | ||
624 | va_start(args, fmt); | 623 | va_start(args, fmt); |
624 | |||
625 | vaf.fmt = fmt; | 625 | vaf.fmt = fmt; |
626 | vaf.va = &args; | 626 | vaf.va = &args; |
627 | res = __netdev_printk(dynamic_emit_prefix(descriptor, buf), dev, &vaf); | 627 | |
628 | if (dev && dev->dev.parent) { | ||
629 | char buf[PREFIX_SIZE]; | ||
630 | char dict[128]; | ||
631 | size_t dictlen; | ||
632 | |||
633 | dictlen = create_syslog_header(dev->dev.parent, | ||
634 | dict, sizeof(dict)); | ||
635 | |||
636 | res = printk_emit(0, 7, dictlen ? dict : NULL, dictlen, | ||
637 | "%s%s %s: %s: %pV", | ||
638 | dynamic_emit_prefix(descriptor, buf), | ||
639 | dev_driver_string(dev->dev.parent), | ||
640 | dev_name(dev->dev.parent), | ||
641 | netdev_name(dev), &vaf); | ||
642 | } else if (dev) { | ||
643 | res = printk(KERN_DEBUG "%s: %pV", netdev_name(dev), &vaf); | ||
644 | } else { | ||
645 | res = printk(KERN_DEBUG "(NULL net_device): %pV", &vaf); | ||
646 | } | ||
647 | |||
628 | va_end(args); | 648 | va_end(args); |
629 | 649 | ||
630 | return res; | 650 | return res; |