|
OpenSDN source code
|
#include <trace.h>

Public Types | |
| typedef std::map< const std::string, boost::weak_ptr< TraceBuffer< TraceEntryT > > > | TraceBufMap |
| The type defines how a map (a table) of trace buffers is stored. More... | |
Public Member Functions | |
| TraceBuffer (const std::string &buf_name, size_t size, bool trace_enable) | |
| ~TraceBuffer () | |
| Destroys a trace buffer. More... | |
| std::string | Name () |
| Returns the name of the trace buffer. More... | |
| void | TraceOn () |
| Enables the trace buffer. More... | |
| void | TraceOff () |
| Disables the trace buffer. More... | |
| bool | IsTraceOn () |
| Determines whether the trace buffer is enabled or not. More... | |
| size_t | TraceBufSizeGet () |
| size_t | TraceBufCapacityGet () |
| void | TraceBufCapacityReset (size_t size) |
| Resets the size of the circular buffer. More... | |
| void | TraceWrite (TraceEntryT *trace_entry) |
| Writes the provided data into the circular buffer. More... | |
| uint32_t | GetNextSeqNum () |
| Returns the next sequence number. More... | |
| void | TraceRead (const std::string &context, const int count, boost::function< void(TraceEntryT *, bool)> cb) |
| void | TraceReadDone (const std::string &context) |
Private Types | |
| typedef boost::ptr_circular_buffer< TraceEntryT > | ContainerType |
| Specifies the data type for storing records of the trace buffer. More... | |
| typedef std::map< const std::string, boost::shared_ptr< size_t > > | ReadContextMap |
| Specifies the read context for the trace buffer. More... | |
Private Member Functions | |
| DISALLOW_COPY_AND_ASSIGN (TraceBuffer) | |
Private Attributes | |
| std::string | trace_buf_name_ |
| Stores the name of the trace buffer. More... | |
| size_t | trace_buf_size_ |
| Stores the size of the trace buffer. More... | |
| ContainerType | trace_buf_ |
| Stores the records of the trace buffer. More... | |
| tbb::atomic< bool > | trace_enable_ |
| size_t | write_index_ |
| size_t | read_index_ |
| bool | wrap_ |
| Indicates if the trace buffer is wrapped. More... | |
| ReadContextMap | read_context_map_ |
| Stores the read context. More... | |
| tbb::atomic< uint32_t > | seqno_ |
| Stores the current sequence number. More... | |
| tbb::mutex | mutex_ |
Static Private Attributes | |
| static const uint32_t | kMaxSeqno = ((2 ^ 32) - 1) - 1 |
| Reserves max(uint32_t) More... | |
| static const uint32_t | kMinSeqno = 1 |
| Reserves 0. More... | |
Manages a trace buffer's memory. A trace buffer is circular buffer with the given size (count of records) and associated with the given name. The type of records is specified during compilation using the template parameter TraceEntryT. Trace buffers are organized into a table.
|
private |
|
private |
| typedef std::map<const std::string, boost::weak_ptr<TraceBuffer<TraceEntryT> > > TraceBuffer< TraceEntryT >::TraceBufMap |
|
inline |
|
inline |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |