summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2022-08-24 22:21:39 (GMT)
committerGitHub <noreply@github.com>2022-08-24 22:21:39 (GMT)
commite34c82abeb7ace09e6b5d116585c47cc372996c1 (patch)
tree16f130870af42de041ddf52a36540b9c421aec8c /Doc/c-api
parent657976ad950e56b33b7dc15e64a0baecdd184f5a (diff)
downloadcpython-e34c82abeb7ace09e6b5d116585c47cc372996c1.zip
cpython-e34c82abeb7ace09e6b5d116585c47cc372996c1.tar.gz
cpython-e34c82abeb7ace09e6b5d116585c47cc372996c1.tar.bz2
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
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/init.rst24
1 files changed, 24 insertions, 0 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index 038498f..2a9cf0e 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -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: