diff options
author | Namhyung Kim <namhyung@gmail.com> | 2011-03-23 22:42:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-03-24 03:36:10 -0400 |
commit | 0f77a8d378254f27df4a114a5da67223af1fe93f (patch) | |
tree | edc37c211adce744100d4776e4a28fb868c8b3c0 /include/linux/kallsyms.h | |
parent | dec2960827c85253d76938dbfa909df3be34958b (diff) |
vsprintf: Introduce %pB format specifier
The %pB format specifier is for stack backtrace. Its handler
sprint_backtrace() does symbol lookup using (address-1) to
ensure the address will not point outside of the function.
If there is a tail-call to the function marked "noreturn",
gcc optimized out the code after the call then causes saved
return address points outside of the function (i.e. the start
of the next function), so pollutes call trace somewhat.
This patch adds the %pB printk mechanism that allows architecture
call-trace printout functions to improve backtrace printouts.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-arch@vger.kernel.org
LKML-Reference: <1300934550-21394-1-git-send-email-namhyung@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/kallsyms.h')
-rw-r--r-- | include/linux/kallsyms.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index d8e9b3d1c23c..0df513b7a9f8 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
@@ -36,6 +36,7 @@ const char *kallsyms_lookup(unsigned long addr, | |||
36 | 36 | ||
37 | /* Look up a kernel symbol and return it in a text buffer. */ | 37 | /* Look up a kernel symbol and return it in a text buffer. */ |
38 | extern int sprint_symbol(char *buffer, unsigned long address); | 38 | extern int sprint_symbol(char *buffer, unsigned long address); |
39 | extern int sprint_backtrace(char *buffer, unsigned long address); | ||
39 | 40 | ||
40 | /* Look up a kernel symbol and print it to the kernel messages. */ | 41 | /* Look up a kernel symbol and print it to the kernel messages. */ |
41 | extern void __print_symbol(const char *fmt, unsigned long address); | 42 | extern void __print_symbol(const char *fmt, unsigned long address); |
@@ -79,6 +80,12 @@ static inline int sprint_symbol(char *buffer, unsigned long addr) | |||
79 | return 0; | 80 | return 0; |
80 | } | 81 | } |
81 | 82 | ||
83 | static inline int sprint_backtrace(char *buffer, unsigned long addr) | ||
84 | { | ||
85 | *buffer = '\0'; | ||
86 | return 0; | ||
87 | } | ||
88 | |||
82 | static inline int lookup_symbol_name(unsigned long addr, char *symname) | 89 | static inline int lookup_symbol_name(unsigned long addr, char *symname) |
83 | { | 90 | { |
84 | return -ERANGE; | 91 | return -ERANGE; |