Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

Enable tracing for all threads. #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

SyamGadde
Copy link

PyEval_SetTrace only sets the current thread's tracing callback. This patch makes enable_count thread-local, so that tracing is enabled/disabled on a thread-specific basis. Without this, only the thread that happened to trigger the enable() call would have had tracing enabled.

@jimi-c
Copy link

jimi-c commented Oct 2, 2017

Tested and works for me.

@Alexey-Akishin
Copy link

Works for me too. This is also very short patch so hopefully not too hard to review. In today's world where many programs need multiple threads, supporting profiling multiple threads is very useful.

ahippo added a commit to ahippo/line_profiler that referenced this pull request Mar 13, 2018
Enable tracing for all threads.
@gaasedelen
Copy link

After four years, I am also surprised that this has not been merged. It has been used for a number of my multithreaded projects, and it painful to carry around a non-pip version.

Pinging @rkern ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
being considered Actively being investigated by maintainers for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants