AndroidTraceLog

Struct AndroidTraceLog 

Source
pub struct AndroidTraceLog {
    pub data_file_overflow: bool,
    pub clock: Clock,
    pub elapsed_time: Duration,
    pub total_method_calls: u64,
    pub clock_call_overhead: Duration,
    pub vm: Vm,
    pub start_time: DateTime<Utc>,
    pub pid: Option<u32>,
    pub gc_trace: Option<GcTrace>,
    pub threads: Vec<Thread>,
    pub methods: Vec<Method>,
    pub events: Vec<Event>,
}
Expand description

Android trace log

Fields§

§data_file_overflow: bool

Whether the trace has overflowed the trace buffer and is missing events

§clock: Clock

The clock used for the events

§elapsed_time: Duration

Total recording duration

§total_method_calls: u64

Total number of calls registered

§clock_call_overhead: Duration

The approximate trace overhead per call

§vm: Vm

The process VM used

§start_time: DateTime<Utc>

Trace start time

§pid: Option<u32>

PID of the traced process

§gc_trace: Option<GcTrace>

If GC is being tracked, contains the GC trace info

§threads: Vec<Thread>

All threads in the trace log

§methods: Vec<Method>

All methods in the trace log

§events: Vec<Event>

All events in the trace log

Implementations§

Source§

impl AndroidTraceLog

Source

pub fn valid(&self) -> bool

Verifies the object can be serialized and iterated over

Source

pub fn serialize_into<W: Write>(&self, w: &mut W) -> Result<()>

Serialize the trace into a Write object

§Panics

Panics if using global clock (only used in file version 1) with 2-byte thread IDs (only used in file version 2+) or if some event’s time doesn’t match the trace’s clock value. Will not panic if valid returned true.

Source

pub fn serialize(&self) -> Result<Vec<u8>>

Serialize the trace into a byte array. Can panic if the log is invalid; see serialize_into

Source

pub fn iter(&self) -> impl Iterator<Item = EventView<'_>>

Iterate over all events while preparing an event view that allows to quickly access an event’s thread and method. Has some startup time due to needing to prepare method/thread lookup tables.

Panics if an event has an invalid method/thread ID. Will not panic if valid returned true.

Trait Implementations§

Source§

impl Clone for AndroidTraceLog

Source§

fn clone(&self) -> AndroidTraceLog

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AndroidTraceLog

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AndroidTraceLog

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for AndroidTraceLog

Source§

fn eq(&self, other: &AndroidTraceLog) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for AndroidTraceLog

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for AndroidTraceLog

Source§

impl StructuralPartialEq for AndroidTraceLog

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,