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§
Source§impl CallgraphStrategy
impl CallgraphStrategy
pub fn from_primitive(prim: u8) -> Option<Self>
pub fn from_primitive_allow_unknown(prim: u8) -> Self
pub fn unknown() -> Self
pub const fn into_primitive(self) -> u8
pub fn is_unknown(&self) -> bool
Trait Implementations§
Source§impl Clone for CallgraphStrategy
impl Clone for CallgraphStrategy
Source§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 moreSource§impl Debug for CallgraphStrategy
impl Debug for CallgraphStrategy
Source§impl<D: ResourceDialect> Decode<CallgraphStrategy, D> for CallgraphStrategy
impl<D: ResourceDialect> Decode<CallgraphStrategy, D> for CallgraphStrategy
Source§impl<D: ResourceDialect> Encode<CallgraphStrategy, D> for CallgraphStrategy
impl<D: ResourceDialect> Encode<CallgraphStrategy, D> for CallgraphStrategy
Source§impl Hash for CallgraphStrategy
impl Hash for CallgraphStrategy
Source§impl Ord for CallgraphStrategy
impl Ord for CallgraphStrategy
Source§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,
Source§impl PartialEq for CallgraphStrategy
impl PartialEq for CallgraphStrategy
Source§impl PartialOrd for CallgraphStrategy
impl PartialOrd for CallgraphStrategy
Source§impl TypeMarker for CallgraphStrategy
impl TypeMarker for CallgraphStrategy
Source§type Owned = CallgraphStrategy
type Owned = CallgraphStrategy
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.Source§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 moreSource§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.Source§impl ValueTypeMarker for CallgraphStrategy
impl ValueTypeMarker for CallgraphStrategy
Source§type Borrowed<'a> = CallgraphStrategy
type Borrowed<'a> = CallgraphStrategy
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more