summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2023-02-07 00:00:09 -0800
committerTakashi Kokubun <[email protected]>2023-03-05 22:11:20 -0800
commit4bb4479165209af59efae2dd3248873eecc3d4f5 (patch)
treef2d6ac66f3d70abd98a4fbed5924782a1aa7ecc8 /lib
parent5c638c97bb8e46b558b41b17b988722bb9432196 (diff)
Add compiled_block_count
Diffstat (limited to 'lib')
-rw-r--r--lib/ruby_vm/mjit/compiler.rb8
-rw-r--r--lib/ruby_vm/mjit/stats.rb1
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/ruby_vm/mjit/compiler.rb b/lib/ruby_vm/mjit/compiler.rb
index f855c8a6a5..18f2d94016 100644
--- a/lib/ruby_vm/mjit/compiler.rb
+++ b/lib/ruby_vm/mjit/compiler.rb
@@ -224,6 +224,14 @@ module RubyVM::MJIT
raise "compiling #{insn.name} returned unexpected status: #{status.inspect}"
end
end
+
+ incr_counter(:compiled_block_count)
+ end
+
+ def incr_counter(name)
+ if C.mjit_opts.stats
+ C.rb_mjit_counters[name][0] += 1
+ end
end
end
end
diff --git a/lib/ruby_vm/mjit/stats.rb b/lib/ruby_vm/mjit/stats.rb
index 7fa9236257..bc5a30738e 100644
--- a/lib/ruby_vm/mjit/stats.rb
+++ b/lib/ruby_vm/mjit/stats.rb
@@ -36,6 +36,7 @@ module RubyVM::MJIT
print_counters(stats, prefix: 'send_', prompt: 'method call exit reasons')
+ $stderr.puts "compiled_block_count: #{format('%10d', stats[:compiled_block_count])}"
$stderr.puts "side_exit_count: #{format('%10d', stats[:side_exit_count])}"
$stderr.puts "total_insns_count: #{format('%10d', stats[:total_insns_count])}" if stats.key?(:total_insns_count)
$stderr.puts "vm_insns_count: #{format('%10d', stats[:vm_insns_count])}" if stats.key?(:vm_insns_count)