Skip to content

Keep perf trampoline templates in read-only data - #1393

Draft
zaniebot wants to merge 2 commits into
astral-sh:mainfrom
zaniebot:perf-trampoline-rodata
Draft

zaniebot wants to merge 2 commits into
astral-sh:mainfrom
zaniebot:perf-trampoline-rodata

Conversation

@zaniebot

Copy link
Copy Markdown
Contributor

CPython copies its perf trampoline into executable memory at runtime. With the template in .text, BOLT can instrument it or move its start and end markers independently, making the copied trampoline invalid. The padding byte and trampoline-specific exclusion added in #1356 avoid this failure.

Store the template in .rodata for BOLT-enabled builds so BOLT treats it as data, replacing both workarounds. Remove the BOLT-specific skips from test_perf_profiler for these builds.

Follows the approach proposed in python/cpython#160366.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants