Skip to content

feat(profiling): Support for multithreaded profiles#1570

Merged
Zylphrex merged 3 commits into
masterfrom
txiao/feat/support-for-multithreaded-profiles
Sep 12, 2022
Merged

feat(profiling): Support for multithreaded profiles#1570
Zylphrex merged 3 commits into
masterfrom
txiao/feat/support-for-multithreaded-profiles

Conversation

@Zylphrex

Copy link
Copy Markdown
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 a team and sl0thentr0py August 18, 2022 20:49

@sl0thentr0py sl0thentr0py left a comment

Copy link
Copy Markdown
Member

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:.

Comment thread sentry_sdk/profiler.py
@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