mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] csky: stacktrace: fix usage of ftrace_graph_ret_addr()
@ 2024-06-19  7:31 Puranjay Mohan
  2024-06-23 16:43 ` Guo Ren
  0 siblings, 1 reply; 2+ messages in thread
From: Puranjay Mohan @ 2024-06-19  7:31 UTC (permalink / raw)
  To: Guo Ren, Steven Rostedt, linux-csky, linux-kernel; +Cc: puranjay12

ftrace_graph_ret_addr() now returns the passed in return address when NULL
is passed for the 'idx' paramenter. This breaks the current usage in csky's
walk_stackframe()

Fix this by passing a valid integer pointer to ftrace_graph_ret_addr()

Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
---
 arch/csky/kernel/stacktrace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/csky/kernel/stacktrace.c b/arch/csky/kernel/stacktrace.c
index 27ecd63e321b..1d72f18064c2 100644
--- a/arch/csky/kernel/stacktrace.c
+++ b/arch/csky/kernel/stacktrace.c
@@ -17,6 +17,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
 			     bool (*fn)(unsigned long, void *), void *arg)
 {
 	unsigned long fp, sp, pc;
+	int graph_idx = 0;
 
 	if (regs) {
 		fp = frame_pointer(regs);
@@ -50,7 +51,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
 		frame = (struct stackframe *)fp;
 		sp = fp;
 		fp = frame->fp;
-		pc = ftrace_graph_ret_addr(current, NULL, frame->ra,
+		pc = ftrace_graph_ret_addr(current, &graph_idx, frame->ra,
 					   (unsigned long *)(fp - 8));
 	}
 }
-- 
2.40.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] csky: stacktrace: fix usage of ftrace_graph_ret_addr()
  2024-06-19  7:31 [PATCH] csky: stacktrace: fix usage of ftrace_graph_ret_addr() Puranjay Mohan
@ 2024-06-23 16:43 ` Guo Ren
  0 siblings, 0 replies; 2+ messages in thread
From: Guo Ren @ 2024-06-23 16:43 UTC (permalink / raw)
  To: Puranjay Mohan; +Cc: Steven Rostedt, linux-csky, linux-kernel, puranjay12

On Wed, Jun 19, 2024 at 3:31 PM Puranjay Mohan <puranjay@kernel.org> wrote:
>
> ftrace_graph_ret_addr() now returns the passed in return address when NULL
> is passed for the 'idx' paramenter. This breaks the current usage in csky's
> walk_stackframe()
>
> Fix this by passing a valid integer pointer to ftrace_graph_ret_addr()
>
> Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
LGTM, Thx!

Reviewed-by: Guo Ren <guoren@kernel.org>

> ---
>  arch/csky/kernel/stacktrace.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/csky/kernel/stacktrace.c b/arch/csky/kernel/stacktrace.c
> index 27ecd63e321b..1d72f18064c2 100644
> --- a/arch/csky/kernel/stacktrace.c
> +++ b/arch/csky/kernel/stacktrace.c
> @@ -17,6 +17,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
>                              bool (*fn)(unsigned long, void *), void *arg)
>  {
>         unsigned long fp, sp, pc;
> +       int graph_idx = 0;
>
>         if (regs) {
>                 fp = frame_pointer(regs);
> @@ -50,7 +51,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
>                 frame = (struct stackframe *)fp;
>                 sp = fp;
>                 fp = frame->fp;
> -               pc = ftrace_graph_ret_addr(current, NULL, frame->ra,
> +               pc = ftrace_graph_ret_addr(current, &graph_idx, frame->ra,
>                                            (unsigned long *)(fp - 8));
>         }
>  }
> --
> 2.40.1
>


-- 
Best Regards
 Guo Ren

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-23 16:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-19  7:31 [PATCH] csky: stacktrace: fix usage of ftrace_graph_ret_addr() Puranjay Mohan
2024-06-23 16:43 ` Guo Ren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome