mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-114312: Collect stats for unlikely events (GH-114493)
This commit is contained in:
parent
c63c6142f9
commit
ea3cd0498c
11 changed files with 199 additions and 1 deletions
|
|
@ -53,6 +53,15 @@ handle_func_event(PyFunction_WatchEvent event, PyFunctionObject *func,
|
|||
if (interp->active_func_watchers) {
|
||||
notify_func_watchers(interp, event, func, new_value);
|
||||
}
|
||||
switch (event) {
|
||||
case PyFunction_EVENT_MODIFY_CODE:
|
||||
case PyFunction_EVENT_MODIFY_DEFAULTS:
|
||||
case PyFunction_EVENT_MODIFY_KWDEFAULTS:
|
||||
RARE_EVENT_INTERP_INC(interp, func_modification);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -1371,6 +1371,7 @@ type_set_bases(PyTypeObject *type, PyObject *new_bases, void *context)
|
|||
res = 0;
|
||||
}
|
||||
|
||||
RARE_EVENT_INC(set_bases);
|
||||
Py_DECREF(old_bases);
|
||||
Py_DECREF(old_base);
|
||||
|
||||
|
|
@ -5842,6 +5843,8 @@ object_set_class(PyObject *self, PyObject *value, void *closure)
|
|||
Py_SET_TYPE(self, newto);
|
||||
if (oldto->tp_flags & Py_TPFLAGS_HEAPTYPE)
|
||||
Py_DECREF(oldto);
|
||||
|
||||
RARE_EVENT_INC(set_class);
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue