mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
bpo-43760: Add PyThreadState_EnterTracing() (GH-28542)
Add PyThreadState_EnterTracing() and PyThreadState_LeaveTracing() functions to the limited C API to suspend and resume tracing and profiling. Add an unit test on the PyThreadState C API to _testcapi. Add also internal _PyThreadState_DisableTracing() and _PyThreadState_ResetTracing().
This commit is contained in:
parent
354c35220d
commit
547d26aa08
9 changed files with 146 additions and 25 deletions
|
|
@ -1201,6 +1201,22 @@ PyThreadState_SetAsyncExc(unsigned long id, PyObject *exc)
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
PyThreadState_EnterTracing(PyThreadState *tstate)
|
||||
{
|
||||
tstate->tracing++;
|
||||
_PyThreadState_DisableTracing(tstate);
|
||||
}
|
||||
|
||||
void
|
||||
PyThreadState_LeaveTracing(PyThreadState *tstate)
|
||||
{
|
||||
tstate->tracing--;
|
||||
_PyThreadState_ResetTracing(tstate);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Routines for advanced debuggers, requested by David Beazley.
|
||||
Don't use unless you know what you are doing! */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue