Enum StaticOrDynamicName

Source
pub enum StaticOrDynamicName {
    Name(String),
    StaticName(String),
    AtraceName(String),
}
Expand description

Name of the track.

Optional but strongly recommended to be specified in a TrackDescriptor emitted before any TrackEvents on the same track.

Note: any name specified here will be ignored for the root thread scoped tracks when disallow_merging_with_system_tracks is not set, as in this case, the name of the track is shared by many different data sources and so is centrally controlled by trace processor.

It’s strongly recommended to only emit the name for a track uuid once. If a descriptor has to be emitted multiple times (e.g. between different processes), it’s recommended to ensure that the name is consistent across all TrackDescriptors with the same uuid.

If the the above recommendation is not followed and the same uuid is emitted with different names, it is implementation defined how the final name will be chosen and may change at any time.

The current implementation of trace processor chooses the name in the following way, depending on the value of the sibling_merge_behavior field:

  1. If sibling_merge_behavior is set to SIBLING_MERGE_BEHAVIOR_NONE:

    • The last non-null name in the whole trace according to trace order will be used.
    • If no non-null name is present in the whole trace, the trace processor may fall back to other sources to provide a name for the track (e.g. the first event name for slice tracks, the counter name for counter tracks). This is implementation defined and may change at any time.
  2. If sibling_merge_behavior is set to any other value:

    • The first non-null name before the first event on the track or on any descendant tracks is processed will be used. For example, consider the following sequence of events: ts=100: TrackDescriptor(uuid=A) ts=200: TrackDescriptor(uuid=B, parent_uuid=A) ts=300: TrackDescriptor(uuid=A, name=“Track A”) ts=400: TrackEvent(track_uuid=B) In this case, the name for track A will be “Track A” because the descriptor with the name was emitted before the first event on a descendant track (B).
    • If no non-null name is present before the event is processed, the trace processor may fall back to other sources to provide a name for the track (e.g. the first event name for slice tracks, the counter name for counter tracks). This is implementation defined and may change at any time.
    • Note on processing order: In the standard trace processor pipeline, TrackDescriptors are processed during a “tokenization” phase, which occurs before any TrackEvents are parsed. This means that for a given track, all its descriptors in the trace are processed before its events. Consequently, the “first non-null name before the first event” will be the name from the first TrackDescriptor for that track in the trace file that has a non-null name. However, in a streaming parsing scenario, the timestamp order of descriptors and events is significant, and a descriptor arriving after an event has been processed will not be used to name the track.

Variants§

§

Name(String)

§

StaticName(String)

This field is only set by the SDK when perfetto::StaticString is provided.

§

AtraceName(String)

Equivalent to name, used just to mark that the data is coming from android.os.Trace.

Implementations§

Source§

impl StaticOrDynamicName

Source

pub fn encode<B>(&self, buf: &mut B)
where B: BufMut,

Encodes the message to a buffer.

Source

pub fn merge<B>( field: &mut Option<StaticOrDynamicName>, tag: u32, wire_type: WireType, buf: &mut B, ctx: DecodeContext, ) -> Result<(), DecodeError>
where B: Buf,

Decodes an instance of the message from a buffer, and merges it into self.

Source

pub fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.

Trait Implementations§

Source§

impl Clone for StaticOrDynamicName

Source§

fn clone(&self) -> StaticOrDynamicName

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 StaticOrDynamicName

Source§

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

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

impl PartialEq for StaticOrDynamicName

Source§

fn eq(&self, other: &StaticOrDynamicName) -> 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 StructuralPartialEq for StaticOrDynamicName

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.