pub struct TraceConfig {Show 35 fields
pub buffers: Vec<BufferConfig>,
pub data_sources: Vec<DataSource>,
pub builtin_data_sources: Option<BuiltinDataSource>,
pub duration_ms: Option<u32>,
pub prefer_suspend_clock_for_duration: Option<bool>,
pub enable_extra_guardrails: Option<bool>,
pub lockdown_mode: Option<i32>,
pub producers: Vec<ProducerConfig>,
pub statsd_metadata: Option<StatsdMetadata>,
pub write_into_file: Option<bool>,
pub output_path: Option<String>,
pub file_write_period_ms: Option<u32>,
pub max_file_size_bytes: Option<u64>,
pub guardrail_overrides: Option<GuardrailOverrides>,
pub deferred_start: Option<bool>,
pub flush_period_ms: Option<u32>,
pub flush_timeout_ms: Option<u32>,
pub data_source_stop_timeout_ms: Option<u32>,
pub notify_traceur: Option<bool>,
pub bugreport_score: Option<i32>,
pub bugreport_filename: Option<String>,
pub trigger_config: Option<TriggerConfig>,
pub activate_triggers: Vec<String>,
pub incremental_state_config: Option<IncrementalStateConfig>,
pub allow_user_build_tracing: Option<bool>,
pub unique_session_name: Option<String>,
pub compression_type: Option<i32>,
pub incident_report_config: Option<IncidentReportConfig>,
pub statsd_logging: Option<i32>,
pub trace_uuid_msb: Option<i64>,
pub trace_uuid_lsb: Option<i64>,
pub trace_filter: Option<TraceFilter>,
pub android_report_config: Option<AndroidReportConfig>,
pub cmd_trace_start_delay: Option<CmdTraceStartDelay>,
pub session_semaphores: Vec<SessionSemaphore>,
}
Expand description
The overall config that is used when starting a new tracing session through ProducerPort::StartTracing(). It contains the general config for the logging buffer(s) and the configs for all the data source being enabled.
Next id: 40.
Fields§
§buffers: Vec<BufferConfig>
§data_sources: Vec<DataSource>
§builtin_data_sources: Option<BuiltinDataSource>
§duration_ms: Option<u32>
If specified, the trace will be stopped |duration_ms| after starting. This does not count the time the system is suspended, so we will run for duration_ms of system activity, not wall time.
However in case of traces with triggers, see TriggerConfig.trigger_timeout_ms instead.
prefer_suspend_clock_for_duration: Option<bool>
If true, tries to use CLOCK_BOOTTIME for duration_ms rather than CLOCK_MONOTONIC (which doesn’t count time in suspend). Supported only on Linux/Android, no-op on other platforms. This is used when dealing with long (e.g. 24h) traces, where suspend can inflate them to weeks of wall-time, making them more likely to hit device reboots (and hence loss). This option also changes consistently the semantic of TriggerConfig.stop_delay_ms.
enable_extra_guardrails: Option<bool>
This is set when –dropbox is passed to the Perfetto command line client and enables guardrails that limit resource usage for traces requested by statsd.
lockdown_mode: Option<i32>
Reject producers that are not running under the same UID as the tracing service.
producers: Vec<ProducerConfig>
§statsd_metadata: Option<StatsdMetadata>
Statsd-specific metadata.
write_into_file: Option<bool>
When true && |output_path| is empty, the EnableTracing() request must provide a file descriptor. The service will then periodically read packets out of the trace buffer and store it into the passed file. If |output_path| is not empty no fd should be passed, the service will create a new file and write into that (see comment below).
output_path: Option<String>
This must point to a non-existing file. If the file exists the service will NOT overwrite and will fail instead as a security precaution. On Android, when this is used with the system traced, the path must be within /data/misc/perfetto-traces/ or the trace will fail. This option has been introduced in Android R. Before R write_into_file can be used only with the “pass a file descriptor over IPC” mode.
file_write_period_ms: Option<u32>
Optional. If non-zero tunes the write period. A min value of 100ms is enforced (i.e. smaller values are ignored).
max_file_size_bytes: Option<u64>
Optional. When non zero the periodic write stops once at most X bytes have been written into the file. Tracing is disabled when this limit is reached, even if |duration_ms| has not been reached yet.
guardrail_overrides: Option<GuardrailOverrides>
§deferred_start: Option<bool>
When true, data sources are not started until an explicit call to StartTracing() on the consumer port. This is to support early initialization and fast trace triggering. This can be used only when the Consumer explicitly triggers the StartTracing() method. This should not be used in a remote trace config via statsd, doing so will result in a hung trace session.
flush_period_ms: Option<u32>
When set, it periodically issues a Flush() to all data source, forcing them to commit their data into the tracing service. This can be used for quasi-real-time streaming mode and to guarantee some partial ordering of events in the trace in windows of X ms.
flush_timeout_ms: Option<u32>
Wait for this long for producers to acknowledge flush requests. Default 5s.
data_source_stop_timeout_ms: Option<u32>
Wait for this long for producers to acknowledge stop requests. Default 5s.
notify_traceur: Option<bool>
Android-only. If set, sends an intent to the Traceur system app when the trace ends to notify it about the trace readiness.
bugreport_score: Option<i32>
This field was introduced in Android S. Android-only. If set to a value > 0, marks the trace session as a candidate for being attached to a bugreport. This field effectively acts as a z-index for bugreports. When Android’s dumpstate runs perfetto –save-for-bugreport, traced will pick the tracing session with the highest score (score <= 0 is ignored) and: On Android S, T: will steal its contents, save the trace into a known path and stop prematurely. On Android U+: will create a read-only snapshot and save that into a known path, without stoppin the original tracing session. When this field is set the tracing session becomes eligible to be cloned by other UIDs.
bugreport_filename: Option<String>
When set, defines name of the file that will be saved under
/data/misc/perfetto-traces/bugreport/ when using –save-all-for-bugreport.
If omitted, traces will be named systrace.pftrace, systrace_1.pftrace, etc,
starting from the highest bugreport_score
.
Introduced in v42 / Android V.
trigger_config: Option<TriggerConfig>
§activate_triggers: Vec<String>
When this is non-empty the perfetto command line tool will ignore the rest of this TraceConfig and instead connect to the perfetto service as a producer and send these triggers, potentially stopping or starting traces that were previous configured to use a TriggerConfig.
incremental_state_config: Option<IncrementalStateConfig>
§allow_user_build_tracing: Option<bool>
Additional guardrail used by the Perfetto command line client. On user builds when –dropbox is set perfetto will refuse to trace unless this is also set. Added in Q.
unique_session_name: Option<String>
If set the tracing service will ensure there is at most one tracing session with this key.
compression_type: Option<i32>
§incident_report_config: Option<IncidentReportConfig>
§statsd_logging: Option<i32>
Android-only. Not for general use. If specified, sets the logging to statsd of guardrails and checkpoints in the tracing service. perfetto_cmd sets this to enabled (if not explicitly set in the config) when specifying –upload.
trace_uuid_msb: Option<i64>
An identifier clients can use to tie this trace to other logging. DEPRECATED as per v32. See TracePacket.trace_uuid for the authoritative Trace UUID. If this field is set, the tracing service will respect the requested UUID (i.e. TracePacket.trace_uuid == this field) but only if gap-less snapshotting is not used.
trace_uuid_lsb: Option<i64>
trace_filter: Option<TraceFilter>
§android_report_config: Option<AndroidReportConfig>
§cmd_trace_start_delay: Option<CmdTraceStartDelay>
§session_semaphores: Vec<SessionSemaphore>
Implementations§
Source§impl TraceConfig
impl TraceConfig
Sourcepub fn duration_ms(&self) -> u32
pub fn duration_ms(&self) -> u32
Returns the value of duration_ms
, or the default value if duration_ms
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 lockdown_mode(&self) -> LockdownModeOperation
pub fn lockdown_mode(&self) -> LockdownModeOperation
Returns the enum value of lockdown_mode
, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_lockdown_mode(&mut self, value: LockdownModeOperation)
pub fn set_lockdown_mode(&mut self, value: LockdownModeOperation)
Sets lockdown_mode
to the provided enum value.
Sourcepub fn write_into_file(&self) -> bool
pub fn write_into_file(&self) -> bool
Returns the value of write_into_file
, or the default value if write_into_file
is unset.
Sourcepub fn file_write_period_ms(&self) -> u32
pub fn file_write_period_ms(&self) -> u32
Returns the value of file_write_period_ms
, or the default value if file_write_period_ms
is unset.
Sourcepub fn max_file_size_bytes(&self) -> u64
pub fn max_file_size_bytes(&self) -> u64
Returns the value of max_file_size_bytes
, or the default value if max_file_size_bytes
is unset.
Sourcepub fn deferred_start(&self) -> bool
pub fn deferred_start(&self) -> bool
Returns the value of deferred_start
, or the default value if deferred_start
is unset.
Sourcepub fn flush_period_ms(&self) -> u32
pub fn flush_period_ms(&self) -> u32
Returns the value of flush_period_ms
, or the default value if flush_period_ms
is unset.
Sourcepub fn flush_timeout_ms(&self) -> u32
pub fn flush_timeout_ms(&self) -> u32
Returns the value of flush_timeout_ms
, or the default value if flush_timeout_ms
is unset.
Sourcepub fn notify_traceur(&self) -> bool
pub fn notify_traceur(&self) -> bool
Returns the value of notify_traceur
, or the default value if notify_traceur
is unset.
Sourcepub fn allow_user_build_tracing(&self) -> bool
pub fn allow_user_build_tracing(&self) -> bool
Returns the value of allow_user_build_tracing
, or the default value if allow_user_build_tracing
is unset.
Sourcepub fn unique_session_name(&self) -> &str
pub fn unique_session_name(&self) -> &str
Returns the value of unique_session_name
, or the default value if unique_session_name
is unset.
Sourcepub fn data_source_stop_timeout_ms(&self) -> u32
pub fn data_source_stop_timeout_ms(&self) -> u32
Returns the value of data_source_stop_timeout_ms
, or the default value if data_source_stop_timeout_ms
is unset.
Sourcepub fn compression_type(&self) -> CompressionType
pub fn compression_type(&self) -> CompressionType
Returns the enum value of compression_type
, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_compression_type(&mut self, value: CompressionType)
pub fn set_compression_type(&mut self, value: CompressionType)
Sets compression_type
to the provided enum value.
Sourcepub fn trace_uuid_msb(&self) -> i64
pub fn trace_uuid_msb(&self) -> i64
Returns the value of trace_uuid_msb
, or the default value if trace_uuid_msb
is unset.
Sourcepub fn trace_uuid_lsb(&self) -> i64
pub fn trace_uuid_lsb(&self) -> i64
Returns the value of trace_uuid_lsb
, or the default value if trace_uuid_lsb
is unset.
Sourcepub fn output_path(&self) -> &str
pub fn output_path(&self) -> &str
Returns the value of output_path
, or the default value if output_path
is unset.
Sourcepub fn bugreport_score(&self) -> i32
pub fn bugreport_score(&self) -> i32
Returns the value of bugreport_score
, or the default value if bugreport_score
is unset.
Sourcepub fn statsd_logging(&self) -> StatsdLogging
pub fn statsd_logging(&self) -> StatsdLogging
Returns the enum value of statsd_logging
, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_statsd_logging(&mut self, value: StatsdLogging)
pub fn set_statsd_logging(&mut self, value: StatsdLogging)
Sets statsd_logging
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 bugreport_filename(&self) -> &str
pub fn bugreport_filename(&self) -> &str
Returns the value of bugreport_filename
, or the default value if bugreport_filename
is unset.
Trait Implementations§
Source§impl Clone for TraceConfig
impl Clone for TraceConfig
Source§fn clone(&self) -> TraceConfig
fn clone(&self) -> TraceConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TraceConfig
impl Debug for TraceConfig
Source§impl Default for TraceConfig
impl Default for TraceConfig
Source§impl Message for TraceConfig
impl Message for TraceConfig
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
.