From 4bb4479165209af59efae2dd3248873eecc3d4f5 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 7 Feb 2023 00:00:09 -0800 Subject: Add compiled_block_count --- lib/ruby_vm/mjit/compiler.rb | 8 ++++++++ lib/ruby_vm/mjit/stats.rb | 1 + 2 files changed, 9 insertions(+) (limited to 'lib/ruby_vm') 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) -- cgit v1.2.3