GH-126833: Dumps graphviz representation of executor graph. (GH-126880)
This commit is contained in:
@@ -2344,6 +2344,30 @@ sys_is_stack_trampoline_active_impl(PyObject *module)
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
sys._dump_tracelets
|
||||
|
||||
outpath: object
|
||||
|
||||
Dump the graph of tracelets in graphviz format
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
sys__dump_tracelets_impl(PyObject *module, PyObject *outpath)
|
||||
/*[clinic end generated code: output=a7fe265e2bc3b674 input=5bff6880cd28ffd1]*/
|
||||
{
|
||||
FILE *out = _Py_fopen_obj(outpath, "wb");
|
||||
if (out == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
int err = _PyDumpExecutors(out);
|
||||
fclose(out);
|
||||
if (err) {
|
||||
return NULL;
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*[clinic input]
|
||||
sys._getframemodulename
|
||||
@@ -2603,6 +2627,7 @@ static PyMethodDef sys_methods[] = {
|
||||
#endif
|
||||
SYS__GET_CPU_COUNT_CONFIG_METHODDEF
|
||||
SYS__IS_GIL_ENABLED_METHODDEF
|
||||
SYS__DUMP_TRACELETS_METHODDEF
|
||||
{NULL, NULL} // sentinel
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user