diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2021-09-15 13:59:50 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:41 -0400 |
commit | 82405ac48ae457de9b54e18545743ab2a58bf989 (patch) | |
tree | 78f93006baea9bd119e8ad93221a1581249f843a | |
parent | 1f09eb66e6cc1019ba88e421f1ba8186c071a6ed (diff) |
Add counters for tracking invalidations
-rw-r--r-- | yjit.rb | 3 | ||||
-rw-r--r-- | yjit_core.c | 8 | ||||
-rw-r--r-- | yjit_iface.c | 3 | ||||
-rw-r--r-- | yjit_iface.h | 3 |
4 files changed, 17 insertions, 0 deletions
@@ -177,6 +177,9 @@ module YJIT yjit_ratio_pct = 100.0 * retired_in_yjit.to_f / total_insns_count $stderr.puts "compiled_iseq_count: " + ("%10d" % stats[:compiled_iseq_count]) + $stderr.puts "compiled_block_count: " + ("%10d" % stats[:compiled_block_count]) + $stderr.puts "invalidation_count: " + ("%10d" % stats[:invalidation_count]) + $stderr.puts "constant_state_bumps: " + ("%10d" % stats[:constant_state_bumps]) $stderr.puts "inline_code_size: " + ("%10d" % stats[:inline_code_size]) $stderr.puts "outlined_code_size: " + ("%10d" % stats[:outlined_code_size]) diff --git a/yjit_core.c b/yjit_core.c index 77e5b98190..6c2e1b0ae0 100644 --- a/yjit_core.c +++ b/yjit_core.c @@ -557,6 +557,10 @@ add_block_version(blockid_t blockid, block_t* block) RB_OBJ_WRITTEN(iseq, Qundef, object); } } + +#if YJIT_STATS + yjit_runtime_counters.compiled_block_count++; +#endif } // Create a new outgoing branch entry for a block @@ -1144,6 +1148,10 @@ invalidate_block_version(block_t *block) yjit_free_block(block); +#if YJIT_STATS + yjit_runtime_counters.invalidation_count++; +#endif + // fprintf(stderr, "invalidation done\n"); } diff --git a/yjit_iface.c b/yjit_iface.c index 42f22f3939..0f11fa61a5 100644 --- a/yjit_iface.c +++ b/yjit_iface.c @@ -591,6 +591,9 @@ rb_yjit_constant_state_changed(void) { if (blocks_assuming_stable_global_constant_state) { st_foreach(blocks_assuming_stable_global_constant_state, block_invalidation_iterator, 0); +#if YJIT_STATS + yjit_runtime_counters.constant_state_bumps++; +#endif } } diff --git a/yjit_iface.h b/yjit_iface.h index b53059b6da..c42b29e977 100644 --- a/yjit_iface.h +++ b/yjit_iface.h @@ -87,6 +87,9 @@ YJIT_DECLARE_COUNTERS( vm_insns_count, compiled_iseq_count, + compiled_block_count, + invalidation_count, + constant_state_bumps, expandarray_splat, expandarray_postarg, |