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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method 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§

default 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,

§

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>,

§

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>,

§

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.