Re: [PATCH v2] ftrace: Fix stack trace entry generated by ftrace_pid_func()

From: Steven Rostedt
Date: Mon May 27 2024 - 19:49:24 EST


On Mon, 27 May 2024 18:44:56 +0900
Tatsuya S <tatsuya.s2862@xxxxxxxxx> wrote:

> On setting set_ftrace_pid, a extra entry generated by ftrace_pid_func()
> is shown on stack trace(CONFIG_UNWINDER_FRAME_POINTER=y).
>
> [004] ..... 68.459382: <stack trace>
> => 0xffffffffa00090af
> => ksys_read
> => __x64_sys_read
> => x64_sys_call
> => do_syscall_64
> => entry_SYSCALL_64_after_hwframe
>
> To resolve this issue, increment skip count
> in function_stack_trace_call() if pids are set.

Just a note, this isn't a "fix" but simply an improvement in output.
I'm happy to take this (after testing and more reviewing), but it will
be for the next merge window, and with a different subject line.

"ftrace: Hide one more entry in stack trace when ftrace_pid is enabled"

Or something like that.

Thanks,

-- Steve