Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158035
b: refs/heads/master
c: 47cab6a
h: refs/heads/master
i:
  158033: 74c90a1
  158031: 27d3111
v: v3
  • Loading branch information
Ingo Molnar committed Aug 3, 2009
1 parent 27354a9 commit 1243ffe
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c1dc0b9c0c8979ce4d411caadff5c0d79dee58bc
refs/heads/master: 47cab6a722d44c71c4f8224017ef548522243cf4
4 changes: 2 additions & 2 deletions trunk/arch/sparc/include/asm/irq_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ static inline unsigned long get_softint(void)
return retval;
}

void __trigger_all_cpu_backtrace(void);
#define trigger_all_cpu_backtrace() __trigger_all_cpu_backtrace()
void arch_trigger_all_cpu_backtrace(void);
#define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace

extern void *hardirq_stack[NR_CPUS];
extern void *softirq_stack[NR_CPUS];
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/sparc/kernel/process_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static void __global_reg_poll(struct global_reg_snapshot *gp)
}
}

void __trigger_all_cpu_backtrace(void)
void arch_trigger_all_cpu_backtrace(void)
{
struct thread_info *tp = current_thread_info();
struct pt_regs *regs = get_irq_regs();
Expand Down Expand Up @@ -304,7 +304,7 @@ void __trigger_all_cpu_backtrace(void)

static void sysrq_handle_globreg(int key, struct tty_struct *tty)
{
__trigger_all_cpu_backtrace();
arch_trigger_all_cpu_backtrace();
}

static struct sysrq_key_op sparc_globalreg_op = {
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/x86/include/asm/nmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ extern int proc_nmi_enabled(struct ctl_table *, int , struct file *,
void __user *, size_t *, loff_t *);
extern int unknown_nmi_panic;

void __trigger_all_cpu_backtrace(void);
#define trigger_all_cpu_backtrace() __trigger_all_cpu_backtrace()
void arch_trigger_all_cpu_backtrace(void);
#define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace

static inline void localise_nmi_watchdog(void)
{
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/apic/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ int do_nmi_callback(struct pt_regs *regs, int cpu)
return 0;
}

void __trigger_all_cpu_backtrace(void)
void arch_trigger_all_cpu_backtrace(void)
{
int i;

Expand Down
15 changes: 14 additions & 1 deletion trunk/drivers/char/sysrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,20 @@ static DECLARE_WORK(sysrq_showallcpus, sysrq_showregs_othercpus);

static void sysrq_handle_showallcpus(int key, struct tty_struct *tty)
{
trigger_all_cpu_backtrace();
/*
* 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);
}
}

static struct sysrq_key_op sysrq_showallcpus_op = {
Expand Down
19 changes: 17 additions & 2 deletions trunk/include/linux/nmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,23 @@ static inline void acpi_nmi_disable(void) { }
static inline void acpi_nmi_enable(void) { }
#endif

#ifndef trigger_all_cpu_backtrace
#define trigger_all_cpu_backtrace() do { } while (0)
/*
* Create trigger_all_cpu_backtrace() out of the arch-provided
* base function. Return whether such support was available,
* to allow calling code to fall back to some other mechanism:
*/
#ifdef arch_trigger_all_cpu_backtrace
static inline bool trigger_all_cpu_backtrace(void)
{
arch_trigger_all_cpu_backtrace();

return true;
}
#else
static inline bool trigger_all_cpu_backtrace(void)
{
return false;
}
#endif

#endif

0 comments on commit 1243ffe

Please sign in to comment.