fix: 采样样本记表代际,直方图按代际解析函数名并订正并列注释

This commit is contained in:
2026-10-04 22:55:06 +00:00
parent fce50e3f64
commit 8e6703e606
3 changed files with 36 additions and 30 deletions
+9 -5
View File
@@ -235,12 +235,16 @@ impl Vm {
}
// 指令周期采样:开启时(周期为 2 的幂)每 period 条指令记一条样本
// (flat_id, pc, opcode, frames 深度),run 末聚合成 top-K 直方图;
// 关闭时仅这一条可预测分支,零写零分配。
// (flat_id, pc, opcode, frames 深度, 表代际),run 末聚合成 top-K
// 直方图;关闭时仅这一条可预测分支,零写零分配。
if self.sampling.period != 0 && (steps & (self.sampling.period - 1)) == 0 {
self.sampling
.records
.push((self.active_flat_id, pc as u32, op as u8, self.frames.len() as u32));
self.sampling.records.push((
self.active_flat_id,
pc as u32,
op as u8,
self.frames.len() as u32,
self.active_table_gen,
));
}
match op {