diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2023-10-19 13:41:38 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2023-10-19 15:14:20 -0400 |
commit | 9047fe5ea4e8c989c1081aa10f741a413c546534 (patch) | |
tree | c35e4e3e9bc5d2dbbcd01c511ccfa41c6c5a7203 /yjit.rb | |
parent | cdc2a18541a42e63a8a0a3c2c5b72978ace01afa (diff) |
YJIT: Print exit reasons on failure in test_yjit.rb
For <https://bugs.ruby-lang.org/issues/19921>, I suspect the test is
failing due to a timing related interrupt, which on paper could
happen with slow-enough GC runs.
In any case, it's helpful for debugging to have more information when
tests fail.
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Diffstat (limited to 'yjit.rb')
-rw-r--r-- | yjit.rb | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -245,13 +245,8 @@ module RubyVM::YJIT $stderr.puts("YJIT exit locations dumped to `#{filename}`.") end - # Format and print out counters - def _print_stats(out: $stderr) # :nodoc: - stats = runtime_stats(context: true) - return unless Primitive.rb_yjit_stats_enabled_p - - out.puts("***YJIT: Printing YJIT statistics on exit***") - + # Print a summary of reasons for adverse performance events (e.g. exits) + def _print_stats_reasons(stats, out) # :nodoc: print_counters(stats, out: out, prefix: 'send_', prompt: 'method call fallback reasons: ') print_counters(stats, out: out, prefix: 'invokeblock_', prompt: 'invokeblock fallback reasons: ') print_counters(stats, out: out, prefix: 'invokesuper_', prompt: 'invokesuper fallback reasons: ') @@ -286,6 +281,16 @@ module RubyVM::YJIT end print_counters(stats, out: out, prefix: 'lshift_', prompt: 'left shift (ltlt) exit reasons: ') print_counters(stats, out: out, prefix: 'invalidate_', prompt: 'invalidation reasons: ') + end + + # Format and print out counters + def _print_stats(out: $stderr) # :nodoc: + stats = runtime_stats(context: true) + return unless Primitive.rb_yjit_stats_enabled_p + + out.puts("***YJIT: Printing YJIT statistics on exit***") + + _print_stats_reasons(stats, out) # Number of failed compiler invocations compilation_failure = stats[:compilation_failure] |