Commit Graph

9 Commits

Author SHA1 Message Date
k0kubun 18b5148215 Add debug counter for MJIT stale_units
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14 07:12:44 +00:00
k0kubun f7035dd3ff Do not reset non-increment-only counters
to prevernt underflow.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14 07:10:34 +00:00
k0kubun 5ce28c0642 Add RubyVM.reset_debug_counters when RB_DEBUG_COUNTER
is defined. It's 0 by default and so it dissappears on actual build.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14 06:57:21 +00:00
k0kubun b03c11a337 Add debug counters for MJIT cancel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-29 13:54:29 +00:00
ko1 df5ec4107d add debug counters more.
* debug_counter.h: add the following counters.
  * frame_push: control frame counts (total counts).
  * frame_push_*: control frame counts per every frame type.
  * obj_*: add free'ed counts for each type.

* gc.c: ditto.

* vm_insnhelper.c (vm_push_frame): ditto.

* debug_counter.c (rb_debug_counter_show_results): widen counts field
  to show >10G numbers.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-28 01:10:43 +00:00
svn 2466288d27 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-25 18:13:35 +00:00
ko1 cdc614cd0a 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
2018-09-25 18:13:29 +00:00
nobu b80c265fa4 debug_counter.c: debug_counter_names [ci skip]
* debug_counter.c (debug_counter_names): stringize debug counter
  names by preprocessor.

* debug_counter.h (RB_DEBUG_COUNTER): define counter names outside
  the include guard, to expand multiple times.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-10 07:18:03 +00:00
ko1 76c4cca19c add performance counting mechanism for MRI debug/tuning purpose.
* How to enable this feature?
  * define USE_DEBUG_COUNTER as 1.
  * you can disable to output the result with
    RUBY_DEBUG_COUNTER_DISABLE environment variable
    even if USE_DEBUG_COUNTER == 1.

* How to add new counter?
  * add COUNTER(<name>) line on debug_counter.h.
  * include "debug_counter.h"
  * insert RB_DEBUG_COUNTER_INC(<name>) line on your favorite place.

* counter output example:
  [RUBY_DEBUG_COUNTER]    mc_inline_hit   999
  [RUBY_DEBUG_COUNTER]    mc_inline_miss  3
  [RUBY_DEBUG_COUNTER]    mc_global_hit   23
  [RUBY_DEBUG_COUNTER]    mc_global_miss  273
  [RUBY_DEBUG_COUNTER]    mc_global_state_miss    3
  [RUBY_DEBUG_COUNTER]    mc_class_serial_miss    0
  [RUBY_DEBUG_COUNTER]    mc_cme_complement       0
  [RUBY_DEBUG_COUNTER]    mc_cme_complement_hit   0
  [RUBY_DEBUG_COUNTER]    mc_search_super 1384
  [RUBY_DEBUG_COUNTER]    ivar_get_hit    0
  [RUBY_DEBUG_COUNTER]    ivar_get_miss   0
  [RUBY_DEBUG_COUNTER]    ivar_set_hit    0
  [RUBY_DEBUG_COUNTER]    ivar_set_miss   0
  [RUBY_DEBUG_COUNTER]    ivar_get        431
  [RUBY_DEBUG_COUNTER]    ivar_set        465

  * mc_... is related to method caching.
  * ivar_... is related to instance variable accesses.

* compare with dtrace/system tap features, there are completely
  no performacne penalties when it is disabled.

* This feature is supported only on __GNUC__ compilers.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-21 08:18:15 +00:00