Re: [BUG] tracing: dynamic ftrace selftest detected failures

Steven Rostedt
2024-08-20T13:56:15Z

On Tue, 20 Aug 2024 11:48:07 +0100
Mark Rutland <mark.rutland@arm.com> wrote:

> > I found the target function already has "noinline". I tried to add noinline
> > to the testing function (callsite), but it also did not work.
> > I think "noinline" is for the compiler, but LTO is done by the linker.
>
> If LTO is breaking noinline, then that has much larger implications for
> noinstr code and similar, and means that LTO is unsound...

Hmm, doesn't noinstr place the code in a separate section?

I wonder if we create a separate section for the test function that LTO is
inlining, if it will prevent it from being inlined. That is, noinline tells
the compiler not to inline, but LTO happens after the compiler is done and
may inline functions in the same section. But the linker does see separate
sections and I don't think it will try to inline that code into another
section. But I could be wrong. ;-)

-- Steve