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

feat(profiling): Support for multithreaded profiles #1570

Merged
merged 3 commits into from
Sep 12, 2022

Conversation

Zylphrex
Copy link
Member

A signal handler can only be installed on the main thread, this was the reason
why we could not use signals to profile multithreaded programs. This change
installs the signal handler during sdk initialization which should happen on the
main thread. The timers are still started on the individual threads to allow for
profiles being recorded from different threads.

@Zylphrex Zylphrex force-pushed the txiao/feat/support-for-multithreaded-profiles branch from 1de27f6 to f5b789f Compare August 18, 2022 20:32
A signal handler can only be installed on the main thread, this was the reason
why we could not use signals to profile multithreaded programs. This change
installs the signal handler during sdk initialization which should happen on the
main thread. The timers are still started on the individual threads to allow for
profiles being recorded from different threads.
@Zylphrex Zylphrex force-pushed the txiao/feat/support-for-multithreaded-profiles branch from f5b789f to 0aec42b Compare August 18, 2022 20:44
@Zylphrex Zylphrex marked this pull request as ready for review August 18, 2022 20:45
@Zylphrex Zylphrex requested review from sl0thentr0py and a team August 18, 2022 20:49
Copy link
Member

@sl0thentr0py sl0thentr0py left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx a lot @Zylphrex, this is so much cleaner now!
Just one question because I could not follow the logic there, but otherwise lgtm.

Can you also rebase master and resolve the conflict? Then we can :shipit:.

sentry_sdk/profiler.py Show resolved Hide resolved
@Zylphrex Zylphrex enabled auto-merge (squash) September 12, 2022 18:23
@Zylphrex Zylphrex merged commit 0e6aa6d into master Sep 12, 2022
@Zylphrex Zylphrex deleted the txiao/feat/support-for-multithreaded-profiles branch September 12, 2022 18:38
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