gh-115168: Add pystats counter for invalidated executors (GH-115169)

This commit is contained in:
Michael Droettboom 2024-02-26 12:51:47 -05:00 committed by GitHub
parent 96c10c6485
commit b05afdd5ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 31 additions and 14 deletions

View file

@ -1599,7 +1599,7 @@ _Py_Instrument(PyCodeObject *code, PyInterpreterState *interp)
if (code->co_executors != NULL) {
_PyCode_Clear_Executors(code);
}
_Py_Executors_InvalidateDependency(interp, code);
_Py_Executors_InvalidateDependency(interp, code, 1);
int code_len = (int)Py_SIZE(code);
/* Exit early to avoid creating instrumentation
* data for potential statically allocated code
@ -1820,7 +1820,7 @@ _PyMonitoring_SetEvents(int tool_id, _PyMonitoringEventSet events)
return -1;
}
set_global_version(tstate, new_version);
_Py_Executors_InvalidateAll(interp);
_Py_Executors_InvalidateAll(interp, 1);
return instrument_all_executing_code_objects(interp);
}
@ -1850,7 +1850,7 @@ _PyMonitoring_SetLocalEvents(PyCodeObject *code, int tool_id, _PyMonitoringEvent
/* Force instrumentation update */
code->_co_instrumentation_version -= MONITORING_VERSION_INCREMENT;
}
_Py_Executors_InvalidateDependency(interp, code);
_Py_Executors_InvalidateDependency(interp, code, 1);
if (_Py_Instrument(code, interp)) {
return -1;
}