|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
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);
122 tm = &this_vlib_main->trace_main;
130 tm = &this_vlib_main->trace_main;
154 if (
node != prev_node)
164 if (
node->format_trace)
167 s =
format (s,
"\n %U",
node->format_buffer,
h->data);
179 .short_help =
"Packet tracer commands",
189 return dt < 0 ? -1 : (dt > 0 ? +1 : 0);
300 if (
unformat (input,
"max %d", &max))
312 fmt =
"------------------- Start of thread %d %s -------------------\n";
315 tm = &this_vlib_main->trace_main;
327 s =
format (s,
"No packets in trace buffer\n");
338 char *warn =
"Limiting display to %d packets."
339 " To display more specify max.";
341 s =
format (s, warn, max);
362 .path =
"show trace",
363 .short_help =
"Show trace buffer [max COUNT]",
395 tm = &this_vlib_main->trace_main;
413 tm = &this_vlib_main->trace_main;
443 else if (
unformat (line_input,
"verbose"))
445 else if (
unformat (line_input,
"filter"))
460 "tracing. There may be another way to "
461 "initiate trace on this node.",
467 if (filter && filter_table == ~0)
484 .short_help =
"trace add <input-graph-node> <add'l-pkts-for-node-> [filter] [verbose]",
534 tm = &this_vlib_main->trace_main;
553 u32 filter_node_index;
557 if (
unformat (input,
"include %U %d",
562 else if (
unformat (input,
"exclude %U %d",
571 filter_node_index = 0;
577 (
"expected 'include NODE COUNT' or 'exclude NODE COUNT' or 'none', got `%U'",
587 .path =
"trace filter",
588 .short_help =
"trace filter none | [include|exclude] NODE COUNT",
603 .path =
"clear trace",
604 .short_help =
"Clear trace buffer and free memory",
618 __attribute__ ((weak));
static vlib_cli_command_t trace_cli_command
(constructor) VLIB_CLI_COMMAND (trace_cli_command)
void trace_apply_filter(vlib_main_t *vm)
#define FILTER_FLAG_EXCLUDE
u8 * format_vlib_trace(u8 *s, va_list *va)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static vlib_cli_command_t filter_trace_cli
(constructor) VLIB_CLI_COMMAND (filter_trace_cli)
#define FILTER_FLAG_POST_MORTEM
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)
u32 filter_accept(vlib_trace_main_t *tm, vlib_trace_header_t *h)
#define vec_end(v)
End (last data address) of vector.
vlib_main_t vlib_node_runtime_t * node
void vlib_trace_cli_reference(void)
static clib_error_t * cli_show_trace_buffer(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int vlib_enable_disable_pkt_trace_filter(int enable)
Enable / disable packet trace filter.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static clib_error_t * cli_add_trace_buffer(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vnet_hw_if_output_node_runtime_t * r
vlib_worker_thread_t * vlib_worker_threads
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
#define pool_put_index(p, i)
Free pool element with given index.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
void trace_filter_set(u32 node_index, u32 flag, u32 count)
#define foreach_vlib_main()
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
#define pool_foreach(VAR, POOL)
Iterate through pool.
void vlib_trace_stop_and_clear(void)
#define clib_error_create(args...)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static vlib_trace_header_t * vlib_trace_header_next(vlib_trace_header_t *h)
unformat_function_t unformat_vlib_node
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
static clib_error_t * cli_clear_trace_buffer(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#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...
int vnet_is_packet_traced(vlib_buffer_t *b, u32 classify_table_index, int func)
static vlib_cli_command_t clear_trace_cli
(constructor) VLIB_CLI_COMMAND (clear_trace_cli)
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
sll srl srl sll sra u16x4 i
#define VLIB_NODE_FLAG_TRACE_SUPPORTED
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define VLIB_CLI_COMMAND(x,...)
#define CLIB_CACHE_LINE_BYTES
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static void * vlib_add_trace_inline(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define vec_free(V)
Free vector's memory (no header).
format_function_t format_vlib_node_name
#define FILTER_FLAG_INCLUDE
vlib_trace_header_t ** trace_buffer_pool
u8 * vnet_trace_placeholder
description fragment has unexpected format
static clib_error_t * cli_filter_trace(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static vlib_cli_command_t show_trace_cli
(constructor) VLIB_CLI_COMMAND (show_trace_cli)
void classify_get_trace_chain(void)
int trace_time_cmp(void *a1, void *a2)
vlib_trace_node_t * nodes
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
void clear_trace_buffer(void)
#define pool_free(p)
Free a pool.
#define clib_warning(format, args...)
vlib_trace_main_t trace_main
void trace_update_capture_options(u32 add, u32 node_index, u32 filter, u8 verbose)
u64 cpu_time_main_loop_start
static vlib_cli_command_t add_trace_cli
(constructor) VLIB_CLI_COMMAND (add_trace_cli)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.