mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
GH-93503: Add thread-specific APIs to set profiling and tracing functions in the C-API (#93504)
* gh-93503: Add APIs to set profiling and tracing functions in all threads in the C-API * Use a separate API * Fix NEWS entry * Add locks around the loop * Document ignoring exceptions * Use the new APIs in the sys module * Update docs
This commit is contained in:
parent
657976ad95
commit
e34c82abeb
10 changed files with 271 additions and 4 deletions
|
@ -1774,6 +1774,18 @@ Python-level trace functions in previous versions.
|
|||
|
||||
The caller must hold the :term:`GIL`.
|
||||
|
||||
.. c:function:: void PyEval_SetProfileAllThreads(Py_tracefunc func, PyObject *obj)
|
||||
|
||||
Like :c:func:`PyEval_SetProfile` but sets the profile function in all running threads
|
||||
belonging to the current interpreter instead of the setting it only on the current thread.
|
||||
|
||||
The caller must hold the :term:`GIL`.
|
||||
|
||||
As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised while
|
||||
setting the profile functions in all threads.
|
||||
|
||||
.. versionadded:: 3.12
|
||||
|
||||
|
||||
.. c:function:: void PyEval_SetTrace(Py_tracefunc func, PyObject *obj)
|
||||
|
||||
|
@ -1788,6 +1800,18 @@ Python-level trace functions in previous versions.
|
|||
|
||||
The caller must hold the :term:`GIL`.
|
||||
|
||||
.. c:function:: void PyEval_SetTraceAllThreads(Py_tracefunc func, PyObject *obj)
|
||||
|
||||
Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running threads
|
||||
belonging to the current interpreter instead of the setting it only on the current thread.
|
||||
|
||||
The caller must hold the :term:`GIL`.
|
||||
|
||||
As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised while
|
||||
setting the trace functions in all threads.
|
||||
|
||||
.. versionadded:: 3.12
|
||||
|
||||
|
||||
.. _advanced-debugging:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue