Commits

Mark Shannon  committed 2ab9e23 Draft

Minor enhancements to execution logging.

  • Participants
  • Parent commits 206c6cf

Comments (0)

Files changed (3)

File Python/register_interpreter.c

 polymorphic_exit:
     {
         PyObject *value = poly_value;
-        LOG("Polymorphic Exit");
         HotPyTraceObject *exit_trace;
         HotPyPolyExitObject *poly_exit = (HotPyPolyExitObject *)exit;
         int i;
                     goto execute_trace;
                 }
             }
+            LOG_FMT("Polymorphic cold exit. Count=%d\n", poly_exit->entries[i].execution_count);
             _HotPy_Stats.polymorphic_cold_exits++;
         }
         else {
             _HotPy_Stats.polymorphic_overflow_exits++;
+            LOG("Polymorphic overflow exit.\n");
         }
         HotPy_RestoreThreadState(tstate, exit->exit_context);
         Py_DECREF(trace);

File Python/trace_interpreter.c

 polymorphic_exit:
     {
         PyObject *value = POP();
-        LOG("Polymorphic Exit");
         HotPyTraceObject *exit_trace;
         HotPyPolyExitObject *poly_exit = (HotPyPolyExitObject *)exit;
         int i;
                     goto execute_trace;
                 }
             }
+            LOG_FMT("Polymorphic cold exit. Count=%d\n", poly_exit->entries[i].execution_count);
             _HotPy_Stats.polymorphic_cold_exits++;
         }
         else {
             Py_DECREF(value);
             _HotPy_Stats.polymorphic_overflow_exits++;
+            LOG("Polymorphic overflow exit.\n");
         }
         HotPy_RestoreThreadState(tstate, exit->exit_context);
         Py_DECREF(trace);

File Python/trace_manager.c

     int trace_count = 0;
     Py_ssize_t i = 0;
     PyObject *for_deletion;
+#ifdef Py_DEBUG
+    if (_HotPy_InstructionLog) fprintf(_HotPy_InstructionLog, "Decay\n");
+#endif
     if (tstate->trace_cache != NULL) {
         PyErr_Fetch(&e_ty, &e_ex, &e_tb);
         for_deletion = PyList_New(0);