52 uword next_buffer_stride,
53 uword n_buffer_data_bytes_in_trace)
76 if (b0->
flags & VLIB_BUFFER_IS_TRACED)
80 n_buffer_data_bytes_in_trace);
82 if (b1->
flags & VLIB_BUFFER_IS_TRACED)
86 n_buffer_data_bytes_in_trace);
102 if (b0->
flags & VLIB_BUFFER_IS_TRACED)
106 n_buffer_data_bytes_in_trace);
123 tm = &this_vlib_main->trace_main;
131 tm = &this_vlib_main->trace_main;
156 if (node != prev_node)
181 .short_help =
"Packet tracer commands",
191 return dt < 0 ? -1 : (dt > 0 ? +1 : 0);
274 for (index = 0; index <
vec_len (traces_to_remove); index++)
302 if (
unformat (input,
"max %d", &max))
315 fmt =
"------------------- Start of thread %d %s -------------------\n";
318 tm = &this_vlib_main->trace_main;
330 s =
format (s,
"No packets in trace buffer\n");
337 for (i = 0; i <
vec_len (traces); i++)
342 " To display more specify max.", max);
346 s =
format (s,
"Packet %d\n%U\n\n", i + 1,
364 .path =
"show trace",
365 .short_help =
"Show trace buffer [max COUNT]",
398 tm = &this_vlib_main->trace_main;
401 tn = tm->
nodes + node_index;
416 tm = &this_vlib_main->trace_main;
447 else if (
unformat (line_input,
"verbose"))
449 else if (
unformat (line_input,
"filter"))
464 "tracing. There may be another way to " 465 "initiate trace on this node.",
471 if (filter && filter_table == ~0)
488 .short_help =
"trace add <input-graph-node> <add'l-pkts-for-node-> [filter] [verbose]",
539 tm = &this_vlib_main->trace_main;
559 u32 filter_node_index;
563 if (
unformat (input,
"include %U %d",
568 else if (
unformat (input,
"exclude %U %d",
577 filter_node_index = 0;
583 (
"expected 'include NODE COUNT' or 'exclude NODE COUNT' or 'none', got `%U'",
593 .path =
"trace filter",
594 .short_help =
"trace filter none | [include|exclude] NODE COUNT",
609 .path =
"clear trace",
610 .short_help =
"Clear trace buffer and free memory",
624 __attribute__ ((weak));
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
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_trace_cli_reference(void)
format_function_t format_vlib_node_name
vlib_trace_node_t * nodes
#define pool_foreach(VAR, POOL)
Iterate through pool.
static clib_error_t * cli_clear_trace_buffer(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
#define clib_memcpy_fast(a, b, c)
static vlib_trace_header_t * vlib_trace_header_next(vlib_trace_header_t *h)
#define VLIB_NODE_FLAG_TRACE_SUPPORTED
static void * vlib_add_trace_inline(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
format_function_t * format_trace
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
void trace_filter_set(u32 node_index, u32 flag, u32 count)
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
void trace_update_capture_options(u32 add, u32 node_index, u32 filter, u8 verbose)
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
#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...
description fragment has unexpected format
#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)
u8 * vnet_trace_placeholder
vlib_worker_thread_t * vlib_worker_threads
#define FILTER_FLAG_EXCLUDE
u8 * format_vlib_trace(u8 *s, va_list *va)
format_function_t * format_buffer
void vlib_trace_stop_and_clear(void)
#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)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
#define clib_warning(format, args...)
#define FILTER_FLAG_POST_MORTEM
int trace_time_cmp(void *a1, void *a2)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
vlib_main_t vlib_node_runtime_t * node
#define VLIB_CLI_COMMAND(x,...)
#define pool_put_index(p, i)
Free pool element with given index.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
vlib_trace_main_t trace_main
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)
int vlib_enable_disable_pkt_trace_filter(int enable)
Enable / disable packet trace filter.
VLIB buffer representation.
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
int vnet_is_packet_traced(vlib_buffer_t *b, u32 classify_table_index, int func)
unformat_function_t unformat_vlib_node
u32 classify_get_trace_chain(void)
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define CLIB_CACHE_LINE_BYTES
void clear_trace_buffer(void)
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)
#define FILTER_FLAG_INCLUDE