diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 14:08:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 14:08:05 -0400 |
commit | 90b9a32d8f441369b2f97a765d2d957b531eb653 (patch) | |
tree | 3146d251a983ba12226e75c121613de6f051af8b /kernel/printk.c | |
parent | 8b108c609adefd98577c35f0a41497a610041a6c (diff) | |
parent | 4402c153cb9c549cd21d6007ef0dfac50c8d148d (diff) |
Merge branch 'kdb-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
* 'kdb-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb: (25 commits)
kdb,debug_core: Allow the debug core to receive a panic notification
MAINTAINERS: update kgdb, kdb, and debug_core info
debug_core,kdb: Allow the debug core to process a recursive debug entry
printk,kdb: capture printk() when in kdb shell
kgdboc,kdb: Allow kdb to work on a non open console port
kgdb: Add the ability to schedule a breakpoint via a tasklet
mips,kgdb: kdb low level trap catch and stack trace
powerpc,kgdb: Introduce low level trap catching
x86,kgdb: Add low level debug hook
kgdb: remove post_primary_code references
kgdb,docs: Update the kgdb docs to include kdb
kgdboc,keyboard: Keyboard driver for kdb with kgdb
kgdb: gdb "monitor" -> kdb passthrough
sparc,sunzilog: Add console polling support for sunzilog serial driver
sh,sh-sci: Use NO_POLL_CHAR in the SCIF polled console code
kgdb,8250,pl011: Return immediately from console poll
kgdb: core changes to support kdb
kdb: core for kgdb back end (2 of 2)
kdb: core for kgdb back end (1 of 2)
kgdb,blackfin: Add in kgdb_arch_set_pc for blackfin
...
Diffstat (limited to 'kernel/printk.c')
-rw-r--r-- | kernel/printk.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 75077ad0b537..444b770c9595 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> |
@@ -413,6 +414,22 @@ SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) | |||
413 | return do_syslog(type, buf, len, SYSLOG_FROM_CALL); | 414 | return do_syslog(type, buf, len, SYSLOG_FROM_CALL); |
414 | } | 415 | } |
415 | 416 | ||
417 | #ifdef CONFIG_KGDB_KDB | ||
418 | /* kdb dmesg command needs access to the syslog buffer. do_syslog() | ||
419 | * uses locks so it cannot be used during debugging. Just tell kdb | ||
420 | * where the start and end of the physical and logical logs are. This | ||
421 | * is equivalent to do_syslog(3). | ||
422 | */ | ||
423 | void kdb_syslog_data(char *syslog_data[4]) | ||
424 | { | ||
425 | syslog_data[0] = log_buf; | ||
426 | syslog_data[1] = log_buf + log_buf_len; | ||
427 | syslog_data[2] = log_buf + log_end - | ||
428 | (logged_chars < log_buf_len ? logged_chars : log_buf_len); | ||
429 | syslog_data[3] = log_buf + log_end; | ||
430 | } | ||
431 | #endif /* CONFIG_KGDB_KDB */ | ||
432 | |||
416 | /* | 433 | /* |
417 | * Call the console drivers on a range of log_buf | 434 | * Call the console drivers on a range of log_buf |
418 | */ | 435 | */ |
@@ -586,6 +603,14 @@ asmlinkage int printk(const char *fmt, ...) | |||
586 | va_list args; | 603 | va_list args; |
587 | int r; | 604 | int r; |
588 | 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 | ||
589 | va_start(args, fmt); | 614 | va_start(args, fmt); |
590 | r = vprintk(fmt, args); | 615 | r = vprintk(fmt, args); |
591 | va_end(args); | 616 | va_end(args); |