Sorry guys, may be I'm telling well known things but Ubuntu has libc6-prof package which installs alternative version of libc6 with no-omit-frame-pointer to
/lib/libc6-prof/x86_64-linux-gnu/ . Any who need to profile his program can use it via LD_LIBRARY_PATH environment variable while other programs by default use optimized version.
Why reinvent the wheel?
--
With best regards
Maksim Dmitrichenko