diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index 28d50dc..7598107 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -106,30 +107,11 @@ static inline void preempt_conditional_c static int kstack_depth_to_print = 10; -#ifdef CONFIG_KALLSYMS -#include -int printk_address(unsigned long address) +void printk_address(unsigned long address) { - unsigned long offset = 0, symsize; - const char *symname; - char *modname; - char *delim = ":"; - char namebuf[128]; - - symname = kallsyms_lookup(address, &symsize, &offset, &modname, namebuf); - if (!symname) - return printk("[<%016lx>]", address); - if (!modname) - modname = delim = ""; - return printk("<%016lx>{%s%s%s%s%+ld}", - address,delim,modname,delim,symname,offset); + printk(" [<%016lx>] ", address); + print_symbol("%s\n", address); } -#else -int printk_address(unsigned long address) -{ - return printk("[<%016lx>]", address); -} -#endif static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, unsigned *usedp, const char **idp) @@ -205,24 +187,23 @@ void show_trace(unsigned long *stack) printk("\nCall Trace:"); #define HANDLE_STACK(cond) \ - do while (cond) { \ - unsigned long addr = *stack++; \ - if (kernel_text_address(addr)) { \ - if (i > 50) { \ - printk("\n "); \ - i = 0; \ + do { \ + i = 0; \ + printk("\n"); \ + while (cond) { \ + unsigned long addr = *stack++; \ + if (kernel_text_address(addr)) { \ + /* \ + * If the address is either in the text segment \ + * of the kernel, or in the region which \ + * contains vmalloc'ed memory, it *may* be the \ + * address of a calling routine; if so, print it \ + * so that someone tracing down the cause of the \ + * crash will be able to figure out the call \ + * path that was taken. \ + */ \ + printk_address(addr); \ } \ - else \ - i += printk(" "); \ - /* \ - * If the address is either in the text segment of the \ - * kernel, or in the region which contains vmalloc'ed \ - * memory, it *may* be the address of a calling \ - * routine; if so, print it so that someone tracing \ - * down the cause of the crash will be able to figure \ - * out the call path that was taken. \ - */ \ - i += printk_address(addr); \ } \ } while (0) diff --git a/include/asm-x86_64/kdebug.h b/include/asm-x86_64/kdebug.h index b9ed4c0..72f5261 100644 --- a/include/asm-x86_64/kdebug.h +++ b/include/asm-x86_64/kdebug.h @@ -48,7 +48,7 @@ static inline int notify_die(enum die_va return notifier_call_chain(&die_chain, val, &args); } -extern int printk_address(unsigned long address); +extern void printk_address(unsigned long address); extern void die(const char *,struct pt_regs *,long); extern void __die(const char *,struct pt_regs *,long); extern void show_registers(struct pt_regs *regs);