pub struct TrackEvent {Show 37 fields
pub category_iids: Vec<u64>,
pub categories: Vec<String>,
pub type: Option<i32>,
pub track_uuid: Option<u64>,
pub extra_counter_track_uuids: Vec<u64>,
pub extra_counter_values: Vec<i64>,
pub extra_double_counter_track_uuids: Vec<u64>,
pub extra_double_counter_values: Vec<f64>,
pub flow_ids_old: Vec<u64>,
pub flow_ids: Vec<u64>,
pub terminating_flow_ids_old: Vec<u64>,
pub terminating_flow_ids: Vec<u64>,
pub debug_annotations: Vec<DebugAnnotation>,
pub task_execution: Option<TaskExecution>,
pub log_message: Option<LogMessage>,
pub cc_scheduler_state: Option<ChromeCompositorSchedulerState>,
pub chrome_user_event: Option<ChromeUserEvent>,
pub chrome_keyed_service: Option<ChromeKeyedService>,
pub chrome_legacy_ipc: Option<ChromeLegacyIpc>,
pub chrome_histogram_sample: Option<ChromeHistogramSample>,
pub chrome_latency_info: Option<ChromeLatencyInfo>,
pub chrome_frame_reporter: Option<ChromeFrameReporter>,
pub chrome_application_state_info: Option<ChromeApplicationStateInfo>,
pub chrome_renderer_scheduler_state: Option<ChromeRendererSchedulerState>,
pub chrome_window_handle_event_info: Option<ChromeWindowHandleEventInfo>,
pub chrome_content_settings_event_info: Option<ChromeContentSettingsEventInfo>,
pub chrome_active_processes: Option<ChromeActiveProcesses>,
pub screenshot: Option<Screenshot>,
pub chrome_message_pump: Option<ChromeMessagePump>,
pub chrome_mojo_event_info: Option<ChromeMojoEventInfo>,
pub legacy_event: Option<LegacyEvent>,
pub name_field: Option<NameField>,
pub counter_value_field: Option<CounterValueField>,
pub source_location_field: Option<SourceLocationField>,
pub timestamp: Option<Timestamp>,
pub thread_time: Option<ThreadTime>,
pub thread_instruction_count: Option<ThreadInstructionCount>,
}
Expand description
Trace events emitted by client instrumentation library (TRACE_EVENT macros), which describe activity on a track, such as a thread or asynchronous event track. The track is specified using separate TrackDescriptor messages and referred to via the track’s UUID.
A simple TrackEvent packet specifies a timestamp, category, name and type:
trace_packet {
timestamp: 1000
track_event {
categories: \["my_cat"\]
name: "my_event"
type: TYPE_INSTANT
}
}
To associate an event with a custom track (e.g. a thread), the track is defined in a separate packet and referred to from the TrackEvent by its UUID:
trace_packet {
track_descriptor {
track_uuid: 1234
name: "my_track"
// Optionally, associate the track with a thread.
thread_descriptor {
pid: 10
tid: 10
..
}
}
}
A pair of TYPE_SLICE_BEGIN and _END events form a slice on the track:
trace_packet {
timestamp: 1200
track_event {
track_uuid: 1234
categories: \["my_cat"\]
name: "my_slice"
type: TYPE_SLICE_BEGIN
}
}
trace_packet {
timestamp: 1400
track_event {
track_uuid: 1234
type: TYPE_SLICE_END
}
}
TrackEvents also support optimizations to reduce data repetition and encoded data size, e.g. through data interning (names, categories, …) and delta encoding of timestamps/counters. For details, see the InternedData message. Further, default values for attributes of events on the same sequence (e.g. their default track association) can be emitted as part of a TrackEventDefaults message.
Next reserved id: 13 (up to 15). Next id: 52.
Fields§
§category_iids: Vec<u64>
Names of categories of the event. In the client library, categories are a way to turn groups of individual events on or off. interned EventCategoryName.
categories: Vec<String>
non-interned variant.
type: Option<i32>
§track_uuid: Option<u64>
Identifies the track of the event. The default value may be overridden using TrackEventDefaults, e.g., to specify the track of the TraceWriter’s sequence (in most cases sequence = one thread). If no value is specified here or in TrackEventDefaults, the TrackEvent will be associated with an implicit trace-global track (uuid 0). See TrackDescriptor::uuid.
extra_counter_track_uuids: Vec<u64>
To encode counter values more efficiently, we support attaching additional counter values to a TrackEvent of any type. All values will share the same timestamp specified in the TracePacket. The value at extra_counter_values[N] is for the counter track referenced by extra_counter_track_uuids[N].
|extra_counter_track_uuids| may also be set via TrackEventDefaults. There should always be equal or more uuids than values. It is valid to set more uuids (e.g. via defaults) than values. If uuids are specified in TrackEventDefaults and a TrackEvent, the TrackEvent uuids override the default uuid list.
For example, this allows snapshotting the thread time clock at each thread-track BEGIN and END event to capture the cpu time delta of a slice.
extra_counter_values: Vec<i64>
§extra_double_counter_track_uuids: Vec<u64>
Counter snapshots using floating point instead of integer values.
extra_double_counter_values: Vec<f64>
§flow_ids_old: Vec<u64>
IDs of flows originating, passing through, or ending at this event. Flow IDs are global within a trace.
A flow connects a sequence of TrackEvents within or across tracks, e.g. an input event may be handled on one thread but cause another event on a different thread - a flow between the two events can associate them.
The direction of the flows between events is inferred from the events’ timestamps. The earliest event with the same flow ID becomes the source of the flow. Any events thereafter are intermediate steps of the flow, until the flow terminates at the last event with the flow ID.
Flows can also be explicitly terminated (see |terminating_flow_ids|), so that the same ID can later be reused for another flow. DEPRECATED. Only kept for backwards compatibility. Use |flow_ids|.
flow_ids: Vec<u64>
TODO(b/204341740): replace “flow_ids_old” with “flow_ids” to reduce memory consumption.
terminating_flow_ids_old: Vec<u64>
List of flow ids which should terminate on this event, otherwise same as |flow_ids|. Any one flow ID should be either listed as part of |flow_ids| OR |terminating_flow_ids|, not both. DEPRECATED. Only kept for backwards compatibility. Use |terminating_flow_ids|.
terminating_flow_ids: Vec<u64>
TODO(b/204341740): replace “terminating_flow_ids_old” with “terminating_flow_ids” to reduce memory consumption.
debug_annotations: Vec<DebugAnnotation>
Unstable key/value annotations shown in the trace viewer but not intended for metrics use.
task_execution: Option<TaskExecution>
Typed event arguments:
log_message: Option<LogMessage>
§cc_scheduler_state: Option<ChromeCompositorSchedulerState>
§chrome_user_event: Option<ChromeUserEvent>
§chrome_keyed_service: Option<ChromeKeyedService>
§chrome_legacy_ipc: Option<ChromeLegacyIpc>
§chrome_histogram_sample: Option<ChromeHistogramSample>
§chrome_latency_info: Option<ChromeLatencyInfo>
§chrome_frame_reporter: Option<ChromeFrameReporter>
§chrome_application_state_info: Option<ChromeApplicationStateInfo>
§chrome_renderer_scheduler_state: Option<ChromeRendererSchedulerState>
§chrome_window_handle_event_info: Option<ChromeWindowHandleEventInfo>
§chrome_content_settings_event_info: Option<ChromeContentSettingsEventInfo>
§chrome_active_processes: Option<ChromeActiveProcesses>
§screenshot: Option<Screenshot>
§chrome_message_pump: Option<ChromeMessagePump>
§chrome_mojo_event_info: Option<ChromeMojoEventInfo>
§legacy_event: Option<LegacyEvent>
§name_field: Option<NameField>
Optional name of the event for its display in trace viewer. May be left unspecified for events with typed arguments.
Note that metrics should not rely on event names, as they are prone to changing. Instead, they should use typed arguments to identify the events they are interested in.
counter_value_field: Option<CounterValueField>
A new value for a counter track. |track_uuid| should refer to a track with a CounterDescriptor, and |type| should be TYPE_COUNTER. For a more efficient encoding of counter values that are sampled at the beginning/end of a slice, see |extra_counter_values| and |extra_counter_track_uuids|. Counter values can optionally be encoded in as delta values (positive or negative) on each packet sequence (see CounterIncrementalBase).
source_location_field: Option<SourceLocationField>
This field is used only if the source location represents the function that executes during this event.
timestamp: Option<Timestamp>
Deprecated. Use the |timestamp| and |timestamp_clock_id| fields in TracePacket instead.
Timestamp in microseconds (usually CLOCK_MONOTONIC).
thread_time: Option<ThreadTime>
Deprecated. Use |extra_counter_values| and |extra_counter_track_uuids| to encode thread time instead.
CPU time for the current thread (e.g., CLOCK_THREAD_CPUTIME_ID) in microseconds.
thread_instruction_count: Option<ThreadInstructionCount>
Deprecated. Use |extra_counter_values| and |extra_counter_track_uuids| to encode thread instruction count instead.
Value of the instruction counter for the current thread.
Implementations§
Source§impl TrackEvent
impl TrackEvent
Trait Implementations§
Source§impl Clone for TrackEvent
impl Clone for TrackEvent
Source§fn clone(&self) -> TrackEvent
fn clone(&self) -> TrackEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TrackEvent
impl Debug for TrackEvent
Source§impl Default for TrackEvent
impl Default for TrackEvent
Source§impl Message for TrackEvent
impl Message for TrackEvent
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
.