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);
121 tm = &this_vlib_main->trace_main;
148 if (node != prev_node)
151 s =
format (s,
"\n%U: %v",
173 .short_help =
"Packet tracer commands",
182 return dt < 0 ? -1 : (dt > 0 ? +1 : 0);
242 accept = filter_accept(tm, h[0]);
244 if ((n_accepted == tm->filter_count) || !accept)
245 vec_add1 (traces_to_remove, h);
251 for (index=0; index<
vec_len(traces_to_remove); index++)
280 if (
unformat (input,
"max %d", &max))
294 fmt =
"------------------- Start of thread %d %s -------------------\n";
297 tm = &this_vlib_main->trace_main;
306 vec_add1 (traces, h[0]);
312 s =
format (s,
"No packets in trace buffer\n");
319 for (i = 0; i <
vec_len (traces); i++)
324 " To display more specify max.", max);
330 s =
format (s,
"Packet %d\n%U\n\n", i + 1,
349 .path =
"show trace",
350 .short_help =
"Show trace buffer [max COUNT]",
372 tm = &this_vlib_main->trace_main;
379 tn = tm->
nodes + node_index;
389 .short_help =
"Trace given number of packets",
437 u32 filter_node_index;
442 if (
unformat (input,
"include %U %d",
447 else if (
unformat (input,
"exclude %U %d",
455 filter_node_index = 0;
459 return clib_error_create (
"expected 'include NODE COUNT' or 'exclude NODE COUNT' or 'none', got `%U'",
464 tm = &this_vlib_main->trace_main;
482 .path =
"trace filter",
483 .short_help =
"filter trace output - include NODE COUNT | exclude NODE COUNT | none",
497 .path =
"clear trace",
498 .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
#define foreach_vlib_main(body)
void vlib_trace_cli_reference(void)
always_inline vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
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)
format_function_t * format_trace
always_inline void clear_trace_buffer(void)
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)
#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.
u64 cpu_time_main_loop_start
u32 filter_accept(vlib_trace_main_t *tm, vlib_trace_header_t *h)
#define FILTER_FLAG_EXCLUDE
static int trace_cmp(void *a1, void *a2)
#define clib_error_create(args...)
always_inline void * clib_mem_set_heap(void *heap)
format_function_t * format_buffer
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
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).
always_inline vlib_trace_header_t * vlib_trace_header_next(vlib_trace_header_t *h)
#define clib_memcpy(a, b, c)
#define pool_is_free_index(P, I)
#define VLIB_CLI_COMMAND(x,...)
vlib_worker_thread_t * vlib_worker_threads
#define pool_put_index(p, i)
vlib_trace_main_t trace_main
#define VLIB_BUFFER_IS_TRACED
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
always_inline void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
always_inline 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