/// Statistics about the effectiveness of the rule cache. #[derive(Default, Debug, Clone, Copy)] pubstruct CacheStats { /// The number of successful cache hits. pub hit_count: u64, /// The number of cache misses that were due to an empty slot. pub miss_empty_slot_count: u64, /// The number of cache misses that were due to a filled slot whose module /// generation didn't match the unwinder's current module generation. /// (This means that either the unwinder's modules have changed since the /// rule in this slot was stored, or the same cache is used with multiple /// unwinders and the unwinders are stomping on each other's cache slots.) pub miss_wrong_modules_count: u64, /// The number of cache misses that were due to cache slot collisions of /// different addresses. pub miss_wrong_address_count: u64,
}
impl CacheStats { /// Create a new instance. pubfn new() -> Self {
Default::default()
}
/// The number of total lookups. pubfn total(&self) -> u64 { self.hits() + self.misses()
}
/// The number of total hits. pubfn hits(&self) -> u64 { self.hit_count
}
/// The number of total misses. pubfn misses(&self) -> u64 { self.miss_empty_slot_count + self.miss_wrong_modules_count + self.miss_wrong_address_count
}
}
#[cfg(test)] mod tests { usecrate::{aarch64::UnwindRuleAarch64, x86_64::UnwindRuleX86_64};
usesuper::*;
// Ensure that the size of Option<CacheEntry<UnwindRuleX86_64>> doesn't change by accident. #[test] fn test_cache_entry_size() {
assert_eq!(
core::mem::size_of::<Option<CacheEntry<UnwindRuleX86_64>>>(), 16
);
assert_eq!(
core::mem::size_of::<Option<CacheEntry<UnwindRuleAarch64>>>(), 24// <-- larger than we'd like
);
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-19)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.