Tracebuffer abstraction.
More...
#include <utrace>
|
|
size_t | items () const |
| | Get the capacity (in items) of the tracebuffer ring buffer.
|
| size_t | dequeue (Item *items, size_t capacity, size_t burst, Drop_policy policy, Sequence *drops=nullptr) |
| | Dequeue items from the tracebuffer.
|
|
| static void | validate () |
| | Check that the base debugger (JDB) capability is valid and accessible.
|
|
static unsigned | version () |
| | Get the tracebuffer format version supported by this class.
|
|
static std::endian | endianness () |
| | Get the endianness supported by this class.
|
| static std::optional< Index_desc > | index (unsigned idx) |
| | Map a dynamic tracebuffer log index to names.
|
| static std::vector< Index_desc > | indexes () |
| | Get all mappings of dynamic tracebuffer log indexes to names.
|
|
static Tracebuffer & | instance () |
| | Get the singleton instance of this class.
|
Tracebuffer abstraction.
Since there is only a single global tracebuffer available in the current implementation, this is a singleton class.
Definition at line 44 of file utrace.
◆ dequeue()
| size_t utrace::Tracebuffer::dequeue |
( |
Item * | items, |
|
|
size_t | capacity, |
|
|
size_t | burst, |
|
|
Drop_policy | policy, |
|
|
Sequence * | drops = nullptr ) |
Dequeue items from the tracebuffer.
Dequeue multiple items from the tracebuffer. The goal is to dequeue as many items as available from the tracebuffer in a single call to avoid overhead. This operation blocks until at least burst items have been dequeued (but returns immediately if an item is dropped).
- Parameters
-
| [out] | items | Array to dequeue the next items from the tracebuffer into (as copies). |
| capacity | Capacity of items (in items). |
| burst | Minimal number of items that should be collected before returning in case of waiting for items. |
| policy | Item drop policy. |
| [out] | drops | Pointer to store the number of items that have been dropped. Can be nullptr. |
- Returns
- Number of items dequeued and stored into items.
References items().
◆ index()
| std::optional< Index_desc > utrace::Tracebuffer::index |
( |
unsigned | idx | ) |
|
|
static |
Map a dynamic tracebuffer log index to names.
- Parameters
-
| idx | Dynamic tracebuffer log index to map. |
- Returns
- Mapping of the dynamic tracebuffer index to names.
- Return values
-
| std::nullopt | The dynamic tracebuffer log index is not defined. |
◆ indexes()
| std::vector< Index_desc > utrace::Tracebuffer::indexes |
( |
| ) |
|
|
static |
Get all mappings of dynamic tracebuffer log indexes to names.
- Returns
- Generator (if available) or a vector of all defined mappings of dynamic tracebuffer log indexes to names.
◆ validate()
| void utrace::Tracebuffer::validate |
( |
| ) |
|
|
static |
Check that the base debugger (JDB) capability is valid and accessible.
The base debugger (JDB) capability is used to access the single global tracebuffer in the current implementation.
- Exceptions
-
| std::invalid_argument | If the base debugger (JDB) capability is invalid or inaccessible. |
The documentation for this class was generated from the following file: