Phosphor
|
Public Member Functions | |
RingTraceBuffer (size_t generation_, size_t buffer_size_) | |
TraceChunk * | getChunk () override |
void | returnChunk (TraceChunk &chunk) override |
bool | isFull () const override |
void | getStats (StatsCallback &addStats) const override |
size_t | getGeneration () const override |
const TraceChunk & | operator[] (const int index) const override |
size_t | chunk_count () const override |
chunk_iterator | chunk_begin () const override |
chunk_iterator | chunk_end () const override |
event_iterator | begin () const override |
event_iterator | end () const override |
Public Member Functions inherited from phosphor::TraceBuffer | |
virtual | ~TraceBuffer ()=default |
chunk_iterable | chunks () const |
Protected Attributes | |
std::atomic< size_t > | actual_count |
RelaxedAtomic< size_t > | on_loan |
gsl_p::dyn_array< TraceChunk > | buffer |
dvyukov::mpmc_bounded_queue< TraceChunk * > | return_queue |
size_t | generation |
Additional Inherited Members | |
Public Types inherited from phosphor::TraceBuffer | |
using | event_iterator = gsl_p::multidimensional_iterator< chunk_iterator > |
TraceBuffer implementation that stores events in a fixed-size vector of unique pointers to BufferChunks.
|
inlineoverridevirtual |
Implements phosphor::TraceBuffer.
|
inlineoverridevirtual |
Implements phosphor::TraceBuffer.
|
inlineoverridevirtual |
Used for determining the number of chunks in the buffer
Implements phosphor::TraceBuffer.
|
inlineoverridevirtual |
Implements phosphor::TraceBuffer.
|
inlineoverridevirtual |
Implements phosphor::TraceBuffer.
|
inlineoverridevirtual |
Used for getting a TraceChunk to add events to
Implements phosphor::TraceBuffer.
|
inlineoverridevirtual |
Implements phosphor::TraceBuffer.
|
inlineoverridevirtual |
Callback for retrieving stats from the Buffer implementation
Implementations MUST supply the following stats as minimum:
On a non-rotating buffer, if buffer_chunk_count is equal to buffer-size then that must suggest the buffer is full and there are no more chunks to be loaned. On a rotating buffer it suggests that chunks are being reused.
Buffer implementations may include other relevant stats but end-users SHOULD NOT assume the existence of those stats.
Implements phosphor::TraceBuffer.
|
inlineoverridevirtual |
Determine if there are no remaining chunks left to be used
Implements phosphor::TraceBuffer.
|
inlineoverridevirtual |
Used for accessing TraceChunks in the buffer
Valid indexes are from 0 to count()
. There is no bounds checking.
std::logic_error | if chunks are currently loaned out to chunk tenants. |
Implements phosphor::TraceBuffer.
|
inlineoverridevirtual |
Used for returning a TraceChunk once full
For some buffer implementations this may be a no-op but for others which might reuse chunks this can be used to only reuse chunks that have been finished with.
chunk | The chunk to be returned |
Implements phosphor::TraceBuffer.