diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-11 22:15:55 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-11 22:15:55 +0200 |
commit | 989aa44a5f215427085ccfe65c1e378e3399c9eb (patch) | |
tree | cd1993f2187e17e0e8d46d4fe12848e7be21fe96 /drivers/char | |
parent | Merge branch 'core-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/... (diff) | |
parent | debug lockups: Improve lockup detection, fix generic arch fallback (diff) | |
download | linux-989aa44a5f215427085ccfe65c1e378e3399c9eb.tar.xz linux-989aa44a5f215427085ccfe65c1e378e3399c9eb.zip |
Merge branch 'core-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
debug lockups: Improve lockup detection, fix generic arch fallback
debug lockups: Improve lockup detection
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/sysrq.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 5d7a02f63e1c..50eecfe1d724 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c @@ -24,6 +24,7 @@ #include <linux/sysrq.h> #include <linux/kbd_kern.h> #include <linux/proc_fs.h> +#include <linux/nmi.h> #include <linux/quotaops.h> #include <linux/perf_counter.h> #include <linux/kernel.h> @@ -222,12 +223,20 @@ static DECLARE_WORK(sysrq_showallcpus, sysrq_showregs_othercpus); static void sysrq_handle_showallcpus(int key, struct tty_struct *tty) { - struct pt_regs *regs = get_irq_regs(); - if (regs) { - printk(KERN_INFO "CPU%d:\n", smp_processor_id()); - show_regs(regs); + /* + * Fall back to the workqueue based printing if the + * backtrace printing did not succeed or the + * architecture has no support for it: + */ + if (!trigger_all_cpu_backtrace()) { + struct pt_regs *regs = get_irq_regs(); + + if (regs) { + printk(KERN_INFO "CPU%d:\n", smp_processor_id()); + show_regs(regs); + } + schedule_work(&sysrq_showallcpus); } - schedule_work(&sysrq_showallcpus); } static struct sysrq_key_op sysrq_showallcpus_op = { |