1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add debug counters for MJIT cancel

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2019-03-29 13:54:29 +00:00
parent 017cb09eb6
commit b03c11a337
7 changed files with 16 additions and 1 deletions

View file

@ -21,7 +21,9 @@ static const char *const debug_counter_names[] = {
#undef RB_DEBUG_COUNTER
};
MJIT_SYMBOL_EXPORT_BEGIN
size_t rb_debug_counter[numberof(debug_counter_names)];
MJIT_SYMBOL_EXPORT_END
void
rb_debug_counter_show_results(const char *msg)

View file

@ -257,11 +257,18 @@ RB_DEBUG_COUNTER(theap_evacuate)
/* mjit_exec() counts */
RB_DEBUG_COUNTER(mjit_exec)
RB_DEBUG_COUNTER(mjit_exec_call_func)
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 cancel counters */
RB_DEBUG_COUNTER(mjit_cancel)
RB_DEBUG_COUNTER(mjit_cancel_ivar)
RB_DEBUG_COUNTER(mjit_cancel_send_inline)
RB_DEBUG_COUNTER(mjit_cancel_opt_insn) /* CALL_SIMPLE_METHOD */
RB_DEBUG_COUNTER(mjit_cancel_trace)
/* rb_mjit_unit_list length */
RB_DEBUG_COUNTER(mjit_length_unit_queue)

View file

@ -189,6 +189,7 @@ compile_cancel_handler(FILE *f, const struct rb_iseq_constant_body *body, struct
{
unsigned int i;
fprintf(f, "\ncancel:\n");
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel);\n");
if (status->local_stack_p) {
for (i = 0; i < body->stack_max; i++) {
fprintf(f, " *(vm_base_ptr(reg_cfp) + %d) = stack[%d];\n", i, i);

View file

@ -66,6 +66,7 @@
if (!pc_moved_p) {
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
}
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_trace);\n");
fprintf(f, " goto cancel;\n");
fprintf(f, " }\n");
% end

View file

@ -79,6 +79,7 @@
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
}
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_opt_insn);\n");
fprintf(f, " goto cancel;\n");
% else
% if insn.handles_sp?

View file

@ -42,6 +42,7 @@
fprintf(f, " else {\n");
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_ivar);\n");
fprintf(f, " goto cancel;\n");
fprintf(f, " }\n");

View file

@ -38,6 +38,7 @@
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_send_inline);\n");
fprintf(f, " goto cancel;\n");
fprintf(f, " }\n");
@ -81,6 +82,7 @@
if (!pc_moved_p) {
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
}
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_trace);\n");
fprintf(f, " goto cancel;\n");
fprintf(f, " }\n");