Re: [PATCH 2/6] objtool: Add instrumentation_weak()
From: Josh Poimboeuf
Date: Sat Nov 21 2026 - 22:40:10 EST
On Mon, Nov 02, 2026 at 12:25:51PM +0100, Peter Zijlstra wrote:
> The strict pairing of instrumentation_begin()/instrumentation_end() gets in the
> way of tail-call optimizations, since it requires writing code like:
>
> int bar(void);
>
> noinstr int foo(void)
> {
> int ret;
> instrumentation_begin();
> ret = bar();
> instrumentation_end();
> return ret;
> }
>
> Introduce instrumentation_weak(), which is like instrumentation_begin() but
> does not nest and does not pair. This way one can write:
>
> noinstr int foo(void)
> {
> instrumentation_weak();
> return bar();
> }
>
> And get tail-calls without objtool getting upset.
I find the "weak" naming to be rather... weak.
instrumentation_begin_unpaired() ?
instrumentation_enable() ?
--
Josh