[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240926010536.5fe73463@rorschach.local.home>
Date: Thu, 26 Sep 2024 01:05:36 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Tatsuya S <tatsuya.s2862@...il.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH] ftrace: Hide a extra entry in stack trace
On Mon, 23 Sep 2024 12:59:15 +0900
Tatsuya S <tatsuya.s2862@...il.com> wrote:
> A extra entry is shown on stack trace(CONFIG_UNWINDER_ORC=y).
>
> [003] ..... 110.171589: vfs_write <-__x64_sys_write
> [003] ..... 110.171600: <stack trace>
> => XXXXXXXXX (Wrong function name)
> => vfs_write
> => __x64_sys_write
> => do_syscall_64
> => entry_SYSCALL_64_after_hwframe
>
> To resolve this, increment skip in __ftrace_trace_stack().
> The reason why skip is incremented in __ftrace_trace_stack()
> is because __ftrace_trace_stack() in stack trace is the only function
> that wasn't skipped from anywhere.
>
> Signed-off-by: Tatsuya S <tatsuya.s2862@...il.com>
> ---
> kernel/trace/trace.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index c3b2c7dfadef..e0d98621ff23 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -2919,6 +2919,8 @@ static void __ftrace_trace_stack(struct trace_buffer *buffer,
> #ifndef CONFIG_UNWINDER_ORC
> if (!regs)
> skip++;
> +#else
> + skip++;
> #endif
The above #ifdef block should be removed and replaced with;
if (IS_ENABLED(CONFIG_UNWINDER_ORC) || !regs)
skip++;
>
> preempt_disable_notrace();
-- Steve
Powered by blists - more mailing lists