Re: [RFC] ftrace: Add support to keep some functions out of ftrace

From: Steven Rostedt
Date: Mon Aug 15 2022 - 12:09:02 EST


On Mon, 15 Aug 2022 08:49:11 -0700
Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote:

> > > The whole problem is that it isn't a notrace function and you're abusing
> > > a __fentry__ site.
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?h=x86/fineibt&id=8d075bdf11193f1d276bf19fa56b4b8dfe24df9e
>
> Brand new stuff.
> Awesome. That should fit perfectly.
>
> > foo.c:
> >
> > __attribute__((__no_instrument_function__))
> > __attribute__((patchable_function_entry(5)))
>
> Interesting. Didn't know about this attribute.
>
> > void my_func(void)
> > {
> > }
> >
> > void my_foo(void)
> > {
> > }
>
> Great.
> Jiri, could you please revise your patch with this approach?

This is the exact result I was looking for. Something we can all agree to.

The point being, include others when developing code that is similar to
what other subsystems do. On the code modification front, please Cc the
ftrace, kprobe, static_call and jump_label maintainers, as we like to work
together. The BPF dispatcher modifications should be no different. There's
a lot of experience in this field throughout the kernel. Please utilize it.
If it wasn't for this thread, we would never had found out about this easy
solution.

-- Steve