Re: [PATCH] ftrace: make ftrace_location() more accurate

From: Menglong Dong
Date: Tue Apr 15 2025 - 21:48:21 EST


On Tue, Apr 15, 2025 at 7:45 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> 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.

Hi, Steve

you are right, I haven't updated my code in over a month, and
the latest kernel works fine.

>
> -- Steve