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

From: Google
Date: Tue Aug 20 2024 - 20:15:13 EST


On Tue, 20 Aug 2024 19:49:14 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> On Wed, 21 Aug 2024 08:43:51 +0900
> Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:
>
> > > Can you add the __used and see if it fixes it?
> >
> > Adding __used to DYN_FTRACE_TEST_NAME() and DYN_FTRACE_TEST_NAME2() does
> > not change, the test still fails.
>
> OK, now that sounds like a bug in LTO itself.

Hmm, I think __used just preserve the function exists as a function. But the
callsite can be optimized. This mean the __used function code is duplicated,
and embedded one copy in the callsite, but keep another copy as a function
which can be used from outside. But "noinline" attribute seems to be expected
not embedded in the callsite (because that is what "inlined" mean), so it
looks like a bug.

Thank you,

>
> -- Steve


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