pub enum SourceRequest {
RetireBuffer {
buffer: u64,
control_handle: SourceControlHandle,
},
}
Expand description
A component with records for the Diagnostics system to retrieve.
To record diagnostics, a component allocates a VMO and begins writing records into the buffer, incrementing a header value after each write to inform readers how much of the buffer has been filled.
If any retrievers are connected, the Source
sends them OnBufferInit
events for each
diagnostic buffer created.
When the buffer fills, the Source
sends OnBufferDone
to the retrievers, and will wait for
all notified retrievers to reply with RetireBuffer
when they have finished reading from the
buffer.
When all readers of the buffer have finished, the Source
may recycle the buffer by zeroing it
and sending OnBufferInit
again to connected retrievers.
Once a Source
has sent OnBufferDone
to a retriever, it is up to the Source
to handle new
records that are generated while the retriever drains the buffer. Double buffering is
recommended to prevent excessive blocking, but this protocol does not mandate a specific
approach to handling records generated while buffers are full.
Variants§
RetireBuffer
Notifies the Source
that the retriever is done reading from the buffer. If the Source
wishes it should zero the buffer’s contents and recycle it for future records. Buffers must
be re-sent via OnBufferInit
after they’re zeroed.
Implementations§
source§impl SourceRequest
impl SourceRequest
pub fn into_retire_buffer(self) -> Option<(u64, SourceControlHandle)>
sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL