mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
GH-91048: Add utils for capturing async call stack for asyncio programs and enable profiling (#124640)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org> Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com> Co-authored-by: Jacob Coffee <jacob@z7x.org> Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
parent
60a3a0dd6f
commit
188598851d
23 changed files with 2923 additions and 241 deletions
|
@ -111,23 +111,7 @@ static void call_ll_exitfuncs(_PyRuntimeState *runtime);
|
|||
_Py_COMP_DIAG_PUSH
|
||||
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
|
||||
|
||||
#if defined(MS_WINDOWS)
|
||||
|
||||
#pragma section("PyRuntime", read, write)
|
||||
__declspec(allocate("PyRuntime"))
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
|
||||
__attribute__((
|
||||
section(SEG_DATA ",PyRuntime")
|
||||
))
|
||||
|
||||
#endif
|
||||
|
||||
_PyRuntimeState _PyRuntime
|
||||
#if defined(__linux__) && (defined(__GNUC__) || defined(__clang__))
|
||||
__attribute__ ((section (".PyRuntime")))
|
||||
#endif
|
||||
GENERATE_DEBUG_SECTION(PyRuntime, _PyRuntimeState _PyRuntime)
|
||||
= _PyRuntimeState_INIT(_PyRuntime, _Py_Debug_Cookie);
|
||||
_Py_COMP_DIAG_POP
|
||||
|
||||
|
|
|
@ -1515,6 +1515,7 @@ init_threadstate(_PyThreadStateImpl *_tstate,
|
|||
tstate->dict_global_version = 0;
|
||||
|
||||
_tstate->asyncio_running_loop = NULL;
|
||||
_tstate->asyncio_running_task = NULL;
|
||||
|
||||
tstate->delete_later = NULL;
|
||||
|
||||
|
@ -1697,6 +1698,7 @@ PyThreadState_Clear(PyThreadState *tstate)
|
|||
Py_CLEAR(tstate->threading_local_sentinel);
|
||||
|
||||
Py_CLEAR(((_PyThreadStateImpl *)tstate)->asyncio_running_loop);
|
||||
Py_CLEAR(((_PyThreadStateImpl *)tstate)->asyncio_running_task);
|
||||
|
||||
Py_CLEAR(tstate->dict);
|
||||
Py_CLEAR(tstate->async_exc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue