pub struct SessionSemaphore {
pub name: Option<String>,
pub max_other_session_count: Option<u64>,
}
Expand description
When non-empty, ensures that for a each semaphore named name at most
max_other_session_count`` other sessions (whose value is taken of the
minimum of all values specified by this config or any already-running
session) can be be running.
If a semaphore “acquisition” fails, EnableTracing will return an error and the tracing session will not be started (or elgible to start in the case of deferred sessions).
This is easiest to explain with an example. Suppose the tracing service has the following active tracing sessions: S1 = [{name=foo, max_other_session_count=2}, {name=bar, max_other_session_count=0}] S2 = [{name=foo, max_other_session_count=1}, {name=baz, max_other_session_count=1}]
Then, for a new session, the following would be the expected behaviour of
EnableSession given the state of session_semaphores
.
Q: session_semaphores = []
A: Allowed because it does not specify any semaphores. Will be allowed
no matter the state of any other tracing session.
Q: session_semaphores = [{name=baz, max_other_session_count=1}]
A: Allowed because both S2 and this config specify
max_other_session_count=1 for baz.
Q: session_semaphores = [{name=foo, max_other_session_count=3}]
A: Denied because S2 specified max_other_session_count=1 for foo and S1
takes that slot.
Q: session_semaphores = [{name=bar, max_other_session_count=0}]
A: Denied because S1 takes the the slot specified by both S1 and
this config.
Introduced in 24Q3 (Android V).
Fields§
§name: Option<String>
The name of the semaphore. Acts as a unique identifier across all tracing sessions (including the one being started).
max_other_session_count: Option<u64>
The maximum number of other sesssions which specify the same semaphore which can be active. The minimum of this value across all tracing sessions and the value specified by the config is used when deciding whether the tracing session can be started.
Implementations§
Trait Implementations§
Source§impl Clone for SessionSemaphore
impl Clone for SessionSemaphore
Source§fn clone(&self) -> SessionSemaphore
fn clone(&self) -> SessionSemaphore
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SessionSemaphore
impl Debug for SessionSemaphore
Source§impl Default for SessionSemaphore
impl Default for SessionSemaphore
Source§impl Message for SessionSemaphore
impl Message for SessionSemaphore
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
.