Skip to content

[Runtime] Only use lazy os_signpost initialization for platform binaries. #80018

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

Merged

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Mar 14, 2025

We don't emit signposts until something else has set them up, to avoid deadlocks when we're running in code that's involved in setting them up. But this means that Instruments will miss Concurrency events in a simple program that doesn't otherwise trigger setup of the logging system.

Since we must be in a platform binary if we're running in code that's setting up logging, we can check for that and only be lazy in platform binaries. Non-platform binaries can safely emit signposts eagerly.

rdar://142483658

@mikeash mikeash requested a review from al45tair March 14, 2025 15:35
@mikeash mikeash requested a review from rjmccall as a code owner March 14, 2025 15:35
@mikeash
Copy link
Contributor Author

mikeash commented Mar 14, 2025

@swift-ci please test

…ies.

We don't emit signposts until something else has set them up, to avoid deadlocks when we're running in code that's involved in setting them up. But this means that Instruments will miss Concurrency events in a simple program that doesn't otherwise trigger setup of the logging system.

Since we must be in a platform binary if we're running in code that's setting up logging, we can check for that and only be lazy in platform binaries. Non-platform binaries can safely emit signposts eagerly.

rdar://142483658
@mikeash mikeash force-pushed the eager-tracing-non-platform-binaries branch from d62b7db to b2fe7b4 Compare March 14, 2025 15:52
@mikeash
Copy link
Contributor Author

mikeash commented Mar 14, 2025

@swift-ci please test

@compnerd compnerd merged commit 6793952 into swiftlang:main Mar 17, 2025
5 checks passed
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.

3 participants