|
DPDK 25.11.0-rc1
|
Go to the source code of this file.
Macros | |
| #define | RTE_MBUF_HISTORY_BITS 4 |
| #define | RTE_MBUF_HISTORY_MAX (sizeof(rte_mbuf_history_t) * 8 / RTE_MBUF_HISTORY_BITS) |
Enumerations | |
| enum | rte_mbuf_history_op { RTE_MBUF_HISTORY_OP_NEVER = 0 , RTE_MBUF_HISTORY_OP_LIB_FREE = 1 , RTE_MBUF_HISTORY_OP_PMD_FREE = 2 , RTE_MBUF_HISTORY_OP_APP_FREE = 3 , RTE_MBUF_HISTORY_OP_LIB_ALLOC = 4 , RTE_MBUF_HISTORY_OP_PMD_ALLOC = 5 , RTE_MBUF_HISTORY_OP_APP_ALLOC = 6 , RTE_MBUF_HISTORY_OP_RX = 7 , RTE_MBUF_HISTORY_OP_TX = 8 , RTE_MBUF_HISTORY_OP_TX_PREP = 9 , RTE_MBUF_HISTORY_OP_TX_BUSY = 10 , RTE_MBUF_HISTORY_OP_ENQUEUE = 11 , RTE_MBUF_HISTORY_OP_DEQUEUE = 12 , RTE_MBUF_HISTORY_OP_USR2 = 14 , RTE_MBUF_HISTORY_OP_USR1 = 15 , RTE_MBUF_HISTORY_OP_MAX = 16 } |
Functions | |
| __rte_experimental void | rte_mbuf_history_init (void) |
| static void | rte_mbuf_history_mark (struct rte_mbuf *m, enum rte_mbuf_history_op op) |
| static void | rte_mbuf_history_mark_bulk (struct rte_mbuf *const *mbufs, unsigned int count, enum rte_mbuf_history_op op) |
| __rte_experimental void | rte_mbuf_history_dump (FILE *f, const struct rte_mbuf *m) |
| __rte_experimental void | rte_mbuf_history_dump_mempool (FILE *f, struct rte_mempool *mp) |
| __rte_experimental void | rte_mbuf_history_dump_all (FILE *f) |
Variables | |
| int | rte_mbuf_history_field_offset |
These functions allow to track history of mbuf objects using a dynamic field.
It tracks the lifecycle of mbuf objects through the system with a fixed set of predefined events to maintain performance.
The history is stored as an atomic value (64-bit) in a dynamic field of the mbuf, with each event encoded in 4 bits, allowing up to 16 events to be tracked. Atomic operations ensure thread safety for cloned mbufs accessed by multiple lcores.
After dumping the history in a file, the script dpdk-mbuf-history-parser.py can be used for parsing.
Definition in file rte_mbuf_history.h.
| #define RTE_MBUF_HISTORY_BITS 4 |
Number of bits for each history operation.
Definition at line 43 of file rte_mbuf_history.h.
| #define RTE_MBUF_HISTORY_MAX (sizeof(rte_mbuf_history_t) * 8 / RTE_MBUF_HISTORY_BITS) |
Maximum number of history operations that can be stored.
Definition at line 48 of file rte_mbuf_history.h.
| enum rte_mbuf_history_op |
History operation types.
Definition at line 53 of file rte_mbuf_history.h.
| __rte_experimental void rte_mbuf_history_init | ( | void | ) |
Initialize the mbuf history system.
This function registers the dynamic field for mbuf history tracking. It should be called once during application initialization.
Note: This function is called by rte_pktmbuf_pool_create, so explicit invocation is usually not required.
|
inlinestatic |
Mark an mbuf with a history event.
| m | Pointer to the mbuf. |
| op | The operation to record. |
Definition at line 105 of file rte_mbuf_history.h.
|
inlinestatic |
Mark multiple mbufs with a history event.
| mbufs | Array of mbuf pointers. |
| count | Number of mbufs to mark. |
| op | The operation to record. |
Definition at line 142 of file rte_mbuf_history.h.
| __rte_experimental void rte_mbuf_history_dump | ( | FILE * | f, |
| const struct rte_mbuf * | m | ||
| ) |
Dump mbuf history for a single mbuf to a file.
| f | File pointer to write the history to. |
| m | Pointer to the mbuf to dump history for. |
| __rte_experimental void rte_mbuf_history_dump_mempool | ( | FILE * | f, |
| struct rte_mempool * | mp | ||
| ) |
Dump mbuf history statistics for a single mempool to a file.
| f | File pointer to write the history statistics to. |
| mp | Pointer to the mempool to dump history for. |
| __rte_experimental void rte_mbuf_history_dump_all | ( | FILE * | f | ) |
Dump mbuf history statistics for all mempools to a file.
| f | File pointer to write the history statistics to. |
|
extern |
Global offset for the history dynamic field (set during initialization).