|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
3 #include <vpp/app/version.h>
38 clib_warning (
"bufmon: thread index %d unknown for buffer %s (%d)",
87 for (
i = 0;
i < n;
i++)
90 while (cb->
flags & VLIB_BUFFER_NEXT_PRESENT)
119 pending_frames =
vec_len (
nm->pending_frames);
125 for (; pending_frames <
vec_len (
nm->pending_frames); pending_frames++)
203 else if (
unformat (line_input,
"off"))
219 .path =
"set buffer traces",
220 .short_help =
"set buffer traces [on|off]",
239 if (
unformat (line_input,
"verbose"))
241 else if (
unformat (line_input,
"status"))
262 "Freed",
"In",
"Out",
"Buffered");
269 const i64 buffered = in - out;
270 if (0 == in && 0 == out)
272 if (0 == buffered && !verbose)
284 .path =
"show buffer traces",
285 .short_help =
"show buffer traces [status|verbose]",
305 .path =
"clear buffer traces",
306 .short_help =
"clear buffer traces",
311 .version = VPP_BUILD_VER,
312 .description =
"Buffers monitoring plugin",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static vlib_frame_t * vlib_get_frame(vlib_main_t *vm, vlib_frame_t *f)
u32 next_buffer
Next buffer for this linked-list of buffers.
static u32 bufmon_count_buffers(vlib_main_t *vm, vlib_frame_t *frame)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
static clib_error_t * bufmon_register_callbacks(vlib_main_t *vm)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
vlib_get_buffers(vm, from, b, n_left_from)
__clib_export int vlib_buffer_set_alloc_free_callback(vlib_main_t *vm, vlib_buffer_alloc_free_callback_t *alloc_callback_fn, vlib_buffer_alloc_free_callback_t *free_callback_fn)
vlib_main_t vlib_node_runtime_t * node
#define clib_error_return(e, args...)
vlib_node_main_t node_main
static uword bufmon_dispatch_wrapper(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static clib_error_t * show_buffer_traces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * bufmon_enable_disable(vlib_main_t *vm, int enable)
static clib_error_t * set_buffer_traces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
format_function_t format_vlib_buffer_pool_all
#define foreach_vlib_main()
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static u32 vlib_get_current_process_node_index(vlib_main_t *vm)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static vlib_cli_command_t set_buffer_traces_command
(constructor) VLIB_CLI_COMMAND (set_buffer_traces_command)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
static u32 bufmon_alloc_callback(vlib_main_t *vm, u8 buffer_pool_index, u32 *buffers, u32 n_buffers)
static void bufmon_unregister_callbacks(vlib_main_t *vm)
#define VLIB_CLI_COMMAND(x,...)
static bufmon_main_t bufmon_main
bufmon_per_node_data_t * pnd
#define CLIB_CACHE_LINE_BYTES
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static int vlib_node_set_dispatch_wrapper(vlib_main_t *vm, vlib_node_function_t *fn)
static vlib_cli_command_t show_buffer_traces_command
(constructor) VLIB_CLI_COMMAND (show_buffer_traces_command)
bufmon_per_thread_data_t * ptd
format_function_t format_vlib_node_name
static u32 bufmon_alloc_free_callback(vlib_main_t *vm, u32 n_buffers, const int is_free)
#define vec_foreach(var, vec)
Vector iterator.
static vlib_cli_command_t clear_buffers_trace_command
(constructor) VLIB_CLI_COMMAND (clear_buffers_trace_command)
static u32 bufmon_free_callback(vlib_main_t *vm, u8 buffer_pool_index, u32 *buffers, u32 n_buffers)
#define clib_warning(format, args...)
static clib_error_t * clear_buffer_traces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.