Re: [PATCH] ftrace: make ftrace_location() more accurate
From: Steven Rostedt
Date: Tue Apr 15 2025 - 07:45:07 EST
On Tue, 15 Apr 2025 19:27:50 +0800
Jin Guo <menglong8.dong@xxxxxxxxx> wrote:
> The function ftrace_location is used to lookup the ftrace location with an
> ip. However, the result that it returns can be wrong in some case.
>
> Let's image that we have the following kallsyms:
>
> ffffffff812c35f0 T sys_ni_syscall
> ffffffff812c38b0 W __pfx___x64_sys_io_pgetevents_time32
> ffffffff812c38c0 W __x64_sys_io_pgetevents_time32
Have you tried the latest kernel? because on x86, weak functions that are
not used should no longer be in the ftrace table. That is, you should never
see __ftrace_invalid_addres_* anymore.
See https://lore.kernel.org/all/20250218195918.255228630@xxxxxxxxxxx/
That was just added this merge window, which would make your patch obsolete.
-- Steve