ruby-changes:60407
From: Takashi <ko1@a...>
Date: Sun, 15 Mar 2020 16:29:48 +0900 (JST)
Subject: [ruby-changes:60407] f6a54e6e46 (master): Add debug counter for unload_units
https://git.ruby-lang.org/ruby.git/commit/?id=f6a54e6e46 From f6a54e6e461e3689d0d9068d33f986ce2d458bef Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Sun, 15 Mar 2020 00:24:15 -0700 Subject: Add debug counter for unload_units changing add_iseq_to_process's debug counter name as well for comparison diff --git a/debug_counter.h b/debug_counter.h index e38b5c6..687179e 100644 --- a/debug_counter.h +++ b/debug_counter.h @@ -311,11 +311,14 @@ RB_DEBUG_COUNTER(theap_evacuate) https://github.com/ruby/ruby/blob/trunk/debug_counter.h#L311 /* mjit_exec() counts */ RB_DEBUG_COUNTER(mjit_exec) RB_DEBUG_COUNTER(mjit_exec_not_added) -RB_DEBUG_COUNTER(mjit_exec_not_added_add_iseq) RB_DEBUG_COUNTER(mjit_exec_not_ready) RB_DEBUG_COUNTER(mjit_exec_not_compiled) RB_DEBUG_COUNTER(mjit_exec_call_func) +/* MJIT enqueue / unload */ +RB_DEBUG_COUNTER(mjit_add_iseq_to_process) +RB_DEBUG_COUNTER(mjit_unload_units) + /* MJIT <-> VM frame push counts */ RB_DEBUG_COUNTER(mjit_frame_VM2VM) RB_DEBUG_COUNTER(mjit_frame_VM2JT) diff --git a/mjit.c b/mjit.c index b03d92c..239325e 100644 --- a/mjit.c +++ b/mjit.c @@ -377,6 +377,7 @@ mjit_add_iseq_to_process(const rb_iseq_t *iseq, const struct rb_mjit_compile_inf https://github.com/ruby/ruby/blob/trunk/mjit.c#L377 if (!mjit_enabled || pch_status == PCH_FAILED) return; + RB_DEBUG_COUNTER_INC(mjit_add_iseq_to_process); iseq->body->jit_func = (mjit_func_t)NOT_READY_JIT_ISEQ_FUNC; create_unit(iseq); if (iseq->body->jit_unit == NULL) @@ -388,6 +389,7 @@ mjit_add_iseq_to_process(const rb_iseq_t *iseq, const struct rb_mjit_compile_inf https://github.com/ruby/ruby/blob/trunk/mjit.c#L389 CRITICAL_SECTION_START(3, "in add_iseq_to_process"); add_to_list(iseq->body->jit_unit, &unit_queue); if (active_units.length >= mjit_opts.max_cache_size) { + RB_DEBUG_COUNTER_INC(mjit_unload_units); unload_units(); } verbose(3, "Sending wakeup signal to workers in mjit_add_iseq_to_process"); diff --git a/mjit.h b/mjit.h index dac0bcf..c504112 100644 --- a/mjit.h +++ b/mjit.h @@ -138,7 +138,6 @@ mjit_exec(rb_execution_context_t *ec) https://github.com/ruby/ruby/blob/trunk/mjit.h#L138 case NOT_ADDED_JIT_ISEQ_FUNC: RB_DEBUG_COUNTER_INC(mjit_exec_not_added); if (total_calls == mjit_opts.min_calls && mjit_target_iseq_p(body)) { - RB_DEBUG_COUNTER_INC(mjit_exec_not_added_add_iseq); rb_mjit_add_iseq_to_process(iseq); if (UNLIKELY(mjit_opts.wait)) { return rb_mjit_wait_call(ec, body); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/