#[non_exhaustive]pub enum CallgrindMetrics {
Show 13 variants
Default,
CacheMisses,
CacheMissRates,
CacheHits,
CacheHitRates,
CacheSim,
CacheUse,
SystemCalls,
BranchSim,
WriteBackBehaviour,
All,
None,
SingleEvent(EventKind),
}api only.Expand description
A collection of groups of EventKinds
Callgrind supports a large amount of metrics and their collection can be enabled with various
command-line flags. CallgrindMetrics groups these metrics to make it less cumbersome to
specify multiple EventKinds at once if necessary.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Default
The default group contains all event kinds except the CallgrindMetrics::CacheMisses,
CallgrindMetrics::CacheMissRates, CallgrindMetrics::CacheHitRates and
EventKind::Dr, EventKind::Dw. More specifically, the following event kinds and
groups in this order:
use iai_callgrind::{CallgrindMetrics, EventKind};
let metrics: Vec<CallgrindMetrics> = vec![
EventKind::Ir.into(),
CallgrindMetrics::CacheHits,
EventKind::TotalRW.into(),
EventKind::EstimatedCycles.into(),
CallgrindMetrics::SystemCalls,
EventKind::Ge.into(),
CallgrindMetrics::BranchSim,
CallgrindMetrics::WriteBackBehaviour,
CallgrindMetrics::CacheUse,
];CacheMisses
The CacheMisses produced by --cache-sim=yes contain the following EventKinds in
this order:
use iai_callgrind::{CallgrindMetrics, EventKind};
let metrics: Vec<CallgrindMetrics> = vec![
EventKind::I1mr.into(),
EventKind::D1mr.into(),
EventKind::D1mw.into(),
EventKind::ILmr.into(),
EventKind::DLmr.into(),
EventKind::DLmw.into(),
];CacheMissRates
The cache miss rates calculated from the CallgrindMetrics::CacheMisses produced by
--cache-sim:
use iai_callgrind::{CallgrindMetrics, EventKind};
let metrics: Vec<CallgrindMetrics> = vec![
EventKind::I1MissRate.into(),
EventKind::D1MissRate.into(),
EventKind::LLiMissRate.into(),
EventKind::LLdMissRate.into(),
EventKind::LLMissRate.into(),
];CacheHits
CacheHits are iai-callgrind specific and calculated from the metrics produced by
--cache-sim=yes in this order:
use iai_callgrind::{CallgrindMetrics, EventKind};
let metrics: Vec<CallgrindMetrics> = vec![
EventKind::L1hits.into(),
EventKind::LLhits.into(),
EventKind::RamHits.into(),
];CacheHitRates
The cache hit rates calculated from the CallgrindMetrics::CacheHits:
use iai_callgrind::{CallgrindMetrics, EventKind};
let metrics: Vec<CallgrindMetrics> = vec![
EventKind::L1HitRate.into(),
EventKind::LLHitRate.into(),
EventKind::RamHitRate.into(),
];CacheSim
All metrics produced by --cache-sim=yes including the iai-callgrind specific metrics
EventKind::L1hits, EventKind::LLhits, EventKind::RamHits,
EventKind::TotalRW, EventKind::EstimatedCycles and miss/hit rates in this order:
use iai_callgrind::{CallgrindMetrics, EventKind};
let metrics: Vec<CallgrindMetrics> = vec![
EventKind::Dr.into(),
EventKind::Dw.into(),
CallgrindMetrics::CacheMisses,
CallgrindMetrics::CacheMissRates,
CallgrindMetrics::CacheHits,
EventKind::TotalRW.into(),
CallgrindMetrics::CacheHitRates,
EventKind::EstimatedCycles.into(),
];CacheUse
The metrics produced by --cacheuse=yes in this order:
use iai_callgrind::{CallgrindMetrics, EventKind};
let metrics: Vec<CallgrindMetrics> = vec![
EventKind::AcCost1.into(),
EventKind::AcCost2.into(),
EventKind::SpLoss1.into(),
EventKind::SpLoss2.into(),
];SystemCalls
SystemCalls are events of the --collect-systime=yes option in this order:
use iai_callgrind::{CallgrindMetrics, EventKind};
let metrics: Vec<CallgrindMetrics> = vec![
EventKind::SysCount.into(),
EventKind::SysTime.into(),
EventKind::SysCpuTime.into(),
];BranchSim
The metrics produced by --branch-sim=yes in this order:
use iai_callgrind::{CallgrindMetrics, EventKind};
let metrics: Vec<CallgrindMetrics> = vec![
EventKind::Bc.into(),
EventKind::Bcm.into(),
EventKind::Bi.into(),
EventKind::Bim.into(),
];WriteBackBehaviour
All metrics of --simulate-wb=yes in this order:
use iai_callgrind::{CallgrindMetrics, EventKind};
let metrics: Vec<CallgrindMetrics> = vec![
EventKind::ILdmr.into(),
EventKind::DLdmr.into(),
EventKind::DLdmw.into(),
];All
All possible EventKinds in this order:
use iai_callgrind::{CallgrindMetrics, EventKind};
let metrics: Vec<CallgrindMetrics> = vec![
EventKind::Ir.into(),
CallgrindMetrics::CacheSim,
CallgrindMetrics::SystemCalls,
EventKind::Ge.into(),
CallgrindMetrics::BranchSim,
CallgrindMetrics::WriteBackBehaviour,
CallgrindMetrics::CacheUse,
];None
Selection of no EventKind at all
SingleEvent(EventKind)
Specify a single EventKind.
Note that EventKind implements the necessary traits to convert to the
CallgrindMetrics::SingleEvent variant which is shorter to write.
§Examples
use iai_callgrind::{CallgrindMetrics, EventKind};
assert_eq!(
CallgrindMetrics::SingleEvent(EventKind::Ir),
EventKind::Ir.into()
);Trait Implementations§
Source§impl Clone for CallgrindMetrics
impl Clone for CallgrindMetrics
Source§fn clone(&self) -> CallgrindMetrics
fn clone(&self) -> CallgrindMetrics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CallgrindMetrics
impl Debug for CallgrindMetrics
Source§impl Default for CallgrindMetrics
impl Default for CallgrindMetrics
Source§fn default() -> CallgrindMetrics
fn default() -> CallgrindMetrics
Source§impl<'de> Deserialize<'de> for CallgrindMetrics
impl<'de> Deserialize<'de> for CallgrindMetrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<CallgrindMetrics> for IndexSet<EventKind>
Available on crate feature runner only.
impl From<CallgrindMetrics> for IndexSet<EventKind>
runner only.Source§fn from(value: CallgrindMetrics) -> Self
fn from(value: CallgrindMetrics) -> Self
Source§impl From<EventKind> for CallgrindMetrics
impl From<EventKind> for CallgrindMetrics
Source§impl FromStr for CallgrindMetrics
Available on crate feature runner only.
impl FromStr for CallgrindMetrics
runner only.Source§impl Ord for CallgrindMetrics
impl Ord for CallgrindMetrics
Source§fn cmp(&self, other: &CallgrindMetrics) -> Ordering
fn cmp(&self, other: &CallgrindMetrics) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CallgrindMetrics
impl PartialEq for CallgrindMetrics
Source§impl PartialOrd for CallgrindMetrics
impl PartialOrd for CallgrindMetrics
Source§impl Serialize for CallgrindMetrics
impl Serialize for CallgrindMetrics
impl Copy for CallgrindMetrics
impl Eq for CallgrindMetrics
impl StructuralPartialEq for CallgrindMetrics
Auto Trait Implementations§
impl Freeze for CallgrindMetrics
impl RefUnwindSafe for CallgrindMetrics
impl Send for CallgrindMetrics
impl Sync for CallgrindMetrics
impl Unpin for CallgrindMetrics
impl UnwindSafe for CallgrindMetrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more