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
impl DataSourceConfig
Sourcepub fn target_buffer(&self) -> u32
pub fn target_buffer(&self) -> u32
Returns the value of target_buffer
, or the default value if target_buffer
is unset.
Sourcepub fn trace_duration_ms(&self) -> u32
pub fn trace_duration_ms(&self) -> u32
Returns the value of trace_duration_ms
, or the default value if trace_duration_ms
is unset.
Sourcepub fn tracing_session_id(&self) -> u64
pub fn tracing_session_id(&self) -> u64
Returns the value of tracing_session_id
, or the default value if tracing_session_id
is unset.
Sourcepub fn enable_extra_guardrails(&self) -> bool
pub fn enable_extra_guardrails(&self) -> bool
Returns the value of enable_extra_guardrails
, or the default value if enable_extra_guardrails
is unset.
Sourcepub fn stop_timeout_ms(&self) -> u32
pub fn stop_timeout_ms(&self) -> u32
Returns the value of stop_timeout_ms
, or the default value if stop_timeout_ms
is unset.
Sourcepub fn session_initiator(&self) -> SessionInitiator
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.
Sourcepub fn set_session_initiator(&mut self, value: SessionInitiator)
pub fn set_session_initiator(&mut self, value: SessionInitiator)
Sets session_initiator
to the provided enum value.
Sourcepub fn prefer_suspend_clock_for_duration(&self) -> bool
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.
Sourcepub fn legacy_config(&self) -> &str
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
impl Clone for DataSourceConfig
Source§fn clone(&self) -> DataSourceConfig
fn clone(&self) -> DataSourceConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DataSourceConfig
impl Debug for DataSourceConfig
Source§impl Default for DataSourceConfig
impl Default for DataSourceConfig
Source§impl Message for DataSourceConfig
impl Message for DataSourceConfig
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
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>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
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>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
.Source§impl PartialEq for DataSourceConfig
impl PartialEq for DataSourceConfig
impl StructuralPartialEq for DataSourceConfig
Auto Trait Implementations§
impl Freeze for DataSourceConfig
impl RefUnwindSafe for DataSourceConfig
impl Send for DataSourceConfig
impl Sync for DataSourceConfig
impl Unpin for DataSourceConfig
impl UnwindSafe for DataSourceConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)