mirror of
https://github.com/python/cpython
synced 2024-09-15 23:57:10 +00:00
Fix reporting of specialization stats. (GH-31503)
This commit is contained in:
parent
77f31a91d5
commit
09487c11a5
|
@ -4691,6 +4691,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
|
||||||
DEOPT_IF(func->func_version != cache1->func_version, CALL);
|
DEOPT_IF(func->func_version != cache1->func_version, CALL);
|
||||||
PyCodeObject *code = (PyCodeObject *)func->func_code;
|
PyCodeObject *code = (PyCodeObject *)func->func_code;
|
||||||
DEOPT_IF(code->co_argcount != argcount, CALL);
|
DEOPT_IF(code->co_argcount != argcount, CALL);
|
||||||
|
STAT_INC(CALL, hit);
|
||||||
InterpreterFrame *new_frame = _PyFrame_Push(tstate, func);
|
InterpreterFrame *new_frame = _PyFrame_Push(tstate, func);
|
||||||
if (new_frame == NULL) {
|
if (new_frame == NULL) {
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -4725,6 +4726,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
|
||||||
DEOPT_IF(argcount > code->co_argcount, CALL);
|
DEOPT_IF(argcount > code->co_argcount, CALL);
|
||||||
int minargs = cache1->min_args;
|
int minargs = cache1->min_args;
|
||||||
DEOPT_IF(argcount < minargs, CALL);
|
DEOPT_IF(argcount < minargs, CALL);
|
||||||
|
STAT_INC(CALL, hit);
|
||||||
InterpreterFrame *new_frame = _PyFrame_Push(tstate, func);
|
InterpreterFrame *new_frame = _PyFrame_Push(tstate, func);
|
||||||
if (new_frame == NULL) {
|
if (new_frame == NULL) {
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -38,7 +38,7 @@ def print_specialization_stats(name, family_stats, defines):
|
||||||
for key in sorted(family_stats):
|
for key in sorted(family_stats):
|
||||||
if key.startswith("specialization.failure_kinds"):
|
if key.startswith("specialization.failure_kinds"):
|
||||||
continue
|
continue
|
||||||
if key.startswith("specialization."):
|
if key in ("specialization.hit", "specialization.miss"):
|
||||||
label = key[len("specialization."):]
|
label = key[len("specialization."):]
|
||||||
elif key == "execution_count":
|
elif key == "execution_count":
|
||||||
label = "unquickened"
|
label = "unquickened"
|
||||||
|
|
Loading…
Reference in a new issue