diff options
Diffstat (limited to 'lib/dynamic_debug.c')
| -rw-r--r-- | lib/dynamic_debug.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 7bdf98c37e91..8a16c2d498e9 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c | |||
| @@ -37,6 +37,8 @@ | |||
| 37 | #include <linux/device.h> | 37 | #include <linux/device.h> |
| 38 | #include <linux/netdevice.h> | 38 | #include <linux/netdevice.h> |
| 39 | 39 | ||
| 40 | #include <rdma/ib_verbs.h> | ||
| 41 | |||
| 40 | extern struct _ddebug __start___verbose[]; | 42 | extern struct _ddebug __start___verbose[]; |
| 41 | extern struct _ddebug __stop___verbose[]; | 43 | extern struct _ddebug __stop___verbose[]; |
| 42 | 44 | ||
| @@ -636,6 +638,41 @@ EXPORT_SYMBOL(__dynamic_netdev_dbg); | |||
| 636 | 638 | ||
| 637 | #endif | 639 | #endif |
| 638 | 640 | ||
| 641 | #if IS_ENABLED(CONFIG_INFINIBAND) | ||
| 642 | |||
| 643 | void __dynamic_ibdev_dbg(struct _ddebug *descriptor, | ||
| 644 | const struct ib_device *ibdev, const char *fmt, ...) | ||
| 645 | { | ||
| 646 | struct va_format vaf; | ||
| 647 | va_list args; | ||
| 648 | |||
| 649 | va_start(args, fmt); | ||
| 650 | |||
| 651 | vaf.fmt = fmt; | ||
| 652 | vaf.va = &args; | ||
| 653 | |||
| 654 | if (ibdev && ibdev->dev.parent) { | ||
| 655 | char buf[PREFIX_SIZE]; | ||
| 656 | |||
| 657 | dev_printk_emit(LOGLEVEL_DEBUG, ibdev->dev.parent, | ||
| 658 | "%s%s %s %s: %pV", | ||
| 659 | dynamic_emit_prefix(descriptor, buf), | ||
| 660 | dev_driver_string(ibdev->dev.parent), | ||
| 661 | dev_name(ibdev->dev.parent), | ||
| 662 | dev_name(&ibdev->dev), | ||
| 663 | &vaf); | ||
| 664 | } else if (ibdev) { | ||
| 665 | printk(KERN_DEBUG "%s: %pV", dev_name(&ibdev->dev), &vaf); | ||
| 666 | } else { | ||
| 667 | printk(KERN_DEBUG "(NULL ib_device): %pV", &vaf); | ||
| 668 | } | ||
| 669 | |||
| 670 | va_end(args); | ||
| 671 | } | ||
| 672 | EXPORT_SYMBOL(__dynamic_ibdev_dbg); | ||
| 673 | |||
| 674 | #endif | ||
| 675 | |||
| 639 | #define DDEBUG_STRING_SIZE 1024 | 676 | #define DDEBUG_STRING_SIZE 1024 |
| 640 | static __initdata char ddebug_setup_string[DDEBUG_STRING_SIZE]; | 677 | static __initdata char ddebug_setup_string[DDEBUG_STRING_SIZE]; |
| 641 | 678 | ||
