diff --git a/debug_counter.h b/debug_counter.h index e569b18983..daa46fdcbf 100644 --- a/debug_counter.h +++ b/debug_counter.h @@ -263,6 +263,11 @@ RB_DEBUG_COUNTER(mjit_exec_not_added_add_iseq) RB_DEBUG_COUNTER(mjit_exec_not_ready) RB_DEBUG_COUNTER(mjit_exec_not_compiled) +/* rb_mjit_unit_list length */ +RB_DEBUG_COUNTER(mjit_length_unit_queue) +RB_DEBUG_COUNTER(mjit_length_active_units) +RB_DEBUG_COUNTER(mjit_length_compact_units) + /* load (not implemented yet) */ /* RB_DEBUG_COUNTER(load_files) diff --git a/mjit.c b/mjit.c index a1c8f238c2..710f370947 100644 --- a/mjit.c +++ b/mjit.c @@ -781,6 +781,12 @@ mjit_finish(bool close_handle_p) if (!mjit_enabled) return; +#if USE_DEBUG_COUNTER + rb_debug_counter_add(RB_DEBUG_COUNTER_mjit_length_unit_queue, unit_queue.length, 1); + rb_debug_counter_add(RB_DEBUG_COUNTER_mjit_length_active_units, active_units.length, 1); + rb_debug_counter_add(RB_DEBUG_COUNTER_mjit_length_compact_units, compact_units.length, 1); +#endif + /* Wait for pch finish */ verbose(2, "Stopping worker thread"); CRITICAL_SECTION_START(3, "in mjit_finish to wakeup from pch");