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

@ -612,7 +612,7 @@ builtins_dict_watcher(PyDict_WatchEvent event, PyObject *dict, PyObject *key, Py
{
PyInterpreterState *interp = _PyInterpreterState_GET();
if (interp->rare_events.builtin_dict < _Py_MAX_ALLOWED_BUILTINS_MODIFICATIONS) {
_Py_Executors_InvalidateAll(interp);
_Py_Executors_InvalidateAll(interp, 1);
}
RARE_EVENT_INTERP_INC(interp, builtin_dict);
return 0;
@ -1628,7 +1628,7 @@ finalize_modules(PyThreadState *tstate)
PyInterpreterState *interp = tstate->interp;
// Invalidate all executors and turn off tier 2 optimizer
_Py_Executors_InvalidateAll(interp);
_Py_Executors_InvalidateAll(interp, 0);
_PyOptimizerObject *old = _Py_SetOptimizer(interp, NULL);
Py_XDECREF(old);