From cdc614cd0a21b2e72d953438438c78bafdfd9f80 Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 25 Sep 2018 18:13:29 +0000 Subject: refactoring debug_counter. * debug_counter.h: add comments for each counters. * debug_counter.h: add some counters (see added comments for details). * obj_newobj * obj_newobj_slowpath * obj_newobj_wb_unprotected * obj_hash_empty * obj_hash_under4 * obj_hash_ge4 * obj_hash_ge8 * heap_xmalloc * heap_xrealloc * heap_xfree * gc.c: add some debug counters (see the above list). * debug_counter.c (rb_debug_counter_show_results): accept a header message. * signal.c (ruby_default_signal): show debug counter results and malloc info (rb_malloc_info_show_results()) before SIGNAL exit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- signal.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'signal.c') diff --git a/signal.c b/signal.c index d24bda07f0..02c8393730 100644 --- a/signal.c +++ b/signal.c @@ -395,9 +395,17 @@ interrupt_init(int argc, VALUE *argv, VALUE self) return rb_call_super(2, args); } +#include "debug_counter.h" +void rb_malloc_info_show_results(void); /* gc.c */ + void ruby_default_signal(int sig) { +#if USE_DEBUG_COUNTER + rb_debug_counter_show_results("killed by signal."); +#endif + rb_malloc_info_show_results(); + signal(sig, SIG_DFL); raise(sig); } -- cgit v1.2.1