Skip to content

Commit

Permalink
Compile with no-omit-frame-pointer
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
artizirk and tianon committed Jan 17, 2025
1 parent 0bb5f4b commit 599d90a
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 3.12/alpine3.20/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.12/alpine3.21/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.12/bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.12/bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.12/slim-bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.12/slim-bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.13/alpine3.20/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.13/alpine3.21/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.13/bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.13/bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.13/slim-bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.13/slim-bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.14-rc/alpine3.20/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.14-rc/alpine3.21/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.14-rc/bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.14-rc/bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.14-rc/slim-bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 3.14-rc/slim-bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Dockerfile-linux.template
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ RUN set -eux; \
{{ if is_slim or is_alpine then ( -}}
LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \
{{ ) else "" end -}}
{{
# Enabling frame-pointer only makes sense for Python 3.12 and newer as those have perf profiler support
if rcVersion | IN("3.9", "3.10", "3.11") then "" else (
-}}
# https://docs.python.org/3.12/howto/perf_profiling.html
EXTRA_CFLAGS="${EXTRA_CFLAGS:-} -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"; \
{{ ) end -}}
make -j "$nproc" \
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
"LDFLAGS=${LDFLAGS:-}" \
Expand Down

0 comments on commit 599d90a

Please sign in to comment.