mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +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
|
|
@ -1672,6 +1672,15 @@ frame_settrace(PyFrameObject *f, PyObject* v, void *closure)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
frame_getgenerator(PyFrameObject *f, void *arg) {
|
||||
if (f->f_frame->owner == FRAME_OWNED_BY_GENERATOR) {
|
||||
PyObject *gen = (PyObject *)_PyGen_GetGeneratorFromFrame(f->f_frame);
|
||||
return Py_NewRef(gen);
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
static PyGetSetDef frame_getsetlist[] = {
|
||||
{"f_back", (getter)frame_getback, NULL, NULL},
|
||||
|
|
@ -1684,6 +1693,7 @@ static PyGetSetDef frame_getsetlist[] = {
|
|||
{"f_builtins", (getter)frame_getbuiltins, NULL, NULL},
|
||||
{"f_code", (getter)frame_getcode, NULL, NULL},
|
||||
{"f_trace_opcodes", (getter)frame_gettrace_opcodes, (setter)frame_settrace_opcodes, NULL},
|
||||
{"f_generator", (getter)frame_getgenerator, NULL, NULL},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue