diff options
author | David S. Miller <davem@davemloft.net> | 2010-04-21 03:08:11 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-21 03:08:11 -0700 |
commit | 667f0cee3e0321151aa7a1a5222afe67ca4be0ea (patch) | |
tree | 5f4a7a5c228a21e893f95774ca95f9925abf4b1f /arch/sparc/kernel/traps_64.c | |
parent | 87e8f0e3e6d0b720a2462ebc5667eaa462752f74 (diff) | |
download | op-kernel-dev-667f0cee3e0321151aa7a1a5222afe67ca4be0ea.zip op-kernel-dev-667f0cee3e0321151aa7a1a5222afe67ca4be0ea.tar.gz |
sparc64: Fix stack dumping and tracing when function graph is enabled.
Like x86, when the function graph tracer is enabled, emit the ftrace
stub as well as the program counter it will be transformed back into.
We duplicate a lot of similar stack walking logic in 3 or 4 spots, so
eventually we should consolidate things like x86 does.
Thanks to Frederic Weisbecker for pointing this out.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/traps_64.c')
-rw-r--r-- | arch/sparc/kernel/traps_64.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c index 9da57f0..42ad2ba 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c @@ -17,6 +17,7 @@ #include <linux/mm.h> #include <linux/init.h> #include <linux/kdebug.h> +#include <linux/ftrace.h> #include <linux/gfp.h> #include <asm/smp.h> @@ -2154,6 +2155,9 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) unsigned long fp, thread_base, ksp; struct thread_info *tp; int count = 0; +#ifdef CONFIG_FUNCTION_GRAPH_TRACER + int graph = 0; +#endif ksp = (unsigned long) _ksp; if (!tsk) @@ -2193,6 +2197,16 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) } printk(" [%016lx] %pS\n", pc, (void *) pc); +#ifdef CONFIG_FUNCTION_GRAPH_TRACER + if ((pc + 8UL) == (unsigned long) &return_to_handler) { + int index = tsk->curr_ret_stack; + if (tsk->ret_stack && index >= graph) { + pc = tsk->ret_stack[index - graph].ret; + printk(" [%016lx] %pS\n", pc, (void *) pc); + graph++; + } + } +#endif } while (++count < 16); } |