summaryrefslogtreecommitdiffstats
path: root/Python/optimizer.c
diff options
context:
space:
mode:
authorMichael Droettboom <mdboom@gmail.com>2024-03-13 22:13:33 (GMT)
committerGitHub <noreply@github.com>2024-03-13 22:13:33 (GMT)
commitcef0ec1a3ca40db69b56bcd736c1b3bb05a1cf48 (patch)
tree6025d8fccc74cc13e7300870db12607e6c2099c2 /Python/optimizer.c
parent8c6db45ce34df7081d7497e638daf3e130303295 (diff)
downloadcpython-cef0ec1a3ca40db69b56bcd736c1b3bb05a1cf48.zip
cpython-cef0ec1a3ca40db69b56bcd736c1b3bb05a1cf48.tar.gz
cpython-cef0ec1a3ca40db69b56bcd736c1b3bb05a1cf48.tar.bz2
gh-116760: Fix pystats for trace attempts (GH-116761)
There are now at least two bytecodes that may attempt to optimize, JUMP_BACK, and more recently, COLD_EXIT. Only the JUMP_BACK was counting the attempt in the stats. This moves that counter to uop_optimize itself so it should always happen no matter where it is called from.
Diffstat (limited to 'Python/optimizer.c')
-rw-r--r--Python/optimizer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/optimizer.c b/Python/optimizer.c
index aaf75b2..88c45f2 100644
--- a/Python/optimizer.c
+++ b/Python/optimizer.c
@@ -1003,6 +1003,7 @@ uop_optimize(
_PyBloomFilter dependencies;
_Py_BloomFilter_Init(&dependencies);
_PyUOpInstruction buffer[UOP_MAX_TRACE_LENGTH];
+ OPT_STAT_INC(attempts);
int err = translate_bytecode_to_trace(frame, instr, buffer, UOP_MAX_TRACE_LENGTH, &dependencies);
if (err <= 0) {
// Error or nothing translated