class RollingBufferState

Defined at line 49 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

The buffer maintains state using a single uint64_t atomic.

The state is split using the following bit fields:

Buffer Status, 2 bits, 0xC000'0000'0000'0000:

Indicates if one of the double buffers is full and requires servicing.

Buffer 0 is indicated by the MSB.

Wrapped Counter, 30 bits, 0x3FFF'FFFF'0000'0000:

Tracks the number of buffer swaps we have completed this session. Serves as an indicator of

which buffer is the active (writing) buffer.

Offset, 32 bits, 0x0000'0000'FFFF'FFFF:

Tracks the offset of the allocation pointer into the current buffer.

This class serves as an abstraction over reading and writing theses fields.

Public Methods

void RollingBufferState ()

Defined at line 51 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

void RollingBufferState (uint64_t state)

Defined at line 52 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

void RollingBufferState (uint8_t buffer_status, uint32_t offset, uint32_t counter)

Defined at line 53 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

bool operator<=> (const RollingBufferState & )

Defined at line 56 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

uint32_t GetBufferOffset ()

Defined at line 58 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

bool IsBufferFilled (BufferNumber buffer_number)

Defined at line 62 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

RollingBufferState WithBufferMarkedFilled (BufferNumber buffer_number)

Defined at line 67 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

RollingBufferState WithBufferMarkedServiced (BufferNumber buffer_number)

Defined at line 73 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

RollingBufferState WithAllocatedBytes (uint32_t num_bytes)

Defined at line 79 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

RollingBufferState WithOffset (uint32_t new_offset)

Defined at line 84 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

RollingBufferState WithNextWrappedCount ()

Defined at line 90 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

uint32_t GetWrappedCount ()

Defined at line 96 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

uint8_t GetBufferStatus ()

Defined at line 100 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

BufferNumber ToBufferNumber (uint32_t wrapped_count)

Defined at line 104 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h

BufferNumber GetBufferNumber ()

Defined at line 107 of file ../../zircon/system/ulib/trace-engine/rolling_buffer.h