mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
GH-103082: Implementation of PEP 669: Low Impact Monitoring for CPython (GH-103083)
* The majority of the monitoring code is in instrumentation.c * The new instrumentation bytecodes are in bytecodes.c * legacy_tracing.c adapts the new API to the old sys.setrace and sys.setprofile APIs
This commit is contained in:
parent
dce2d38cb0
commit
411b169281
44 changed files with 6029 additions and 1625 deletions
|
@ -3409,6 +3409,7 @@ error:
|
|||
return _PyStatus_ERR("can't set preliminary stderr");
|
||||
}
|
||||
|
||||
PyObject *_Py_CreateMonitoringObject(void);
|
||||
|
||||
/* Create sys module without all attributes.
|
||||
_PySys_UpdateConfig() should be called later to add remaining attributes. */
|
||||
|
@ -3458,6 +3459,16 @@ _PySys_Create(PyThreadState *tstate, PyObject **sysmod_p)
|
|||
goto error;
|
||||
}
|
||||
|
||||
PyObject *monitoring = _Py_CreateMonitoringObject();
|
||||
if (monitoring == NULL) {
|
||||
goto error;
|
||||
}
|
||||
int err = PyDict_SetItemString(sysdict, "monitoring", monitoring);
|
||||
Py_DECREF(monitoring);
|
||||
if (err < 0) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
assert(!_PyErr_Occurred(tstate));
|
||||
|
||||
*sysmod_p = sysmod;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue