ruby-changes:55253
From: k0kubun <ko1@a...>
Date: Sat, 6 Apr 2019 23:42:08 +0900 (JST)
Subject: [ruby-changes:55253] k0kubun:r67460 (trunk): Add debug counter for VM <-> MJIT calls
k0kubun 2019-04-06 23:42:02 +0900 (Sat, 06 Apr 2019) New Revision: 67460 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67460 Log: Add debug counter for VM <-> MJIT calls Modified files: trunk/debug_counter.h trunk/mjit.h Index: mjit.h =================================================================== --- mjit.h (revision 67459) +++ mjit.h (revision 67460) @@ -110,6 +110,11 @@ mjit_exec(rb_execution_context_t *ec) https://github.com/ruby/ruby/blob/trunk/mjit.h#L110 func = body->jit_func; if (UNLIKELY((uintptr_t)func <= (uintptr_t)LAST_JIT_ISEQ_FUNC)) { +# ifdef MJIT_HEADER + RB_DEBUG_COUNTER_INC(mjit_frame_JT2VM); +# else + RB_DEBUG_COUNTER_INC(mjit_frame_VM2VM); +# endif switch ((enum rb_mjit_iseq_func)func) { case NOT_ADDED_JIT_ISEQ_FUNC: RB_DEBUG_COUNTER_INC(mjit_exec_not_added); @@ -132,6 +137,11 @@ mjit_exec(rb_execution_context_t *ec) https://github.com/ruby/ruby/blob/trunk/mjit.h#L137 } } +# ifdef MJIT_HEADER + RB_DEBUG_COUNTER_INC(mjit_frame_JT2JT); +# else + RB_DEBUG_COUNTER_INC(mjit_frame_VM2JT); +# endif RB_DEBUG_COUNTER_INC(mjit_exec_call_func); return func(ec, ec->cfp); } Index: debug_counter.h =================================================================== --- debug_counter.h (revision 67459) +++ debug_counter.h (revision 67460) @@ -263,6 +263,12 @@ RB_DEBUG_COUNTER(mjit_exec_not_ready) https://github.com/ruby/ruby/blob/trunk/debug_counter.h#L263 RB_DEBUG_COUNTER(mjit_exec_not_compiled) RB_DEBUG_COUNTER(mjit_exec_call_func) +/* MJIT <-> VM frame push counts */ +RB_DEBUG_COUNTER(mjit_frame_VM2VM) +RB_DEBUG_COUNTER(mjit_frame_VM2JT) +RB_DEBUG_COUNTER(mjit_frame_JT2JT) +RB_DEBUG_COUNTER(mjit_frame_JT2VM) + /* MJIT cancel counters */ RB_DEBUG_COUNTER(mjit_cancel) RB_DEBUG_COUNTER(mjit_cancel_ivar) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/