Commit 452d3ad9 authored by Paolo \'Blaisorblade\' Giarrusso's avatar Paolo \'Blaisorblade\' Giarrusso Committed by Linus Torvalds

[PATCH] uml: use kallsyms when dumping stack

This patch makes UML use print_symbol() when dumping the stack.  It is not yet
complete (the i386 version uses the frame pointers to walk the stack, for
instance), but should be at least enough.

Also, it uses bust_spinlock() when dumping errors to help them reach the
console.  This appears not to be enough - however I analyzed the UML console
code, and it seems that UML console don't get flushed *at all* when exiting.
Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e099b507
...@@ -14,23 +14,23 @@ ...@@ -14,23 +14,23 @@
void show_trace(unsigned long * stack) void show_trace(unsigned long * stack)
{ {
int i; /* XXX: Copy the CONFIG_FRAME_POINTER stack-walking backtrace from
* arch/i386/kernel/traps.c. */
unsigned long addr; unsigned long addr;
if (!stack) if (!stack)
stack = (unsigned long*) &stack; stack = (unsigned long*) &stack;
printk("Call Trace:\n"); printk("Call Trace: \n");
i = 1;
while (((long) stack & (THREAD_SIZE-1)) != 0) { while (((long) stack & (THREAD_SIZE-1)) != 0) {
addr = *stack++; addr = *stack++;
if (__kernel_text_address(addr)) { if (__kernel_text_address(addr)) {
printk("[<%08lx>] ", addr); printk(" [<%08lx>]", addr);
print_symbol("%s", addr); print_symbol(" %s", addr);
printk("\n"); printk("\n");
i++;
} }
} }
printk("\n");
} }
/* /*
...@@ -48,4 +48,3 @@ void show_stack(struct task_struct *task, unsigned long *sp) ...@@ -48,4 +48,3 @@ void show_stack(struct task_struct *task, unsigned long *sp)
{ {
show_trace(sp); show_trace(sp);
} }
...@@ -405,9 +405,9 @@ extern int uml_exitcode; ...@@ -405,9 +405,9 @@ extern int uml_exitcode;
static int panic_exit(struct notifier_block *self, unsigned long unused1, static int panic_exit(struct notifier_block *self, unsigned long unused1,
void *unused2) void *unused2)
{ {
#ifdef CONFIG_MAGIC_SYSRQ bust_spinlocks(1);
handle_sysrq('p', &current->thread.regs, NULL); show_regs(&(current->thread.regs));
#endif bust_spinlocks(0);
uml_exitcode = 1; uml_exitcode = 1;
machine_halt(); machine_halt();
return(0); return(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment