pub struct TrackDescriptor {
pub uuid: Option<u64>,
pub parent_uuid: Option<u64>,
pub process: Option<ProcessDescriptor>,
pub chrome_process: Option<ChromeProcessDescriptor>,
pub thread: Option<ThreadDescriptor>,
pub chrome_thread: Option<ChromeThreadDescriptor>,
pub counter: Option<CounterDescriptor>,
pub disallow_merging_with_system_tracks: Option<bool>,
pub static_or_dynamic_name: Option<StaticOrDynamicName>,
}
Expand description
Defines a track for TrackEvents. Slices and instant events on the same track will be nested based on their timestamps, see TrackEvent::Type.
A TrackDescriptor only needs to be emitted by one trace writer / producer and is valid for the entirety of the trace. To ensure the descriptor isn’t lost when the ring buffer wraps, it should be reemitted whenever incremental state is cleared.
As a fallback, TrackEvents emitted without an explicit track association will be associated with an implicit trace-global track (uuid = 0), see also |TrackEvent::track_uuid|. It is possible but not necessary to emit a TrackDescriptor for this implicit track.
Next id: 11.
Fields§
§uuid: Option<u64>
Unique ID that identifies this track. This ID is global to the whole trace. Producers should ensure that it is unlikely to clash with IDs emitted by other producers. A value of 0 denotes the implicit trace-global track.
For example, legacy TRACE_EVENT macros may use a hash involving the async event id + id_scope, pid, and/or tid to compute this ID.
parent_uuid: Option<u64>
A parent track reference can be used to describe relationships between tracks. For example, to define an asynchronous track which is scoped to a specific process, specify the uuid for that process’s process track here. Similarly, to associate a COUNTER_THREAD_TIME_NS counter track with a thread, specify the uuid for that thread’s thread track here.
process: Option<ProcessDescriptor>
Associate the track with a process, making it the process-global track. There should only be one such track per process (usually for instant events; trace processor uses this fact to detect pid reuse). If you need more (e.g. for asynchronous events), create child tracks using parent_uuid.
Trace processor will merge events on a process track with slice-type events from other sources (e.g. ftrace) for the same process into a single timeline view.
chrome_process: Option<ChromeProcessDescriptor>
§thread: Option<ThreadDescriptor>
Associate the track with a thread, indicating that the track’s events describe synchronous code execution on the thread. There should only be one such track per thread (trace processor uses this fact to detect tid reuse).
Trace processor will merge events on a thread track with slice-type events from other sources (e.g. ftrace) for the same thread into a single timeline view.
chrome_thread: Option<ChromeThreadDescriptor>
§counter: Option<CounterDescriptor>
Descriptor for a counter track. If set, the track will only support TYPE_COUNTER TrackEvents (and values provided via TrackEvent’s |extra_counter_values|).
disallow_merging_with_system_tracks: Option<bool>
If true, forces Trace Processor to use separate tracks for track events and system events for the same thread. Track events timestamps in Chrome have microsecond resolution, while system events use nanoseconds. It results in broken event nesting when track events and system events share a track.
static_or_dynamic_name: Option<StaticOrDynamicName>
Name of the track. Optional - if unspecified, it may be derived from the process/thread name (process/thread tracks), the first event’s name (async tracks), or counter name (counter tracks).
Implementations§
Source§impl TrackDescriptor
impl TrackDescriptor
Sourcepub fn parent_uuid(&self) -> u64
pub fn parent_uuid(&self) -> u64
Returns the value of parent_uuid
, or the default value if parent_uuid
is unset.
Sourcepub fn disallow_merging_with_system_tracks(&self) -> bool
pub fn disallow_merging_with_system_tracks(&self) -> bool
Returns the value of disallow_merging_with_system_tracks
, or the default value if disallow_merging_with_system_tracks
is unset.
Trait Implementations§
Source§impl Clone for TrackDescriptor
impl Clone for TrackDescriptor
Source§fn clone(&self) -> TrackDescriptor
fn clone(&self) -> TrackDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TrackDescriptor
impl Debug for TrackDescriptor
Source§impl Default for TrackDescriptor
impl Default for TrackDescriptor
Source§impl Message for TrackDescriptor
impl Message for TrackDescriptor
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.