summaryrefslogtreecommitdiff
path: root/yjit.rb
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2023-04-18 07:09:16 -0700
committerGitHub <noreply@github.com>2023-04-18 10:09:16 -0400
commit2dff1d4fdabd0fafeeac675baaaf7b06bb3150f9 (patch)
tree222beb26cb8855103700fe880ccf32e518f3f89e /yjit.rb
parentd8a6db7292e8c92540f3dd2c939508ca1dd8cc41 (diff)
downloadruby-2dff1d4fdabd0fafeeac675baaaf7b06bb3150f9.tar.gz
YJIT: Fix raw sample stack lengths in exit traces (#7728)
yjit-trace-exits appends a synthetic sample for the instruction being exited, but we didn't increment the size of the stack. Fixing this count correctly lets us successfully generate a flamegraph from the exits. I also replaced the line number for instructions with 0, as I don't think the previous value had meaning. Co-authored-by: Adam Hess <HParker@github.com>
Diffstat (limited to 'yjit.rb')
-rw-r--r--yjit.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/yjit.rb b/yjit.rb
index 60a263c322..b2af7ef0be 100644
--- a/yjit.rb
+++ b/yjit.rb
@@ -67,7 +67,7 @@ module RubyVM::YJIT
# [ length, line_1, line_2, line_n, ..., dummy value, count
i = 0
while i < raw_samples.length
- stack_length = raw_samples[i] + 1
+ stack_length = raw_samples[i]
i += 1 # consume the stack length
sample_count = raw_samples[i + stack_length]