8000 Count side exits per uop loc and print if >= 10 · python/cpython@f21f2d8 · GitHub
[go: up one dir, main page]

Skip to content

Commit f21f2d8

Browse files
committed
Count side exits per uop loc and print if >= 10
1 parent d12533b commit f21f2d8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Python/ceval.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,14 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10861086
DPRINTF(2, "Avoiding ENTER_EXECUTOR in favor of underlying %s\n", _PyOpcode_OpName[opcode]);
10871087
DISPATCH_GOTO();
10881088
}
1089+
// Increment side exit counter for this uop
1090+
int pc = next_uop - 1 - current_executor->trace;
1091+
uintptr_t *pcounter = current_executor->extra + pc;
1092+
*pcounter += 1;
1093+
if (*pcounter >= 10) {
1094+
DPRINTF(2, "--> %s @ %d in %p has %d side exits\n",
1095+
_PyUopName(uopcode), pc, current_executor, (int)(*pcounter));
1096+
}
10891097
Py_DECREF(current_executor);
10901098
// Fall through
10911099
// Jump here from ENTER_EXECUTOR

0 commit comments

Comments
 (0)
0