class Buffer
Defined at line 28 of file ../../zircon/kernel/lib/percpu_writer/include/lib/percpu_writer/buffer.h
percpu_writer::Buffer wraps an SpscBuffer and adds functionality to track dropped trace records.
Public Members
SpscBuffer buffer_
Public Methods
const DroppedRecordStats & drop_stats ()
Defined at line 33 of file ../../zircon/kernel/lib/percpu_writer/include/lib/percpu_writer/buffer.h
zx_status_t Init (uint32_tsize,const char *buffer_name,fxt::ThreadRef<fxt::RefType::kInline>assigned_cpu_ref)
Initializes the underlying SpscBuffer and metadata.
Defined at line 105 of file ../../zircon/kernel/lib/percpu_writer/include/lib/percpu_writer/buffer.h
void Drain ()
Drains the underlying SpscBuffer.
Defined at line 114 of file ../../zircon/kernel/lib/percpu_writer/include/lib/percpu_writer/buffer.h
template <CopyOutFunction CopyFunc>
zx::result<uint32_t> Read (CopyFunc copy_fn, uint32_t len)
Reads from the underlying SpscBuffer.
Defined at line 118 of file ../../zircon/kernel/lib/percpu_writer/include/lib/percpu_writer/buffer.h
BufferImpl * spsc_buffer ()
Returns a pointer to the underlying SpscBuffer.
Defined at line 123 of file ../../zircon/kernel/lib/percpu_writer/include/lib/percpu_writer/buffer.h
DroppedRecordStats * drop_stats_ptr ()
Returns a pointer to the dropped record statistics.
Defined at line 126 of file ../../zircon/kernel/lib/percpu_writer/include/lib/percpu_writer/buffer.h
zx::result<Reservation> Reserve (uint64_t header)
We interpose ourselves in the Reserve path to ensure that we can emit a record containing
the dropped records statistics if we need to.
Defined at line 130 of file ../../zircon/kernel/lib/percpu_writer/include/lib/percpu_writer/buffer.h
zx_status_t EmitDropStats ()
Emit the dropped record stats to the trace buffer.
If we're not tracking a run of dropped records, this is a no-op.
Defined at line 173 of file ../../zircon/kernel/lib/percpu_writer/include/lib/percpu_writer/buffer.h
void ResetDropStats ()
Resets the dropped records statistics to their initial values.
This is used to clear the stats after they've been emitted to a trace buffer.
Defined at line 201 of file ../../zircon/kernel/lib/percpu_writer/include/lib/percpu_writer/buffer.h
uint32_t Size ()
Defined at line 203 of file ../../zircon/kernel/lib/percpu_writer/include/lib/percpu_writer/buffer.h
DroppedRecordDurationEvent SerializeDropStats ()
Serializes the dropped record statistics into a DroppedRecordDurationEvent.
Defined at line 209 of file ../../zircon/kernel/lib/percpu_writer/include/lib/percpu_writer/buffer.h
void TrackDroppedRecord (uint32_t size)
Adds a dropped record of the given size to the tracked statistics.
Defined at line 244 of file ../../zircon/kernel/lib/percpu_writer/include/lib/percpu_writer/buffer.h