aboutsummaryrefslogtreecommitdiffstats
path: root/vm.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2019-08-06 12:23:30 -0700
committerAaron Patterson <tenderlove@ruby-lang.org>2019-08-07 10:36:17 -0700
commit70fd099220446e39bb80eb0bb32870ce12134619 (patch)
tree3479b6b79e91926b3809356160a136415b06adb6 /vm.c
parent2f3795113df23006f1f99dd5879a8a9acbc29c5c (diff)
downloadruby-70fd099220446e39bb80eb0bb32870ce12134619.tar.gz
Add a way to print debug counters without exiting
I am trying to study debug counters inside a Rails application. Accessing debug counters by killing the process is hard because child processes don't get the same TRAP as the parent, and Rails seems to intercept calls to `exit`. Adding this method lets me print the debug counters when I want (at the end of requests for example)
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index b4e2e3c5e6..a0a04c6337 100644
--- a/vm.c
+++ b/vm.c
@@ -2916,6 +2916,7 @@ Init_VM(void)
rb_define_singleton_method(rb_cRubyVM, "stat", vm_stat, -1);
#if USE_DEBUG_COUNTER
rb_define_singleton_method(rb_cRubyVM, "reset_debug_counters", rb_debug_counter_reset, 0);
+ rb_define_singleton_method(rb_cRubyVM, "show_debug_counters", rb_debug_counter_show, 0);
#endif
/* FrozenCore (hidden) */