Enum CallgraphStrategy
pub enum CallgraphStrategy {
None,
Dwarf,
LastBranchRecord,
ShadowCallStack,
FramePointer,
// some variants omitted
}
Expand description
Various approaches to obtaining a backtrace
Variants§
None
Don’t try to get a callgraph
Dwarf
Copy out stack memory and attempt to parse the DWARF info. This is the slowest and most memory intensive of the approaches, but gives the most accurate callgraphs. Parsing dwarf allows the callgraph to trace inlined and leaf functions which other approaches do not support.
LastBranchRecord
Intel CPUs support a hardware feature called Last Branch Records (LBR)s which record up to the last 32 calls made depending on hardware version. On supported CPUs, this is a low overhead approach to finding the callgraph with the caveat that stacks that exceed 32 calls in depth will overflow the hardware buffer.
ShadowCallStack
arm and riscv support shadow call stacks which are an efficient way for us to find and copy out the call stack. However, leaf functions and code compiled without shadow callstack support, such as the vdso will not appear in the returned callgraph.
FramePointer
A general approach of parsing the frame pointers of the callstack. Frame pointers are supported across architectures and are slightly more expensive than the lbrs or shadow call stacks, but much cheaper than parsing dwarf. Code compiled with omitted frame pointers and inlined functions will not appear in the resulting stacks.
Implementations§
§impl CallgraphStrategy
impl CallgraphStrategy
pub fn from_primitive(prim: u8) -> Option<CallgraphStrategy>
pub fn from_primitive_allow_unknown(prim: u8) -> CallgraphStrategy
pub fn unknown() -> CallgraphStrategy
pub const fn into_primitive(self) -> u8
pub fn is_unknown(&self) -> bool
Trait Implementations§
§impl Clone for CallgraphStrategy
impl Clone for CallgraphStrategy
§fn clone(&self) -> CallgraphStrategy
fn clone(&self) -> CallgraphStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for CallgraphStrategy
impl Debug for CallgraphStrategy
§impl<D> Decode<CallgraphStrategy, D> for CallgraphStrategywhere
D: ResourceDialect,
impl<D> Decode<CallgraphStrategy, D> for CallgraphStrategywhere
D: ResourceDialect,
§fn new_empty() -> CallgraphStrategy
fn new_empty() -> CallgraphStrategy
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl<D> Encode<CallgraphStrategy, D> for CallgraphStrategywhere
D: ResourceDialect,
impl<D> Encode<CallgraphStrategy, D> for CallgraphStrategywhere
D: ResourceDialect,
§impl Hash for CallgraphStrategy
impl Hash for CallgraphStrategy
§impl Ord for CallgraphStrategy
impl Ord for CallgraphStrategy
§fn cmp(&self, other: &CallgraphStrategy) -> Ordering
fn cmp(&self, other: &CallgraphStrategy) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for CallgraphStrategy
impl PartialEq for CallgraphStrategy
§impl PartialOrd for CallgraphStrategy
impl PartialOrd for CallgraphStrategy
§impl TypeMarker for CallgraphStrategy
impl TypeMarker for CallgraphStrategy
§type Owned = CallgraphStrategy
type Owned = CallgraphStrategy
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.§impl ValueTypeMarker for CallgraphStrategy
impl ValueTypeMarker for CallgraphStrategy
§type Borrowed<'a> = CallgraphStrategy
type Borrowed<'a> = CallgraphStrategy
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<CallgraphStrategy as TypeMarker>::Owned,
) -> <CallgraphStrategy as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<CallgraphStrategy as TypeMarker>::Owned, ) -> <CallgraphStrategy as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.