Skip to content

Commit 1568ba2

Browse files
Show unwinding success percentage (#276)
rather than the whole set of stats, unless there are many failures Test Plan ========= CI
1 parent 862dfc5 commit 1568ba2

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/profiler.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,20 @@ impl Profiler {
10731073
})
10741074
.fold(unwinder_stats_t::default(), |a, b| a + b);
10751075

1076-
info!("unwinder stats: {:?}", total_value);
1076+
let mut raise_log_level = false;
1077+
if total_value.total != 0 {
1078+
let success_pct =
1079+
100.0 * total_value.success_dwarf as f64 / total_value.total as f64;
1080+
info!("stacks successfully unwound: {:.2}%", success_pct);
1081+
if success_pct < 75.0 {
1082+
raise_log_level = true;
1083+
}
1084+
}
1085+
if raise_log_level {
1086+
warn!("unwinder stats: {:?}", total_value);
1087+
} else {
1088+
debug!("unwinder stats: {:?}", total_value);
1089+
}
10771090
}
10781091
}
10791092

0 commit comments

Comments
 (0)