From 84b4533e8446cbff3325fffe939c87f7120a3ffd Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 30 Oct 2023 20:02:45 -0400 Subject: gh-109329: Count tier2 opcode misses (#110561) This keeps a separate 'miss' counter for each micro-opcode, incremented whenever a guard uop takes a deoptimization side exit. --- Python/executor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Python/executor.c') diff --git a/Python/executor.c b/Python/executor.c index bfa7f7e1c3d..28845656891 100644 --- a/Python/executor.c +++ b/Python/executor.c @@ -25,6 +25,7 @@ #undef DEOPT_IF #define DEOPT_IF(COND, INSTNAME) \ if ((COND)) { \ + UOP_STAT_INC(INSTNAME, miss); \ goto deoptimize; \ } @@ -93,7 +94,7 @@ _PyUopExecute(_PyExecutorObject *executor, _PyInterpreterFrame *frame, PyObject (int)(stack_pointer - _PyFrame_Stackbase(frame))); pc++; OPT_STAT_INC(uops_executed); - UOP_EXE_INC(opcode); + UOP_STAT_INC(opcode, execution_count); #ifdef Py_STATS trace_uop_execution_counter++; #endif -- cgit v1.2.3