Re: [PATCH] tracing: Disable branch profiling in noinstr code

From: Thomas Gleixner
Date: Fri Mar 21 2025 - 12:52:20 EST


On Thu, Mar 20 2025 at 23:05, Josh Poimboeuf wrote:

> CONFIG_TRACE_BRANCH_PROFILING inserts a call to ftrace_likely_update()
> for each use of likely() or unlikely(). If the caller is noinstr, that
> breaks the noinstr rules.
>
> Disable branch profiling for files which have noinstr functions. Fixes
> many warnings like the following:
>
> vmlinux.o: warning: objtool: do_syscall_64+0x40: call to ftrace_likely_update() leaves .noinstr.text section
> vmlinux.o: warning: objtool: __rdgsbase_inactive+0x33: call to ftrace_likely_update() leaves .noinstr.text section
> vmlinux.o: warning: objtool: handle_bug.isra.0+0x198: call to ftrace_likely_update() leaves .noinstr.text section
> ...

Acked-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

Thanks for fixing this!

Though the real fix would be to rip out this likely/unlikely tracer
hackery all together.

tglx