diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-29 09:07:15 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-29 09:07:15 -0700 |
commit | 0d43f5123d1456669b3bbc69854faf6fd5b14caa (patch) | |
tree | e69d4418d579e55a004c2263ac49a46aac161a54 /arch/sh/kernel/dwarf.c | |
parent | fb3165b59f9ce510fed07262db20fdb799f88fa6 (diff) | |
parent | ffb4a73d8906f71910e6c83ec2b499e70025ee8e (diff) | |
download | linux-0d43f5123d1456669b3bbc69854faf6fd5b14caa.tar.gz linux-0d43f5123d1456669b3bbc69854faf6fd5b14caa.tar.bz2 linux-0d43f5123d1456669b3bbc69854faf6fd5b14caa.zip |
Merge branch 'sh/for-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* 'sh/for-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
sh: Fix hugetlbfs dependencies for SH-3 && MMU configurations.
sh: Document uImage.bin target in archhelp.
sh: add uImage.bin target
sh: rsk7203 CONFIG_MTD=n fix
sh: Check for return_to_handler when unwinding the stack
sh: Build fix: define more __movmem* symbols
sh: __irq_entry annotate do_IRQ().
Fix up sh/powerpc conflicts in fs/Kconfig
Diffstat (limited to 'arch/sh/kernel/dwarf.c')
-rw-r--r-- | arch/sh/kernel/dwarf.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c index 03b3616c80a5..2d07084e4882 100644 --- a/arch/sh/kernel/dwarf.c +++ b/arch/sh/kernel/dwarf.c @@ -20,6 +20,7 @@ #include <linux/list.h> #include <linux/mempool.h> #include <linux/mm.h> +#include <linux/ftrace.h> #include <asm/dwarf.h> #include <asm/unwinder.h> #include <asm/sections.h> @@ -557,6 +558,27 @@ struct dwarf_frame * dwarf_unwind_stack(unsigned long pc, if (!pc && !prev) pc = (unsigned long)current_text_addr(); +#ifdef CONFIG_FUNCTION_GRAPH_TRACER + /* + * If our stack has been patched by the function graph tracer + * then we might see the address of return_to_handler() where we + * expected to find the real return address. + */ + if (pc == (unsigned long)&return_to_handler) { + int index = current->curr_ret_stack; + + /* + * We currently have no way of tracking how many + * return_to_handler()'s we've seen. If there is more + * than one patched return address on our stack, + * complain loudly. + */ + WARN_ON(index > 0); + + pc = current->ret_stack[index].ret; + } +#endif + frame = mempool_alloc(dwarf_frame_pool, GFP_ATOMIC); if (!frame) { printk(KERN_ERR "Unable to allocate a dwarf frame\n"); |