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 <[email protected]>
Signed-off-by: Jason Wessel <[email protected]>
Acked-by: Andrew Morton <[email protected]>
This commit is contained in:
Jason Wessel 2010-05-20 21:04:27 -05:00
commit d37d39ae3b
5 changed files with 38 additions and 4 deletions

View file

@ -33,6 +33,7 @@
#include <linux/bootmem.h>
#include <linux/syscalls.h>
#include <linux/kexec.h>
#include <linux/kdb.h>
#include <linux/ratelimit.h>
#include <linux/kmsg_dump.h>
#include <linux/syslog.h>
@ -602,6 +603,14 @@ asmlinkage int printk(const char *fmt, ...)
va_list args;
int r;
#ifdef CONFIG_KGDB_KDB
if (unlikely(kdb_trap_printk)) {
va_start(args, fmt);
r = vkdb_printf(fmt, args);
va_end(args);
return r;
}
#endif
va_start(args, fmt);
r = vprintk(fmt, args);
va_end(args);