powerpc/frace: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack

The structure of the ret_stack array on the task struct is going to
change, and accessing it directly via the curr_ret_stack index will no
longer give the ret_stack entry that holds the return address. To access
that, architectures must now use ftrace_graph_get_ret_stack() to get the
associated ret_stack that matches the saved return address.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Acked-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent d2a68c4e
...@@ -2061,9 +2061,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack) ...@@ -2061,9 +2061,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
int count = 0; int count = 0;
int firstframe = 1; int firstframe = 1;
#ifdef CONFIG_FUNCTION_GRAPH_TRACER #ifdef CONFIG_FUNCTION_GRAPH_TRACER
int curr_frame = current->curr_ret_stack; struct ftrace_ret_stack *ret_stack;
extern void return_to_handler(void); extern void return_to_handler(void);
unsigned long rth = (unsigned long)return_to_handler; unsigned long rth = (unsigned long)return_to_handler;
int curr_frame = 0;
#endif #endif
sp = (unsigned long) stack; sp = (unsigned long) stack;
...@@ -2089,9 +2090,13 @@ void show_stack(struct task_struct *tsk, unsigned long *stack) ...@@ -2089,9 +2090,13 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
printk("["REG"] ["REG"] %pS", sp, ip, (void *)ip); printk("["REG"] ["REG"] %pS", sp, ip, (void *)ip);
#ifdef CONFIG_FUNCTION_GRAPH_TRACER #ifdef CONFIG_FUNCTION_GRAPH_TRACER
if ((ip == rth) && curr_frame >= 0) { if ((ip == rth) && curr_frame >= 0) {
pr_cont(" (%pS)", ret_stack = ftrace_graph_get_ret_stack(current,
(void *)current->ret_stack[curr_frame].ret); curr_frame++);
curr_frame--; if (ret_stack)
pr_cont(" (%pS)",
(void *)ret_stack->ret);
else
curr_frame = -1;
} }
#endif #endif
if (firstframe) if (firstframe)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment