tracing_perfetto_sdk_schema::trace_stats

Struct BufferStats

Source
pub struct BufferStats {
Show 19 fields pub buffer_size: Option<u64>, pub bytes_written: Option<u64>, pub bytes_overwritten: Option<u64>, pub bytes_read: Option<u64>, pub padding_bytes_written: Option<u64>, pub padding_bytes_cleared: Option<u64>, pub chunks_written: Option<u64>, pub chunks_rewritten: Option<u64>, pub chunks_overwritten: Option<u64>, pub chunks_discarded: Option<u64>, pub chunks_read: Option<u64>, pub chunks_committed_out_of_order: Option<u64>, pub write_wrap_count: Option<u64>, pub patches_succeeded: Option<u64>, pub patches_failed: Option<u64>, pub readaheads_succeeded: Option<u64>, pub readaheads_failed: Option<u64>, pub abi_violations: Option<u64>, pub trace_writer_packet_loss: Option<u64>,
}
Expand description

From TraceBuffer::Stats.

Next id: 21.

Fields§

§buffer_size: Option<u64>

Size of the circular buffer in bytes.

§bytes_written: Option<u64>

Num. bytes written into the circular buffer, including chunk headers.

§bytes_overwritten: Option<u64>

Num. bytes overwritten before they have been read (i.e. loss of data).

§bytes_read: Option<u64>

Total size of chunks that were fully read from the circular buffer by the consumer. This may not be equal to |bytes_written| either in the middle of tracing, or if |chunks_overwritten| is non-zero. Note that this is the size of the chunks read from the buffer, including chunk headers, which will be different from the total size of packets returned to the consumer.

The current utilization of the trace buffer (mid-tracing) can be obtained by subtracting |bytes_read| and |bytes_overwritten| from |bytes_written|, adding the difference of |padding_bytes_written| and |padding_bytes_cleared|, and comparing this sum to the |buffer_size|. Note that this represents the total size of buffered data in the buffer, yet this data may be spread non-contiguously through the buffer and may be overridden before the utilization reaches 100%.

§padding_bytes_written: Option<u64>

Num. bytes that were allocated as padding between chunks in the circular buffer.

§padding_bytes_cleared: Option<u64>

Num. of padding bytes that were removed from the circular buffer when they were overwritten.

The difference between |padding_bytes_written| and |padding_bytes_cleared| denotes the total size of padding currently present in the buffer.

§chunks_written: Option<u64>

Num. chunks (!= packets) written into the buffer.

§chunks_rewritten: Option<u64>

Num. chunks (!= packets) rewritten into the buffer. This means we rewrote the same chunk with additional packets appended to the end.

§chunks_overwritten: Option<u64>

Num. chunks overwritten before they have been read (i.e. loss of data).

§chunks_discarded: Option<u64>

Num. chunks discarded (i.e. loss of data). Can be > 0 only when a buffer is configured with FillPolicy == DISCARD.

§chunks_read: Option<u64>

Num. chunks (!= packets) that were fully read from the circular buffer by the consumer. This may not be equal to |chunks_written| either in the middle of tracing, or if |chunks_overwritten| is non-zero.

§chunks_committed_out_of_order: Option<u64>

Num. chunks that were committed out of order.

§write_wrap_count: Option<u64>

Num. times the ring buffer wrapped around.

§patches_succeeded: Option<u64>

Num. out-of-band (OOB) patches that succeeded.

§patches_failed: Option<u64>

Num. OOB patches that failed (e.g., the chunk to patch was gone).

§readaheads_succeeded: Option<u64>

Num. readaheads (for large multi-chunk packet reads) that ended up in a successful packet read.

§readaheads_failed: Option<u64>

Num. readaheads aborted because of missing chunks in the sequence stream. Note that a small number > 0 is totally expected: occasionally, when issuing a read, the very last packet in a sequence might be incomplete (because the producer is still writing it while we read). The read will stop at that point, for that sequence, increasing this counter.

§abi_violations: Option<u64>

Num. of violations of the SharedMemoryABI found while writing or reading the buffer. This is an indication of either a bug in the producer(s) or malicious producer(s).

§trace_writer_packet_loss: Option<u64>

Num. of times the service detected packet loss on a trace writer sequence. This is usually caused by exhaustion of available chunks in the writer process’s SMB. Note that this relies on the client’s TraceWriter indicating this loss to the service – packets lost for other reasons are not reflected in this stat.

Implementations§

Source§

impl BufferStats

Source

pub fn bytes_written(&self) -> u64

Returns the value of bytes_written, or the default value if bytes_written is unset.

Source

pub fn chunks_written(&self) -> u64

Returns the value of chunks_written, or the default value if chunks_written is unset.

Source

pub fn chunks_overwritten(&self) -> u64

Returns the value of chunks_overwritten, or the default value if chunks_overwritten is unset.

Source

pub fn write_wrap_count(&self) -> u64

Returns the value of write_wrap_count, or the default value if write_wrap_count is unset.

Source

pub fn patches_succeeded(&self) -> u64

Returns the value of patches_succeeded, or the default value if patches_succeeded is unset.

Source

pub fn patches_failed(&self) -> u64

Returns the value of patches_failed, or the default value if patches_failed is unset.

Source

pub fn readaheads_succeeded(&self) -> u64

Returns the value of readaheads_succeeded, or the default value if readaheads_succeeded is unset.

Source

pub fn readaheads_failed(&self) -> u64

Returns the value of readaheads_failed, or the default value if readaheads_failed is unset.

Source

pub fn abi_violations(&self) -> u64

Returns the value of abi_violations, or the default value if abi_violations is unset.

Source

pub fn chunks_rewritten(&self) -> u64

Returns the value of chunks_rewritten, or the default value if chunks_rewritten is unset.

Source

pub fn chunks_committed_out_of_order(&self) -> u64

Returns the value of chunks_committed_out_of_order, or the default value if chunks_committed_out_of_order is unset.

Source

pub fn buffer_size(&self) -> u64

Returns the value of buffer_size, or the default value if buffer_size is unset.

Source

pub fn bytes_overwritten(&self) -> u64

Returns the value of bytes_overwritten, or the default value if bytes_overwritten is unset.

Source

pub fn bytes_read(&self) -> u64

Returns the value of bytes_read, or the default value if bytes_read is unset.

Source

pub fn padding_bytes_written(&self) -> u64

Returns the value of padding_bytes_written, or the default value if padding_bytes_written is unset.

Source

pub fn padding_bytes_cleared(&self) -> u64

Returns the value of padding_bytes_cleared, or the default value if padding_bytes_cleared is unset.

Source

pub fn chunks_read(&self) -> u64

Returns the value of chunks_read, or the default value if chunks_read is unset.

Source

pub fn chunks_discarded(&self) -> u64

Returns the value of chunks_discarded, or the default value if chunks_discarded is unset.

Source

pub fn trace_writer_packet_loss(&self) -> u64

Returns the value of trace_writer_packet_loss, or the default value if trace_writer_packet_loss is unset.

Trait Implementations§

Source§

impl Clone for BufferStats

Source§

fn clone(&self) -> BufferStats

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BufferStats

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BufferStats

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for BufferStats

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for BufferStats

Source§

fn eq(&self, other: &BufferStats) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for BufferStats

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.