Skip to content

Commit 11020fb

Browse files
fix: circuit flamegraphs with segmentation (#1571)
The circuit flamegraphs being generated were incorrect due to a bug in the multi-segment execution logic. In particular, each segment takes the metric data from the previous segment, but the first segment was using an empty metrics struct instead of being initialized with the correct `fn_bounds` data.
1 parent bb09f18 commit 11020fb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

crates/vm/src/arch/vm.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ where
178178
);
179179
let pc = exe.pc_start;
180180
let mut state = VmExecutorNextSegmentState::new(memory, input, pc);
181+
182+
#[cfg(feature = "bench-metrics")]
183+
{
184+
state.metrics.fn_bounds = exe.fn_bounds.clone();
185+
}
186+
181187
let mut segment_idx = 0;
182188

183189
loop {

0 commit comments

Comments
 (0)