From 2dff1d4fdabd0fafeeac675baaaf7b06bb3150f9 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Tue, 18 Apr 2023 07:09:16 -0700 Subject: 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 --- yjit/src/stats.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'yjit/src') diff --git a/yjit/src/stats.rs b/yjit/src/stats.rs index cc7f71b9bc..bf90b233f7 100644 --- a/yjit/src/stats.rs +++ b/yjit/src/stats.rs @@ -724,10 +724,8 @@ pub extern "C" fn rb_yjit_record_exit_stack(exit_pc: *const VALUE) // Push the insn value into the yjit_raw_samples Vec. yjit_raw_samples.push(VALUE(insn as usize)); - // Push the current line onto the yjit_line_samples Vec. This - // points to the line in insns.def. - let line = yjit_line_samples.len() - 1; - yjit_line_samples.push(line as i32); + // We don't know the line + yjit_line_samples.push(0); // Push number of times seen onto the stack, which is 1 // because it's the first time we've seen it. -- cgit v1.2.1