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

Masami Hiramatsu
2024-08-21T00:15:08Z

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

> On Wed, 21 Aug 2024 08:43:51 +0900
> Masami Hiramatsu (Google) <mhiramat@kernel.org> 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@kernel.org>