Re: [RFC PATCH v2 0/3] disable optimistic spinning for ftrace_lock

From: Google

Date: Thu Mar 12 2026 - 04:09:02 EST


Hi,

On Wed, 11 Mar 2026 21:40:32 +0800
Yafang Shao <laoar.shao@xxxxxxxxx> wrote:

> > Although there is a bigger issue of why on earth the code is reading the
> > list of filter functions at all - never mind all the time.
>
> bpftrace reads the complete list of available functions into
> userspace, then performs matching against the target function to
> determine if it is traceable.

What about changing bpftrace userspace tool to cache the list of available
functions? (or just add an option to pass available function list?)
Then, you can just copy the function list somewhere and uses it.

Of course we can do the same thing in the kernel, but I don't think
there is any reason to do it in the kernel instead of user space.

Thank you,

>
> > I'll do it by hand when debugging, but I'd have though anything using bpf
> > will know exactly where to add its hooks.
>
>
> --
> Regards
> Yafang


--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>