Skip to content

Commit 09487c1

Browse files
authored
Fix reporting of specialization stats. (GH-31503)
1 parent 77f31a9 commit 09487c1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Python/ceval.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4691,6 +4691,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
46914691
DEOPT_IF(func->func_version != cache1->func_version, CALL);
46924692
PyCodeObject *code = (PyCodeObject *)func->func_code;
46934693
DEOPT_IF(code->co_argcount != argcount, CALL);
4694+
STAT_INC(CALL, hit);
46944695
InterpreterFrame *new_frame = _PyFrame_Push(tstate, func);
46954696
if (new_frame == NULL) {
46964697
goto error;
@@ -4725,6 +4726,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
47254726
DEOPT_IF(argcount > code->co_argcount, CALL);
47264727
int minargs = cache1->min_args;
47274728
DEOPT_IF(argcount < minargs, CALL);
4729+
STAT_INC(CALL, hit);
47284730
InterpreterFrame *new_frame = _PyFrame_Push(tstate, func);
47294731
if (new_frame == NULL) {
47304732
goto error;

Tools/scripts/summarize_stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def print_specialization_stats(name, family_stats, defines):
3838
for key in sorted(family_stats):
3939
if key.startswith("specialization.failure_kinds"):
4040
continue
41-
if key.startswith("specialization."):
41+
if key in ("specialization.hit", "specialization.miss"):
4242
label = key[len("specialization."):]
4343
elif key == "execution_count":
4444
label = "unquickened"

0 commit comments

Comments
 (0)