mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-103615: Use local events for opcode tracing (GH-109472)
* Use local monitoring for opcode trace * Remove f_opcode_trace_set * Add test for setting f_trace_opcodes after settrace
This commit is contained in:
parent
2bc01cc0c7
commit
e0afed7e27
9 changed files with 114 additions and 8 deletions
|
@ -1833,6 +1833,23 @@ _PyMonitoring_SetLocalEvents(PyCodeObject *code, int tool_id, _PyMonitoringEvent
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
_PyMonitoring_GetLocalEvents(PyCodeObject *code, int tool_id, _PyMonitoringEventSet *events)
|
||||
{
|
||||
assert(0 <= tool_id && tool_id < PY_MONITORING_TOOL_IDS);
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET();
|
||||
if (check_tool(interp, tool_id)) {
|
||||
return -1;
|
||||
}
|
||||
if (code->_co_monitoring == NULL) {
|
||||
*events = 0;
|
||||
return 0;
|
||||
}
|
||||
_Py_LocalMonitors *local = &code->_co_monitoring->local_monitors;
|
||||
*events = get_local_events(local, tool_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
module monitoring
|
||||
[clinic start generated code]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue