Skip to content
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

Compile with no-omit-frame-pointer #1000

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

artizirk
Copy link
Contributor

@artizirk artizirk commented Jan 15, 2025

This adds support for profiling Python 3.12 and newer using Linux perf command.

Fixes: #995

@yosifkit
Copy link
Member

Ah, these flags are automatic in debug builds based on supported architectures. Do we also need to limit them to those specific architectures? (amd64 and arm64v8) Or perhaps we follow Ubuntu and only enable it for 64bit platforms? Or maybe some/all arm32vX are fine since they have more spare general-purpose registers than x86/i386?


Debian bug for adding these flags to libc: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=767756.

@artizirk artizirk force-pushed the frame-pointers branch 2 times, most recently from 79acf80 to 599d90a Compare January 17, 2025 08:20
This adds support for profiling Python 3.12 and newer using Linux `perf`
command.

* https://docs.python.org/3.12/howto/perf_profiling.html

Co-authored-by: Tianon Gravi <[email protected]>
@artizirk
Copy link
Contributor Author

artizirk commented Jan 17, 2025

@yosifkit looks like i386 is the only one that will heavily benefit from not using -no-omit-frame-pointer compile flag. All other architectures have enough CPU registers for this feature.

I have added a check for that in the latest commit.

With i386 support slowly loosing support in Debian 1 2 and 32bit x86 not even being in the CPython supported platforms list 3, it would be interesting to know how may users are still pulling latest i386 Python docker images.

@artizirk artizirk requested a review from tianon January 24, 2025 11:58
@tianon tianon merged commit dbda0fe into docker-library:master Jan 24, 2025
44 checks passed
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request Jan 24, 2025
Changes:

- docker-library/python@dbda0feb: Merge pull request docker-library/python#1000 from artizirk/frame-pointers
@artizirk artizirk deleted the frame-pointers branch January 27, 2025 14:00
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 this pull request may close these issues.

Add -fno-omit-frame-pointer and -mno-omit-leaf-frame-pointer to default compilation flags
3 participants