pub struct TriggerConfig {
pub trigger_mode: Option<i32>,
pub use_clone_snapshot_if_available: Option<bool>,
pub triggers: Vec<Trigger>,
pub trigger_timeout_ms: Option<u32>,
}
Expand description
Triggers allow producers to start or stop the tracing session when an event occurs.
For example if we are tracing probabilistically, most traces will be uninteresting. Triggers allow us to keep only the interesting ones such as those traces during which the device temperature reached a certain threshold. In this case the producer can activate a trigger to keep (STOP_TRACING) the trace, otherwise it can also begin a trace (START_TRACING) because it knows something is about to happen.
Fields§
§trigger_mode: Option<i32>
§use_clone_snapshot_if_available: Option<bool>
This flag is really a workaround for b/274931668. This is needed only when deploying configs to different versions of the tracing service. When this is set to true this has the same effect of setting trigger_mode to CLONE_SNAPSHOT on newer versions of the service. This boolean has been introduced to allow to have configs that use CLONE_SNAPSHOT on newer versions of Android and fall back to STOP_TRACING on older versions where CLONE_SNAPSHOT did not exist. When using this flag, trigger_mode must be set to STOP_TRACING.
triggers: Vec<Trigger>
A list of triggers which are related to this configuration. If ANY trigger is seen then an action will be performed based on |trigger_mode|.
trigger_timeout_ms: Option<u32>
Required and must be positive if a TriggerConfig is specified. This is how long this TraceConfig should wait for a trigger to arrive. After this period of time if no trigger is seen the TracingSession will be cleaned up.
Implementations§
Source§impl TriggerConfig
impl TriggerConfig
Sourcepub fn trigger_mode(&self) -> TriggerMode
pub fn trigger_mode(&self) -> TriggerMode
Returns the enum value of trigger_mode
, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_trigger_mode(&mut self, value: TriggerMode)
pub fn set_trigger_mode(&mut self, value: TriggerMode)
Sets trigger_mode
to the provided enum value.
Sourcepub fn trigger_timeout_ms(&self) -> u32
pub fn trigger_timeout_ms(&self) -> u32
Returns the value of trigger_timeout_ms
, or the default value if trigger_timeout_ms
is unset.
Sourcepub fn use_clone_snapshot_if_available(&self) -> bool
pub fn use_clone_snapshot_if_available(&self) -> bool
Returns the value of use_clone_snapshot_if_available
, or the default value if use_clone_snapshot_if_available
is unset.
Trait Implementations§
Source§impl Clone for TriggerConfig
impl Clone for TriggerConfig
Source§fn clone(&self) -> TriggerConfig
fn clone(&self) -> TriggerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TriggerConfig
impl Debug for TriggerConfig
Source§impl Default for TriggerConfig
impl Default for TriggerConfig
Source§impl Message for TriggerConfig
impl Message for TriggerConfig
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 TriggerConfig
impl PartialEq for TriggerConfig
impl StructuralPartialEq for TriggerConfig
Auto Trait Implementations§
impl Freeze for TriggerConfig
impl RefUnwindSafe for TriggerConfig
impl Send for TriggerConfig
impl Sync for TriggerConfig
impl Unpin for TriggerConfig
impl UnwindSafe for TriggerConfig
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
)