pub struct ProcessStatsConfig {
pub quirks: Vec<i32>,
pub scan_all_processes_on_start: Option<bool>,
pub record_thread_names: Option<bool>,
pub proc_stats_poll_ms: Option<u32>,
pub proc_stats_cache_ttl_ms: Option<u32>,
pub scan_smaps_rollup: Option<bool>,
pub record_process_age: Option<bool>,
pub record_process_runtime: Option<bool>,
pub record_process_dmabuf_rss: Option<bool>,
pub resolve_process_fds: Option<bool>,
pub skip_main_thread_message: Option<bool>,
}Expand description
Config for polling process-related information from /proc/pid/status and related files on Linux.
Data source name: “linux.process_stats”.
Fields§
§quirks: Vec<i32>§scan_all_processes_on_start: Option<bool>If enabled all processes will be scanned and dumped when the trace starts.
record_thread_names: Option<bool>If enabled thread names are also recoded (this is redundant if sched_switch is enabled).
proc_stats_poll_ms: Option<u32>If > 0 samples counters (see process_stats.proto) from /proc/pid/status and oom_score_adj every X ms. This is required to be > 100ms to avoid excessive CPU usage.
proc_stats_cache_ttl_ms: Option<u32>Explicit caching period during which the polling won’t re-emit identical counter values. This is required to be either = 0 or a multiple of |proc_stats_poll_ms| (default: |proc_stats_poll_ms|). Non-multiples will be rounded down to the nearest multiple.
scan_smaps_rollup: Option<bool>If true and |proc_stats_poll_ms| is set, sample memory stats from /proc/pid/smaps_rollup.
Android: does NOT work with the system daemons by default, as it requires running the recording process (traced_probes or tracebox) as root. It is possible to avoid the root requirement, but the exact steps depend on the Linux distibution. The proc file requires passing a PTRACE_MODE_READ check, and might be further covered by the procfs “hidepid” mount option.
record_process_age: Option<bool>If true: process descriptions will include process age (starttime in /proc/pid/stat). Introduced in: perfetto v44.
record_process_runtime: Option<bool>If true and |proc_stats_poll_ms| is set, process stats will include time spent running in user/kernel mode (utime/stime in /proc/pid/stat). Introduced in: perfetto v44.
record_process_dmabuf_rss: Option<bool>If true obtain per-process dmabuf resident set size from /proc/pid/dmabuf_rss. This feature is not in upstream linux, and is available only on some Android kernels.
resolve_process_fds: Option<bool>WARNING: unmaintained and deprecated. If true this will resolve file descriptors for each process so these can be mapped to their actual device or file. Requires raw_syscalls/sys_{enter,exit} ftrace events to be enabled or new fds opened after initially scanning a process will not be recognized.
skip_main_thread_message: Option<bool>If true, do not write a ProcessTree::Thread message for the main thread of a process. This was the default behaviour before perfetto v58.
Added in perfetto v58.
Implementations§
Source§impl ProcessStatsConfig
impl ProcessStatsConfig
Sourcepub fn quirks(
&self,
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<Quirks>>
pub fn quirks( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<Quirks>>
Returns an iterator which yields the valid enum values contained in quirks.
Sourcepub fn push_quirks(&mut self, value: Quirks)
pub fn push_quirks(&mut self, value: Quirks)
Appends the provided enum value to quirks.
Sourcepub fn scan_all_processes_on_start(&self) -> bool
pub fn scan_all_processes_on_start(&self) -> bool
Returns the value of scan_all_processes_on_start, or the default value if scan_all_processes_on_start is unset.
Sourcepub fn record_thread_names(&self) -> bool
pub fn record_thread_names(&self) -> bool
Returns the value of record_thread_names, or the default value if record_thread_names is unset.
Sourcepub fn proc_stats_poll_ms(&self) -> u32
pub fn proc_stats_poll_ms(&self) -> u32
Returns the value of proc_stats_poll_ms, or the default value if proc_stats_poll_ms is unset.
Sourcepub fn proc_stats_cache_ttl_ms(&self) -> u32
pub fn proc_stats_cache_ttl_ms(&self) -> u32
Returns the value of proc_stats_cache_ttl_ms, or the default value if proc_stats_cache_ttl_ms is unset.
Sourcepub fn resolve_process_fds(&self) -> bool
pub fn resolve_process_fds(&self) -> bool
Returns the value of resolve_process_fds, or the default value if resolve_process_fds is unset.
Sourcepub fn scan_smaps_rollup(&self) -> bool
pub fn scan_smaps_rollup(&self) -> bool
Returns the value of scan_smaps_rollup, or the default value if scan_smaps_rollup is unset.
Sourcepub fn record_process_age(&self) -> bool
pub fn record_process_age(&self) -> bool
Returns the value of record_process_age, or the default value if record_process_age is unset.
Sourcepub fn record_process_runtime(&self) -> bool
pub fn record_process_runtime(&self) -> bool
Returns the value of record_process_runtime, or the default value if record_process_runtime is unset.
Sourcepub fn record_process_dmabuf_rss(&self) -> bool
pub fn record_process_dmabuf_rss(&self) -> bool
Returns the value of record_process_dmabuf_rss, or the default value if record_process_dmabuf_rss is unset.
Sourcepub fn skip_main_thread_message(&self) -> bool
pub fn skip_main_thread_message(&self) -> bool
Returns the value of skip_main_thread_message, or the default value if skip_main_thread_message is unset.
Trait Implementations§
Source§impl Clone for ProcessStatsConfig
impl Clone for ProcessStatsConfig
Source§fn clone(&self) -> ProcessStatsConfig
fn clone(&self) -> ProcessStatsConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProcessStatsConfig
impl Debug for ProcessStatsConfig
Source§impl Default for ProcessStatsConfig
impl Default for ProcessStatsConfig
Source§impl Hash for ProcessStatsConfig
impl Hash for ProcessStatsConfig
Source§impl Message for ProcessStatsConfig
impl Message for ProcessStatsConfig
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
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(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
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(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for ProcessStatsConfig
impl PartialEq for ProcessStatsConfig
Source§fn eq(&self, other: &ProcessStatsConfig) -> bool
fn eq(&self, other: &ProcessStatsConfig) -> bool
self and other values to be equal, and is used by ==.