Data Fields | |
uint64_t | epos |
uint64_t | spos |
uint64_t | tag1 |
char | buf [DEBUG_RING_SIZE] |
uint64_t | tag2 |
Debug Ring Resources
Each driver entry needs to allocate some memory for the debug ring, and then cast this structure over the allocated memory to access the bits used by the ring.
Prior to providing this structure to the debug ring, the memory should be cleared, and the len of the buffer should be set to the total length of memory allocated minus the size of debug_ring_resources_t.
Note there are many different designs for cicular buffers, but all of the designs have to face the same problem. How to detect when the buffer is full vs when it is empty. This design uses two counters the grow forever. The current position in the buffer is then pos % len. If the counters are 64bit, it would take a life time for the counters to overflow.
Definition at line 95 of file debug_ring_interface.h.
debug_ring_resources_t::epos |
the end position in the circular buffer
Definition at line 97 of file debug_ring_interface.h.
debug_ring_resources_t::spos |
the start position in the circular buffer
Definition at line 98 of file debug_ring_interface.h.
uint64_t debug_ring_resources_t::tag1 |
Definition at line 100 of file debug_ring_interface.h.
debug_ring_resources_t::buf |
the circular buffer that stores the debug strings.
Definition at line 101 of file debug_ring_interface.h.
uint64_t debug_ring_resources_t::tag2 |
Definition at line 102 of file debug_ring_interface.h.