On Mon, 21 Mar 2022 12:22:59 -0400 Steven Rostedt <rostedt@xxxxxxxxxxx> wrote: > Or maybe another solution is: > > funcA: > [..] > jmp funcB > call __fexit__ > ret > > And if funcA is being traced, we change jmp to a call. > > [..] > call funcB > call __fexit__ We could also make __fexit__ a tail call: > ret funcA: [..] call funcB jmp __fexit__ We would also need a way to know that funcA has a tail call at the end. So more help from either the compiler or objtool. -- Steve