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 TrackEvent
s 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:
-
If
sibling_merge_behavior
is set toSIBLING_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.
-
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,
TrackDescriptor
s are processed during a “tokenization” phase, which occurs before anyTrackEvent
s 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 firstTrackDescriptor
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
impl StaticOrDynamicName
Sourcepub fn merge<B>(
field: &mut Option<StaticOrDynamicName>,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext,
) -> Result<(), DecodeError>where
B: Buf,
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.
Sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Trait Implementations§
Source§impl Clone for StaticOrDynamicName
impl Clone for StaticOrDynamicName
Source§fn clone(&self) -> StaticOrDynamicName
fn clone(&self) -> StaticOrDynamicName
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more