Skip to main content

PerfettoTraceBuilder

Struct PerfettoTraceBuilder 

Source
pub struct PerfettoTraceBuilder { /* private fields */ }
Expand description

State for a trace builder instance.

Implementations§

Source§

impl PerfettoTraceBuilder

Source

pub fn new() -> Self

Create a Perfetto trace builder.

Each trace builder instance will use a unique TrustedPacketSequenceId when creating packets.

Source

pub fn build_enter_exit_track_descriptor_trace_packet( &mut self, current_time_ns: u64, id: Id, parent: Id, name: &str, ) -> TracePacket

Build a TracePacket containing the TrackDescriptor for crate::tracker::Track::enter and crate::tracker::Track::exit events (using an incremental counter).

Source

pub fn build_value_track_descriptor_trace_packet( &mut self, current_time_ns: u64, id: Id, parent: Id, name: &str, ) -> TracePacket

Build a TracePacket containing the TrackDescriptor for a sequence of crate::tracker::Track::values.

Source

pub fn build_activity_track_descriptor_trace_packet( &mut self, current_time_ns: u64, id: Id, parent: Id, name: &str, ) -> TracePacket

Build a TracePacket containing the TrackDescriptor for activity slices denoted by crate::tracker::Track::begin_activity and crate::tracker::Track::end_activity events.

Source

pub fn build_enter_track_event_trace_packet( &self, current_time_ns: u64, id: Id, other: Id, ) -> TracePacket

Build a TracePacket containing a TrackEvent to represent an crate::tracker::Track::enter event (as an incremental counter update).

Source

pub fn build_exit_track_event_trace_packet( &self, current_time_ns: u64, id: Id, other: Id, ) -> TracePacket

Build a TracePacket containing a TrackEvent to represent an crate::tracker::Track::exit event (as an incremental counter update).

Source

pub fn build_value_track_event_trace_packet( &self, current_time_ns: u64, id: Id, value: f64, ) -> TracePacket

Build a TracePacket containing the TrackEvent for a floating point crate::tracker::Track::value.

Source

pub fn build_activity_begin_trace_packet( &self, current_time_ns: u64, id: Id, name: &str, correlation_id: Option<u64>, ) -> TracePacket

Build a TracePacket containing the TrackEvent for a crate::tracker::Track::begin_activity SliceBegin event.

Source

pub fn build_activity_end_trace_packet( &self, current_time_ns: u64, id: Id, ) -> TracePacket

Build a TracePacket containing the TrackEvent for a crate::tracker::Track::end_activity SliceEnd event.

Source

pub fn build_trace_to_bytes(&self, trace_packets: Vec<TracePacket>) -> Vec<u8>

Build a Trace message containing the passed TracePackets and serialise it to unsigned bytes.

Trait Implementations§

Source§

impl Default for PerfettoTraceBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.