[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJF2gTRiHV0VmMd7uJHBDut5VeGbwXTr2c18wK-fH4_HZp_GUA@mail.gmail.com>
Date: Mon, 24 Jun 2024 00:43:21 +0800
From: Guo Ren <guoren@...nel.org>
To: Puranjay Mohan <puranjay@...nel.org>
Cc: Steven Rostedt <rostedt@...dmis.org>, linux-csky@...r.kernel.org,
linux-kernel@...r.kernel.org, puranjay12@...il.com
Subject: Re: [PATCH] csky: stacktrace: fix usage of ftrace_graph_ret_addr()
On Wed, Jun 19, 2024 at 3:31 PM Puranjay Mohan <puranjay@...nel.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@...nel.org>
LGTM, Thx!
Reviewed-by: Guo Ren <guoren@...nel.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
Powered by blists - more mailing lists