Description
Feature or enhancement
I propose to build CPython with -fno-omit-frame-pointer
and -mno-omit-leaf-frame-pointer
on compilers that support these options, at least on Linux with GCC and clang on platforms that support perf trampoline (#96143).
Pitch
The feature is needed for #96143 "Allow the linux perf profiler to see Python calls". Otherwise perf won't be able to reconstruct the call frames and perf report output isn't helpful.
Previous discussion
The feature change proposal https://fedoraproject.org/wiki/Changes/fno-omit-frame-pointer explains the usefulness of frame pointers in great detail. Code without frame pointers can be slightly more efficient because it does not have to safe a register on function call and it can repurpose the register for other uses. The potential performance impact is discussed in the Fedora change proposal, too. tl;dr Fedora testing has not shown any significant impact.