Skip to content

Add -fno-omit-frame-pointer and -mno-omit-leaf-frame-pointer to default compilation flags #995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
artizirk opened this issue Dec 20, 2024 · 1 comment · Fixed by #1000
Closed

Comments

@artizirk
Copy link
Contributor

Since Python 3.12 it is possible to profile Python programs using Linux perf profiler when setting PYTHONPERFSUPPORT=1 environment variable. Unfortunately currently built Python containers are missing fno-omit-frame-pointer -mno-omit-leaf-frame-pointer CFLAGS which result in quite useless perf stack traces. It would be great to have those extra CFLAGS added to the image build. That would allow everyone to do low overhead performance profiling on production systems.

@tianon
Copy link
Member

tianon commented Jan 16, 2025

Sorry, I'm not sure how I missed this 😭

Are there downsides to changing these by default? Presumably these are omitted by default in the compiler intentionally, and I'd like to make sure we understand why before we disable them (that upstream Python page is great, but the way I read it is "if you want perf, you should build this way" not necessarily "it's generally a good idea to build all Python binaries this way" which is a slightly different thing).

After typing that, I read your other links (thank you!!) and both Ubuntu and Fedora doing this by default for the whole distro is a pretty strong signal for me. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants