pub struct PerfEventConfig {Show 17 fields
pub timebase: Option<Timebase>,
pub callstack_sampling: Option<CallstackSampling>,
pub ring_buffer_read_period_ms: Option<u32>,
pub ring_buffer_pages: Option<u32>,
pub max_enqueued_footprint_kb: Option<u64>,
pub max_daemon_memory_kb: Option<u32>,
pub remote_descriptor_timeout_ms: Option<u32>,
pub unwind_state_clear_period_ms: Option<u32>,
pub target_installed_by: Vec<String>,
pub all_cpus: Option<bool>,
pub sampling_frequency: Option<u32>,
pub kernel_frames: Option<bool>,
pub target_pid: Vec<i32>,
pub target_cmdline: Vec<String>,
pub exclude_pid: Vec<i32>,
pub exclude_cmdline: Vec<String>,
pub additional_cmdline_count: Option<u32>,
}
Expand description
Configuration for the traced_perf profiler.
Example config for basic cpu profiling: perf_event_config { timebase { frequency: 80 } callstack_sampling { scope { target_cmdline: “surfaceflinger” target_cmdline: “system_server” } kernel_frames: true } }
Next id: 19
Fields§
§timebase: Option<Timebase>
What event to sample on, and how often. Defined in common/perf_events.proto.
callstack_sampling: Option<CallstackSampling>
If set, the profiler will sample userspace processes’ callstacks at the interval specified by the |timebase|. If unset, the profiler will record only the event counts.
ring_buffer_read_period_ms: Option<u32>
How often the per-cpu ring buffers are read by the producer. If unset, an implementation-defined default is used.
ring_buffer_pages: Option<u32>
Size (in 4k pages) of each per-cpu ring buffer that is filled by the kernel. If set, must be a power of two. If unset, an implementation-defined default is used.
max_enqueued_footprint_kb: Option<u64>
Drop samples if the heap memory held by the samples in the unwinder queue is above the given limit. This counts the memory across all concurrent data sources (not just this one’s), and there is no fairness guarantee - the whole quota might be used up by a concurrent source.
max_daemon_memory_kb: Option<u32>
Stop the data source if traced_perf’s combined {RssAnon + Swap} memory footprint exceeds this value.
remote_descriptor_timeout_ms: Option<u32>
Timeout for the remote /proc/
unwind_state_clear_period_ms: Option<u32>
Optional period for clearing state cached by the unwinder. This is a heavy operation that is only necessary for traces that target a wide set of processes, and require the memory footprint to be reset periodically. If unset, the cached state will not be cleared.
target_installed_by: Vec<String>
If set, only profile target if it was installed by a package with one of these names. Special values:
- “@system”: installed on the system partition
- “@product”: installed on the product partition
- “@null”: sideloaded Supported on Android 12+.
all_cpus: Option<bool>
Note: legacy configs had to set |all_cpus| to true to pass parsing. We rely on this to detect such configs.
sampling_frequency: Option<u32>
§kernel_frames: Option<bool>
§target_pid: Vec<i32>
§target_cmdline: Vec<String>
§exclude_pid: Vec<i32>
§exclude_cmdline: Vec<String>
§additional_cmdline_count: Option<u32>
Implementations§
Source§impl PerfEventConfig
impl PerfEventConfig
Sourcepub fn all_cpus(&self) -> bool
pub fn all_cpus(&self) -> bool
Returns the value of all_cpus
, or the default value if all_cpus
is unset.
Sourcepub fn sampling_frequency(&self) -> u32
pub fn sampling_frequency(&self) -> u32
Returns the value of sampling_frequency
, or the default value if sampling_frequency
is unset.
Sourcepub fn ring_buffer_pages(&self) -> u32
pub fn ring_buffer_pages(&self) -> u32
Returns the value of ring_buffer_pages
, or the default value if ring_buffer_pages
is unset.
Sourcepub fn ring_buffer_read_period_ms(&self) -> u32
pub fn ring_buffer_read_period_ms(&self) -> u32
Returns the value of ring_buffer_read_period_ms
, or the default value if ring_buffer_read_period_ms
is unset.
Sourcepub fn remote_descriptor_timeout_ms(&self) -> u32
pub fn remote_descriptor_timeout_ms(&self) -> u32
Returns the value of remote_descriptor_timeout_ms
, or the default value if remote_descriptor_timeout_ms
is unset.
Sourcepub fn unwind_state_clear_period_ms(&self) -> u32
pub fn unwind_state_clear_period_ms(&self) -> u32
Returns the value of unwind_state_clear_period_ms
, or the default value if unwind_state_clear_period_ms
is unset.
Sourcepub fn additional_cmdline_count(&self) -> u32
pub fn additional_cmdline_count(&self) -> u32
Returns the value of additional_cmdline_count
, or the default value if additional_cmdline_count
is unset.
Sourcepub fn kernel_frames(&self) -> bool
pub fn kernel_frames(&self) -> bool
Returns the value of kernel_frames
, or the default value if kernel_frames
is unset.
Sourcepub fn max_daemon_memory_kb(&self) -> u32
pub fn max_daemon_memory_kb(&self) -> u32
Returns the value of max_daemon_memory_kb
, or the default value if max_daemon_memory_kb
is unset.
Sourcepub fn max_enqueued_footprint_kb(&self) -> u64
pub fn max_enqueued_footprint_kb(&self) -> u64
Returns the value of max_enqueued_footprint_kb
, or the default value if max_enqueued_footprint_kb
is unset.
Trait Implementations§
Source§impl Clone for PerfEventConfig
impl Clone for PerfEventConfig
Source§fn clone(&self) -> PerfEventConfig
fn clone(&self) -> PerfEventConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PerfEventConfig
impl Debug for PerfEventConfig
Source§impl Default for PerfEventConfig
impl Default for PerfEventConfig
Source§impl Message for PerfEventConfig
impl Message for PerfEventConfig
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 PerfEventConfig
impl PartialEq for PerfEventConfig
impl StructuralPartialEq for PerfEventConfig
Auto Trait Implementations§
impl Freeze for PerfEventConfig
impl RefUnwindSafe for PerfEventConfig
impl Send for PerfEventConfig
impl Sync for PerfEventConfig
impl Unpin for PerfEventConfig
impl UnwindSafe for PerfEventConfig
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
)