]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix reporting of specialization stats. (GH-31503)
authorMark Shannon <mark@hotpy.org>
Tue, 22 Feb 2022 17:18:10 +0000 (17:18 +0000)
committerGitHub <noreply@github.com>
Tue, 22 Feb 2022 17:18:10 +0000 (17:18 +0000)
Python/ceval.c
Tools/scripts/summarize_stats.py

index 4d7c0d015bc7690dd76b83ff755b0c1fdfe8d2ad..308271b8953de027495554738300bd8565db7303 100644 (file)
@@ -4691,6 +4691,7 @@ handle_eval_breaker:
             DEOPT_IF(func->func_version != cache1->func_version, CALL);
             PyCodeObject *code = (PyCodeObject *)func->func_code;
             DEOPT_IF(code->co_argcount != argcount, CALL);
+            STAT_INC(CALL, hit);
             InterpreterFrame *new_frame = _PyFrame_Push(tstate, func);
             if (new_frame == NULL) {
                 goto error;
@@ -4725,6 +4726,7 @@ handle_eval_breaker:
             DEOPT_IF(argcount > code->co_argcount, CALL);
             int minargs = cache1->min_args;
             DEOPT_IF(argcount < minargs, CALL);
+            STAT_INC(CALL, hit);
             InterpreterFrame *new_frame = _PyFrame_Push(tstate, func);
             if (new_frame == NULL) {
                 goto error;
index df20959ea87b641ba0b294f0fbda002a10ea2cd6..69babfd2ddafc69ca1cf4b244e9bd58b3188b3cd 100644 (file)
@@ -38,7 +38,7 @@ def print_specialization_stats(name, family_stats, defines):
         for key in sorted(family_stats):
             if key.startswith("specialization.failure_kinds"):
                 continue
-            if key.startswith("specialization."):
+            if key in ("specialization.hit", "specialization.miss"):
                 label = key[len("specialization."):]
             elif key == "execution_count":
                 label = "unquickened"