From: Heiko Carstens Date: Mon, 3 Jul 2006 07:24:25 +0000 (-0700) Subject: [PATCH] lockdep: add print_ip_sym() X-Git-Tag: v2.6.18-rc1~117 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d8fdf5c76816e5263073008f03f097ffc713db3;p=linux-2.6 [PATCH] lockdep: add print_ip_sym() Provide a common print_ip_sym() function that prints the passed instruction pointer as well as the symbol belonging to it. Avoids adding a bunch of #ifdef CONFIG_64BIT in order to get the printk format right on 32/64 bit platforms. Acked-by: Ingo Molnar Cc: Arjan van de Ven Signed-off-by: Heiko Carstens Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index ad71ac053d..849043ce4e 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h @@ -64,4 +64,18 @@ static inline void print_symbol(const char *fmt, unsigned long addr) __builtin_extract_return_addr((void *)addr)); } +#ifndef CONFIG_64BIT +#define print_ip_sym(ip) \ +do { \ + printk("[<%08lx>]", ip); \ + print_symbol(" %s\n", ip); \ +} while(0) +#else +#define print_ip_sym(ip) \ +do { \ + printk("[<%016lx>]", ip); \ + print_symbol(" %s\n", ip); \ +} while(0) +#endif + #endif /*_LINUX_KALLSYMS_H*/