aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/dynamic_debug.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 75ca78f3a8c9..63b6f95ac552 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -30,6 +30,7 @@
30#include <linux/jump_label.h> 30#include <linux/jump_label.h>
31#include <linux/hardirq.h> 31#include <linux/hardirq.h>
32#include <linux/sched.h> 32#include <linux/sched.h>
33#include <linux/device.h>
33 34
34extern struct _ddebug __start___verbose[]; 35extern struct _ddebug __start___verbose[];
35extern struct _ddebug __stop___verbose[]; 36extern struct _ddebug __stop___verbose[];
@@ -456,6 +457,43 @@ int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
456} 457}
457EXPORT_SYMBOL(__dynamic_pr_debug); 458EXPORT_SYMBOL(__dynamic_pr_debug);
458 459
460int __dynamic_dev_dbg(struct _ddebug *descriptor,
461 const struct device *dev, const char *fmt, ...)
462{
463 struct va_format vaf;
464 va_list args;
465 int res;
466
467 BUG_ON(!descriptor);
468 BUG_ON(!fmt);
469
470 va_start(args, fmt);
471
472 vaf.fmt = fmt;
473 vaf.va = &args;
474
475 res = printk(KERN_DEBUG);
476 if (descriptor->flags & _DPRINTK_FLAGS_INCL_TID) {
477 if (in_interrupt())
478 res += printk(KERN_CONT "<intr> ");
479 else
480 res += printk(KERN_CONT "[%d] ", task_pid_vnr(current));
481 }
482 if (descriptor->flags & _DPRINTK_FLAGS_INCL_MODNAME)
483 res += printk(KERN_CONT "%s:", descriptor->modname);
484 if (descriptor->flags & _DPRINTK_FLAGS_INCL_FUNCNAME)
485 res += printk(KERN_CONT "%s:", descriptor->function);
486 if (descriptor->flags & _DPRINTK_FLAGS_INCL_LINENO)
487 res += printk(KERN_CONT "%d ", descriptor->lineno);
488
489 res += __dev_printk(KERN_CONT, dev, &vaf);
490
491 va_end(args);
492
493 return res;
494}
495EXPORT_SYMBOL(__dynamic_dev_dbg);
496
459static __initdata char ddebug_setup_string[1024]; 497static __initdata char ddebug_setup_string[1024];
460static __init int ddebug_setup_query(char *str) 498static __init int ddebug_setup_query(char *str)
461{ 499{