* [for-next][PATCH 05/24] powerpc/frace: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack
[not found] <20181221175618.968519903@goodmis.org>
@ 2018-12-21 17:56 ` Steven Rostedt
2018-12-22 9:51 ` Michael Ellerman
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2018-12-21 17:56 UTC (permalink / raw)
To: linux-kernel
Cc: Paul Mackerras, Masami Hiramatsu, Namhyung Kim, Andrew Morton,
linuxppc-dev, Ingo Molnar
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
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: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
arch/powerpc/kernel/process.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 96f34730010f..ce393df243aa 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -2061,9 +2061,10 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
int count = 0;
int firstframe = 1;
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
- int curr_frame = current->curr_ret_stack;
+ struct ftrace_ret_stack *ret_stack;
extern void return_to_handler(void);
unsigned long rth = (unsigned long)return_to_handler;
+ int curr_frame = 0;
#endif
sp = (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);
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
if ((ip == rth) && curr_frame >= 0) {
- pr_cont(" (%pS)",
- (void *)current->ret_stack[curr_frame].ret);
- curr_frame--;
+ ret_stack = ftrace_graph_get_ret_stack(current,
+ curr_frame++);
+ if (ret_stack)
+ pr_cont(" (%pS)",
+ (void *)ret_stack->ret);
+ else
+ curr_frame = -1;
}
#endif
if (firstframe)
--
2.19.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [for-next][PATCH 05/24] powerpc/frace: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack
2018-12-21 17:56 ` [for-next][PATCH 05/24] powerpc/frace: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack Steven Rostedt
@ 2018-12-22 9:51 ` Michael Ellerman
2018-12-22 12:24 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2018-12-22 9:51 UTC (permalink / raw)
To: Steven Rostedt, linux-kernel
Cc: Paul Mackerras, Masami Hiramatsu, Namhyung Kim, Andrew Morton,
linuxppc-dev, Ingo Molnar
Steven Rostedt <rostedt@goodmis.org> writes:
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
>
> 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: Michael Ellerman <mpe@ellerman.id.au>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
> arch/powerpc/kernel/process.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
I did test the previous series you posted and I think everything was OK
running the ftracetest suite (I got one or two fails but I think that
was because of missing CONFIG options).
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [for-next][PATCH 05/24] powerpc/frace: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack
2018-12-22 9:51 ` Michael Ellerman
@ 2018-12-22 12:24 ` Steven Rostedt
0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2018-12-22 12:24 UTC (permalink / raw)
To: Michael Ellerman
Cc: linux-kernel, Paul Mackerras, Masami Hiramatsu, Namhyung Kim,
Andrew Morton, linuxppc-dev, Ingo Molnar
On Sat, 22 Dec 2018 20:51:21 +1100
Michael Ellerman <mpe@ellerman.id.au> wrote:
> I did test the previous series you posted and I think everything was OK
> running the ftracetest suite (I got one or two fails but I think that
> was because of missing CONFIG options).
>
> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Thanks! I'll add your ack.
-- Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-12-22 12:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20181221175618.968519903@goodmis.org>
2018-12-21 17:56 ` [for-next][PATCH 05/24] powerpc/frace: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack Steven Rostedt
2018-12-22 9:51 ` Michael Ellerman
2018-12-22 12:24 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).