aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2010-05-20 22:04:27 -0400
committerJason Wessel <jason.wessel@windriver.com>2010-05-20 22:04:27 -0400
commitd37d39ae3b4a8f9a21114921fb344fe7cadb1abd (patch)
tree2c20219725a12c343429758ec378b5c9d08b04bd /kernel/printk.c
parentefe2f29e324fd20e0449bcd6dc6dbe4734c2ba94 (diff)
printk,kdb: capture printk() when in kdb shell
Certain calls from the kdb shell will call out to printk(), and any of these calls should get vectored back to the kdb_printf() so that the kdb pager and processing can be used, as well as to properly channel I/O to the polled I/O devices. CC: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Acked-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index 9213b8b5bb4..444b770c959 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -33,6 +33,7 @@
33#include <linux/bootmem.h> 33#include <linux/bootmem.h>
34#include <linux/syscalls.h> 34#include <linux/syscalls.h>
35#include <linux/kexec.h> 35#include <linux/kexec.h>
36#include <linux/kdb.h>
36#include <linux/ratelimit.h> 37#include <linux/ratelimit.h>
37#include <linux/kmsg_dump.h> 38#include <linux/kmsg_dump.h>
38#include <linux/syslog.h> 39#include <linux/syslog.h>
@@ -602,6 +603,14 @@ asmlinkage int printk(const char *fmt, ...)
602 va_list args; 603 va_list args;
603 int r; 604 int r;
604 605
606#ifdef CONFIG_KGDB_KDB
607 if (unlikely(kdb_trap_printk)) {
608 va_start(args, fmt);
609 r = vkdb_printf(fmt, args);
610 va_end(args);
611 return r;
612 }
613#endif
605 va_start(args, fmt); 614 va_start(args, fmt);
606 r = vprintk(fmt, args); 615 r = vprintk(fmt, args);
607 va_end(args); 616 va_end(args);