summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2020-03-15 00:24:15 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2020-03-15 00:24:18 -0700
commitf6a54e6e461e3689d0d9068d33f986ce2d458bef (patch)
tree1fb95131be1dfebdf4cc0be89bd8ea5eef1be454
parent67fbc122fb71fab9b148faedfb2159ad38d965ac (diff)
Add debug counter for unload_units
changing add_iseq_to_process's debug counter name as well for comparison
-rw-r--r--debug_counter.h5
-rw-r--r--mjit.c2
-rw-r--r--mjit.h1
3 files changed, 6 insertions, 2 deletions
diff --git a/debug_counter.h b/debug_counter.h
index e38b5c6b79..687179e40e 100644
--- a/debug_counter.h
+++ b/debug_counter.h
@@ -311,11 +311,14 @@ RB_DEBUG_COUNTER(theap_evacuate)
/* 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 b03d92cb77..239325ee89 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
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
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 dac0bcfc39..c504112488 100644
--- a/mjit.h
+++ b/mjit.h
@@ -138,7 +138,6 @@ mjit_exec(rb_execution_context_t *ec)
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);