You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add public APIs to set trace and profile function in other threads. #93503
Currently, we have two public c-apis to set tracing and profile functions: PyEval_SetProfile and PyEval_SetThreadTrace. This allows to set tracing and profiling functions in the calling thread. This works well, but is, unfortunately, is limited because there is no way for debuggers and profilers to set the tracing and profiling functions in all existing running threads, only the ones that are newly created. This makes it impossible to reliable profile or debug already running applications using public APIs or to allow to activate/deactivate said profilers or debuggers.
There are two exposed APIs that are private (have a leading underscore) that do what we need: _PyEval_SetProfile and _PyEval_SetTrace. Unfortunately, these APIs are not fully public and they don't generate audit events.
I propose to expose public-facing versions of these APIs so profilers and debuggers can set their tracing/profiling functions in all existing threads.
Activity
pythongh-93503: Add APIs to set profiling and tracing functions in al…
pythongh-93503: Add APIs to set profiling and tracing functions in al…
GH-93503: Add thread-specific APIs to set profiling and tracing funct…
pythongh-93503: Document the new tracing/profiling APIs in the What's…
gh-93503: Document the new tracing/profiling APIs in the What's new d…