lkml.org 
[lkml]   [2006]   [Jan]   [17]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    DateTue, 17 Jan 2006 19:14:22 +0900
    Subject[PATCH 1/4] makes print_symbol() return int
    From(Akinobu Mita)
    Use print_symbol() to dump call trace on x86-64.
    
    Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
    ----
     traps.c |   29 +++++++----------------------
     1 files changed, 7 insertions(+), 22 deletions(-)
    --- 2.6-git/arch/x86_64/kernel/traps.c.orig	2006-01-16 22:05:38.000000000 +0900
    +++ 2.6-git/arch/x86_64/kernel/traps.c	2006-01-16 22:07:36.000000000 +0900
    @@ -30,6 +30,7 @@
     #include <linux/moduleparam.h>
     #include <linux/nmi.h>
     #include <linux/kprobes.h>
    +#include <linux/kallsyms.h> 
     
     #include <asm/system.h>
     #include <asm/uaccess.h>
    @@ -92,30 +93,14 @@ static inline void conditional_sti(struc
     
     static int kstack_depth_to_print = 10;
     
    -#ifdef CONFIG_KALLSYMS
    -#include <linux/kallsyms.h> 
    -int 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); 
    -} 
    -#else
     int printk_address(unsigned long address)
     { 
    -	return printk("[<%016lx>]", address);
    -} 
    -#endif
    +	int len;
    +
    +	len = printk("<%016lx>", address);
    +	len += print_symbol(" %s", address);
    +	return len;
    +}
     
     static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
     					unsigned *usedp, const char **idp)
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    
    \
     
     \ /
      Last update: 2006-01-17 11:16    [from the cache]
    ©2003-2008