gh-109329: Add stat for "trace too short" (GH-110402) · python/cpython@9eb2489 · GitHub
Skip to content

Commit 9eb2489

Browse files
authored
gh-109329: Add stat for "trace too short" (GH-110402)
1 parent 1328fa3 commit 9eb2489

4 files changed

Lines changed: 5 additions & 0 deletions

File tree

Include/cpython/pystats.h

Lines changed: 1 addition & 0 deletions

Python/optimizer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,7 @@ translate_bytecode_to_trace(
798798
return trace_length;
799799
}
800800
else {
801+
OPT_STAT_INC(trace_too_short);
801802
DPRINTF(4,
802803
"No trace for %s (%s:%d) at byte offset %d\n",
803804
PyUnicode_AsUTF8(code->co_qualname),

Python/specialize.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ print_optimization_stats(FILE *out, OptimizationStats *stats)
229229
fprintf(out, "Optimization trace stack overflow: %" PRIu64 "\n", stats->trace_stack_overflow);
230230
fprintf(out, "Optimization trace stack underflow: %" PRIu64 "\n", stats->trace_stack_underflow);
231231
fprintf(out, "Optimization trace too long: %" PRIu64 "\n", stats->trace_too_long);
232+
fprintf(out, "Optimization trace too short: %" PRIu64 "\n", stats->trace_too_short);
232233
fprintf(out, "Optimization inner loop: %" PRIu64 "\n", stats->inner_loop);
233234
fprintf(out, "Optimization recursive call: %" PRIu64 "\n", stats->recursive_call);
234235

Tools/scripts/summarize_stats.py

Lines changed: 2 additions & 0 deletions

0 commit comments

Comments
 (0)