49 uword next_buffer_stride,
50 uword n_buffer_data_bytes_in_trace)
77 n_buffer_data_bytes_in_trace);
83 n_buffer_data_bytes_in_trace);
103 n_buffer_data_bytes_in_trace);
122 tm = &this_vlib_main->trace_main;
151 if (node != prev_node)
176 .short_help =
"Packet tracer commands",
186 return dt < 0 ? -1 : (dt > 0 ? +1 : 0);
250 accept = filter_accept(tm, h[0]);
252 if ((n_accepted == tm->filter_count) || !accept)
253 vec_add1 (traces_to_remove, h);
260 for (index = 0; index <
vec_len (traces_to_remove); index++)
288 if (
unformat (input,
"max %d", &max))
303 fmt =
"------------------- Start of thread %d %s -------------------\n";
306 tm = &this_vlib_main->trace_main;
315 vec_add1 (traces, h[0]);
321 s =
format (s,
"No packets in trace buffer\n");
328 for (i = 0; i <
vec_len (traces); i++)
333 " To display more specify max.", max);
339 s =
format (s,
"Packet %d\n%U\n\n", i + 1,
360 .path =
"show trace",
361 .short_help =
"Show trace buffer [max COUNT]",
385 else if (
unformat (line_input,
"verbose"))
399 tm = &this_vlib_main->trace_main;
405 tn = tm->
nodes + node_index;
419 .short_help =
"Trace given number of packets",
467 u32 filter_node_index;
472 if (
unformat (input,
"include %U %d",
477 else if (
unformat (input,
"exclude %U %d",
486 filter_node_index = 0;
492 (
"expected 'include NODE COUNT' or 'exclude NODE COUNT' or 'none', got `%U'",
498 tm = &this_vlib_main->trace_main;
518 .path =
"trace filter",
519 .short_help =
"filter trace output - include NODE COUNT | exclude NODE COUNT | none",
534 .path =
"clear trace",
535 .short_help =
"Clear trace buffer and free memory",
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
sll srl srl sll sra u16x4 i
void vlib_trace_cli_reference(void)
vlib_trace_node_t * nodes
static clib_error_t * cli_clear_trace_buffer(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static vlib_trace_header_t * vlib_trace_header_next(vlib_trace_header_t *h)
format_function_t * format_trace
static clib_error_t * cli_show_trace_buffer(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vlib_trace_header_t ** trace_buffer_pool
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define vlib_prefetch_buffer_with_index(vm, bi, type)
Prefetch buffer metadata by buffer index The first 64 bytes of buffer contains most header informatio...
#define vec_end(v)
End (last data address) of vector.
#define clib_error_create(args...)
u64 cpu_time_main_loop_start
u32 filter_accept(vlib_trace_main_t *tm, vlib_trace_header_t *h)
vlib_worker_thread_t * vlib_worker_threads
#define FILTER_FLAG_EXCLUDE
static int trace_cmp(void *a1, void *a2)
format_function_t * format_buffer
#define foreach_vlib_main(body)
#define pool_free(p)
Free a pool.
static clib_error_t * cli_filter_trace(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * cli_add_trace_buffer(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_free(V)
Free vector's memory (no header).
static void * clib_mem_set_heap(void *heap)
#define VLIB_BUFFER_IS_TRACED
#define clib_memcpy(a, b, c)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
#define VLIB_CLI_COMMAND(x,...)
#define pool_put_index(p, i)
Free pool element with given index.
static void clear_trace_buffer(void)
vlib_trace_main_t trace_main
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
void vlib_trace_frame_buffers_only(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, uword n_buffers, uword next_buffer_stride, uword n_buffer_data_bytes_in_trace)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
unformat_function_t unformat_vlib_node
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
void trace_apply_filter(vlib_main_t *vm)
static u8 * format_vlib_trace(u8 *s, va_list *va)
#define FILTER_FLAG_INCLUDE