summaryrefslogtreecommitdiff
path: root/yjit.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-02-16 11:32:13 -0800
committerGitHub <noreply@github.com>2023-02-16 11:32:13 -0800
commit21f9c92c7144e3b1387aaecfba4fa2beba2d1d70 (patch)
tree11f3c544cbc5165843384f09fe604d659fa2d908 /yjit.rb
parent8f22dc39f38f32bc3cde198c2b476899f6460c9c (diff)
downloadruby-21f9c92c7144e3b1387aaecfba4fa2beba2d1d70.tar.gz
YJIT: Show Context stats on exit (#7327)
Diffstat (limited to 'yjit.rb')
-rw-r--r--yjit.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/yjit.rb b/yjit.rb
index b695a10cac..8387767958 100644
--- a/yjit.rb
+++ b/yjit.rb
@@ -145,8 +145,8 @@ module RubyVM::YJIT
# Return a hash for statistics generated for the --yjit-stats command line option.
# Return nil when option is not passed or unavailable.
- def self.runtime_stats
- stats = Primitive.rb_yjit_get_stats
+ def self.runtime_stats(context: false)
+ stats = Primitive.rb_yjit_get_stats(context)
return stats if stats.nil?
stats[:object_shape_count] = Primitive.object_shape_count
@@ -233,7 +233,7 @@ module RubyVM::YJIT
# Format and print out counters
def _print_stats # :nodoc:
- stats = runtime_stats
+ stats = runtime_stats(context: true)
return unless stats
$stderr.puts("***YJIT: Printing YJIT statistics on exit***")
@@ -277,6 +277,8 @@ module RubyVM::YJIT
$stderr.puts "freed_code_size: " + format_number(13, stats[:freed_code_size])
$stderr.puts "code_region_size: " + format_number(13, stats[:code_region_size])
$stderr.puts "yjit_alloc_size: " + format_number(13, stats[:yjit_alloc_size]) if stats.key?(:yjit_alloc_size)
+ $stderr.puts "live_context_size: " + format_number(13, stats[:live_context_size])
+ $stderr.puts "live_context_count: " + format_number(13, stats[:live_context_count])
$stderr.puts "live_page_count: " + format_number(13, stats[:live_page_count])
$stderr.puts "freed_page_count: " + format_number(13, stats[:freed_page_count])
$stderr.puts "code_gc_count: " + format_number(13, stats[:code_gc_count])