perfetto_consumer_proto::perfetto::protos

Struct DataSourceConfig

Source
pub struct DataSourceConfig {
Show 37 fields pub name: Option<String>, pub target_buffer: Option<u32>, pub trace_duration_ms: Option<u32>, pub prefer_suspend_clock_for_duration: Option<bool>, pub stop_timeout_ms: Option<u32>, pub enable_extra_guardrails: Option<bool>, pub session_initiator: Option<i32>, pub tracing_session_id: Option<u64>, pub ftrace_config: Option<FtraceConfig>, pub inode_file_config: Option<InodeFileConfig>, pub process_stats_config: Option<ProcessStatsConfig>, pub sys_stats_config: Option<SysStatsConfig>, pub heapprofd_config: Option<HeapprofdConfig>, pub java_hprof_config: Option<JavaHprofConfig>, pub android_power_config: Option<AndroidPowerConfig>, pub android_log_config: Option<AndroidLogConfig>, pub gpu_counter_config: Option<GpuCounterConfig>, pub android_game_intervention_list_config: Option<AndroidGameInterventionListConfig>, pub packages_list_config: Option<PackagesListConfig>, pub perf_event_config: Option<PerfEventConfig>, pub vulkan_memory_config: Option<VulkanMemoryConfig>, pub track_event_config: Option<TrackEventConfig>, pub android_polled_state_config: Option<AndroidPolledStateConfig>, pub android_system_property_config: Option<AndroidSystemPropertyConfig>, pub statsd_tracing_config: Option<StatsdTracingConfig>, pub system_info_config: Option<SystemInfoConfig>, pub chrome_config: Option<ChromeConfig>, pub v8_config: Option<V8Config>, pub interceptor_config: Option<InterceptorConfig>, pub network_packet_trace_config: Option<NetworkPacketTraceConfig>, pub surfaceflinger_layers_config: Option<SurfaceFlingerLayersConfig>, pub surfaceflinger_transactions_config: Option<SurfaceFlingerTransactionsConfig>, pub android_sdk_sysprop_guard_config: Option<AndroidSdkSyspropGuardConfig>, pub etw_config: Option<EtwConfig>, pub protolog_config: Option<ProtoLogConfig>, pub legacy_config: Option<String>, pub for_testing: Option<TestConfig>,
}
Expand description

The configuration that is passed to each data source when starting tracing. Next id: 126

Fields§

§name: Option<String>

Data source unique name, e.g., “linux.ftrace”. This must match the name passed by the data source when it registers (see RegisterDataSource()).

§target_buffer: Option<u32>

The index of the logging buffer where TracePacket(s) will be stored. This field doesn’t make a major difference for the Producer(s). The final logging buffers, in fact, are completely owned by the Service. We just ask the Producer to copy this number into the chunk headers it emits, so that the Service can quickly identify the buffer where to move the chunks into without expensive lookups on its fastpath.

§trace_duration_ms: Option<u32>

Set by the service to indicate the duration of the trace. DO NOT SET in consumer as this will be overridden by the service.

§prefer_suspend_clock_for_duration: Option<bool>

If true, |trace_duration_ms| should count also time in suspend. This is propagated from TraceConfig.prefer_suspend_clock_for_duration.

§stop_timeout_ms: Option<u32>

Set by the service to indicate how long it waits after StopDataSource. DO NOT SET in consumer as this will be overridden by the service.

§enable_extra_guardrails: Option<bool>

Set by the service to indicate whether this tracing session has extra guardrails. DO NOT SET in consumer as this will be overridden by the service.

§session_initiator: Option<i32>

Set by the service to indicate which user initiated this trace. DO NOT SET in consumer as this will be overridden by the service.

§tracing_session_id: Option<u64>

Set by the service to indicate which tracing session the data source belongs to. The intended use case for this is checking if two data sources, one of which produces metadata for the other one, belong to the same trace session and hence should be linked together. This field was introduced in Aug 2018 after Android P. DO NOT SET in consumer as this will be overridden by the service.

§ftrace_config: Option<FtraceConfig>

Data source name: linux.ftrace

§inode_file_config: Option<InodeFileConfig>

Data source name: linux.inode_file_map

§process_stats_config: Option<ProcessStatsConfig>

Data source name: linux.process_stats

§sys_stats_config: Option<SysStatsConfig>

Data source name: linux.sys_stats

§heapprofd_config: Option<HeapprofdConfig>

Data source name: android.heapprofd Introduced in Android 10.

§java_hprof_config: Option<JavaHprofConfig>

Data source name: android.java_hprof Introduced in Android 11.

§android_power_config: Option<AndroidPowerConfig>

Data source name: android.power

§android_log_config: Option<AndroidLogConfig>

Data source name: android.log

§gpu_counter_config: Option<GpuCounterConfig>

TODO(fmayer): Add data source name for this.

§android_game_intervention_list_config: Option<AndroidGameInterventionListConfig>

Data source name: android.game_interventions

§packages_list_config: Option<PackagesListConfig>

Data source name: android.packages_list

§perf_event_config: Option<PerfEventConfig>

Data source name: linux.perf

§vulkan_memory_config: Option<VulkanMemoryConfig>

Data source name: vulkan.memory_tracker

§track_event_config: Option<TrackEventConfig>

Data source name: track_event

§android_polled_state_config: Option<AndroidPolledStateConfig>

Data source name: android.polled_state

§android_system_property_config: Option<AndroidSystemPropertyConfig>

Data source name: android.system_property

§statsd_tracing_config: Option<StatsdTracingConfig>

Data source name: android.statsd

§system_info_config: Option<SystemInfoConfig>

Data source name: linux.system_info

§chrome_config: Option<ChromeConfig>

Chrome is special as it doesn’t use the perfetto IPC layer. We want to avoid proto serialization and de-serialization there because that would just add extra hops on top of the Mojo ser/des. Instead we auto-generate a C++ class for it so it can pass around plain C++ objets.

§v8_config: Option<V8Config>

Data source name: code.v8.dev

§interceptor_config: Option<InterceptorConfig>

If an interceptor is specified here, packets for this data source will be rerouted to the interceptor instead of the main trace buffer. This can be used, for example, to write trace data into ETW or for logging trace points to the console.

Note that interceptors are only supported by data sources registered through the Perfetto SDK API. Data sources that don’t use that API (e.g., traced_probes) may not support interception.

§network_packet_trace_config: Option<NetworkPacketTraceConfig>

Data source name: android.network_packets. Introduced in Android 14 (U).

§surfaceflinger_layers_config: Option<SurfaceFlingerLayersConfig>

Data source name: android.surfaceflinger.layers

§surfaceflinger_transactions_config: Option<SurfaceFlingerTransactionsConfig>

Data source name: android.surfaceflinger.transactions

§android_sdk_sysprop_guard_config: Option<AndroidSdkSyspropGuardConfig>

Data source name: android.sdk_sysprop_guard Introduced in Android 14 (U) QPR1.

§etw_config: Option<EtwConfig>

Data source name: windows.etw

§protolog_config: Option<ProtoLogConfig>

Data source name: android.protolog

§legacy_config: Option<String>

This is a fallback mechanism to send a free-form text config to the producer. In theory this should never be needed. All the code that is part of the platform (i.e. traced service) is supposed to not truncate the trace config proto and propagate unknown fields. However, if anything in the pipeline (client or backend) ends up breaking this forward compat plan, this field will become the escape hatch to allow future data sources to get some meaningful configuration.

§for_testing: Option<TestConfig>

This field is only used for testing.

Implementations§

Source§

impl DataSourceConfig

Source

pub fn name(&self) -> &str

Returns the value of name, or the default value if name is unset.

Source

pub fn target_buffer(&self) -> u32

Returns the value of target_buffer, or the default value if target_buffer is unset.

Source

pub fn trace_duration_ms(&self) -> u32

Returns the value of trace_duration_ms, or the default value if trace_duration_ms is unset.

Source

pub fn tracing_session_id(&self) -> u64

Returns the value of tracing_session_id, or the default value if tracing_session_id is unset.

Source

pub fn enable_extra_guardrails(&self) -> bool

Returns the value of enable_extra_guardrails, or the default value if enable_extra_guardrails is unset.

Source

pub fn stop_timeout_ms(&self) -> u32

Returns the value of stop_timeout_ms, or the default value if stop_timeout_ms is unset.

Source

pub fn session_initiator(&self) -> SessionInitiator

Returns the enum value of session_initiator, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_session_initiator(&mut self, value: SessionInitiator)

Sets session_initiator to the provided enum value.

Source

pub fn prefer_suspend_clock_for_duration(&self) -> bool

Returns the value of prefer_suspend_clock_for_duration, or the default value if prefer_suspend_clock_for_duration is unset.

Source

pub fn legacy_config(&self) -> &str

Returns the value of legacy_config, or the default value if legacy_config is unset.

Trait Implementations§

Source§

impl Clone for DataSourceConfig

Source§

fn clone(&self) -> DataSourceConfig

Returns a copy 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 DataSourceConfig

Source§

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

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

impl Default for DataSourceConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for DataSourceConfig

Source§

fn encoded_len(&self) -> usize

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

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

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

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for DataSourceConfig

Source§

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

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.