pub struct FtraceConfig {Show 19 fields
pub ftrace_events: Vec<String>,
pub atrace_categories: Vec<String>,
pub atrace_apps: Vec<String>,
pub buffer_size_kb: Option<u32>,
pub drain_period_ms: Option<u32>,
pub compact_sched: Option<CompactSchedConfig>,
pub print_filter: Option<PrintFilter>,
pub symbolize_ksyms: Option<bool>,
pub ksyms_mem_policy: Option<i32>,
pub initialize_ksyms_synchronously_for_testing: Option<bool>,
pub throttle_rss_stat: Option<bool>,
pub disable_generic_events: Option<bool>,
pub syscall_events: Vec<String>,
pub enable_function_graph: Option<bool>,
pub function_filters: Vec<String>,
pub function_graph_roots: Vec<String>,
pub preserve_ftrace_buffer: Option<bool>,
pub use_monotonic_raw_clock: Option<bool>,
pub instance_name: Option<String>,
}
Expand description
Next id: 26.
Fields§
§ftrace_events: Vec<String>
§atrace_categories: Vec<String>
§atrace_apps: Vec<String>
§buffer_size_kb: Option<u32>
Per-CPU buffer size.
drain_period_ms: Option<u32>
§compact_sched: Option<CompactSchedConfig>
§print_filter: Option<PrintFilter>
§symbolize_ksyms: Option<bool>
Enables symbol name resolution against /proc/kallsyms. It requires that either traced_probes is running as root or that kptr_restrict has been manually lowered. It does not disclose KASLR, symbol addresses are mangled.
ksyms_mem_policy: Option<i32>
§initialize_ksyms_synchronously_for_testing: Option<bool>
By default the kernel symbolizer is lazily initialized on a deferred task to reduce ftrace’s time-to-start-recording. Unfortunately that makes ksyms integration tests hard. This flag forces the kernel symbolizer to be initialized synchronously on the data source start and hence avoiding timing races in tests. DEPRECATED in v28 / Android U. This is now the default behavior, setting it to true is a no-op.
throttle_rss_stat: Option<bool>
When this boolean is true AND the ftrace_events contains “kmem/rss_stat”, this option causes traced_probes to enable the “kmem/rss_stat_throttled” event instead if present, and fall back to “kmem/rss_stat” if not present. The historical context for this is the following:
- Up to Android S (12), the rss_stat was internally throttled in its kernel implementation.
- A change introduced in the kernels after S has introduced a new “rss_stat_throttled” making the original “rss_stat” event unthrottled (hence very spammy).
- Not all Android T/13 devices will receive a new kernel though, hence we need to deal with both cases. For more context: go/rss-stat-throttled.
disable_generic_events: Option<bool>
If true, avoid enabling events that aren’t statically known by traced_probes. Otherwise, the default is to emit such events as GenericFtraceEvent protos. Prefer to keep this flag at its default. This was added for Android tracing, where atrace categories and/or atrace HAL requested events can expand to events that aren’t of interest to the tracing user. Introduced in: Android T.
syscall_events: Vec<String>
The list of syscalls that should be recorded by sys_{enter,exit} ftrace events. When empty, all syscalls are recorded. If neither sys_{enter,exit} are enabled, this setting has no effect. Example: [“sys_read”, “sys_open”]. Introduced in: Android U.
enable_function_graph: Option<bool>
If true, enable the “function_graph” kernel tracer that emits events whenever a kernel function is entered and exited (funcgraph_entry/funcgraph_exit). Notes on use:
- Requires |symbolize_ksyms| for function name resolution.
- Use |function_filters| or |function_graph_roots| to constrain the traced set of functions, otherwise the event bandwidth will be too high for practical use.
- The data source might be rejected if there is already a concurrent ftrace data source that does not use function graph itself, as we do not support switching kernel tracers mid-trace.
- Requires a kernel compiled with CONFIG_FUNCTION_GRAPH_TRACER. This is enabled if “cat /sys/kernel/tracing/available_tracers” includes “function_graph”. Android:
- Available only on debuggable builds.
- Introduced in: Android U.
function_filters: Vec<String>
Constrains the set of functions traced when |enable_function_graph| is true. Supports globs, e.g. “sched*”. You can specify multiple filters, in which case all matching functions will be traced. See kernel documentation on ftrace “set_ftrace_filter” file for more details. Android:
- Available only on debuggable builds.
- Introduced in: Android U.
function_graph_roots: Vec<String>
If |enable_function_graph| is true, trace this set of functions and all of its callees. Supports globs. Can be set together with |function_filters|, in which case only callees matching the filter will be traced. If setting both, you most likely want all roots to also be included in |function_filters|. Android:
- Available only on debuggable builds.
- Introduced in: Android U.
preserve_ftrace_buffer: Option<bool>
If true, does not clear ftrace buffers before the start of the program. This makes sense only if this is the first ftrace data source instance created after the daemon has been started. Can be useful for gathering boot traces, if ftrace has been separately configured (e.g. via kernel commandline).
use_monotonic_raw_clock: Option<bool>
If true, overrides the default timestamp clock and uses a raw hardware based monotonic clock for getting timestamps.
- Introduced in: Android U.
instance_name: Option<String>
If |instance_name| is not empty, then attempt to use that tracefs instance
for event recording. Normally, this means
/sys/kernel/tracing/instances/$instance_name
.
The name “hyp” is reserved.
The instance must already exist, the tracing daemon will not create it for you as it typically doesn’t have such permissions. Only a subset of features is guaranteed to work with non-default instances, at the time of writing:
- ftrace_events
- buffer_size_kb
Implementations§
Source§impl FtraceConfig
impl FtraceConfig
Sourcepub fn buffer_size_kb(&self) -> u32
pub fn buffer_size_kb(&self) -> u32
Returns the value of buffer_size_kb
, or the default value if buffer_size_kb
is unset.
Sourcepub fn drain_period_ms(&self) -> u32
pub fn drain_period_ms(&self) -> u32
Returns the value of drain_period_ms
, or the default value if drain_period_ms
is unset.
Sourcepub fn symbolize_ksyms(&self) -> bool
pub fn symbolize_ksyms(&self) -> bool
Returns the value of symbolize_ksyms
, or the default value if symbolize_ksyms
is unset.
Sourcepub fn initialize_ksyms_synchronously_for_testing(&self) -> bool
pub fn initialize_ksyms_synchronously_for_testing(&self) -> bool
Returns the value of initialize_ksyms_synchronously_for_testing
, or the default value if initialize_ksyms_synchronously_for_testing
is unset.
Sourcepub fn throttle_rss_stat(&self) -> bool
pub fn throttle_rss_stat(&self) -> bool
Returns the value of throttle_rss_stat
, or the default value if throttle_rss_stat
is unset.
Sourcepub fn disable_generic_events(&self) -> bool
pub fn disable_generic_events(&self) -> bool
Returns the value of disable_generic_events
, or the default value if disable_generic_events
is unset.
Sourcepub fn ksyms_mem_policy(&self) -> KsymsMemPolicy
pub fn ksyms_mem_policy(&self) -> KsymsMemPolicy
Returns the enum value of ksyms_mem_policy
, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_ksyms_mem_policy(&mut self, value: KsymsMemPolicy)
pub fn set_ksyms_mem_policy(&mut self, value: KsymsMemPolicy)
Sets ksyms_mem_policy
to the provided enum value.
Sourcepub fn enable_function_graph(&self) -> bool
pub fn enable_function_graph(&self) -> bool
Returns the value of enable_function_graph
, or the default value if enable_function_graph
is unset.
Sourcepub fn preserve_ftrace_buffer(&self) -> bool
pub fn preserve_ftrace_buffer(&self) -> bool
Returns the value of preserve_ftrace_buffer
, or the default value if preserve_ftrace_buffer
is unset.
Sourcepub fn use_monotonic_raw_clock(&self) -> bool
pub fn use_monotonic_raw_clock(&self) -> bool
Returns the value of use_monotonic_raw_clock
, or the default value if use_monotonic_raw_clock
is unset.
Sourcepub fn instance_name(&self) -> &str
pub fn instance_name(&self) -> &str
Returns the value of instance_name
, or the default value if instance_name
is unset.
Trait Implementations§
Source§impl Clone for FtraceConfig
impl Clone for FtraceConfig
Source§fn clone(&self) -> FtraceConfig
fn clone(&self) -> FtraceConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for FtraceConfig
impl Debug for FtraceConfig
Source§impl Default for FtraceConfig
impl Default for FtraceConfig
Source§impl Message for FtraceConfig
impl Message for FtraceConfig
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 FtraceConfig
impl PartialEq for FtraceConfig
impl StructuralPartialEq for FtraceConfig
Auto Trait Implementations§
impl Freeze for FtraceConfig
impl RefUnwindSafe for FtraceConfig
impl Send for FtraceConfig
impl Sync for FtraceConfig
impl Unpin for FtraceConfig
impl UnwindSafe for FtraceConfig
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
)