|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
17 #include <perfmon/perfmon.h>
28 if (
unformat (input,
"%s", &str) == 0)
48 if (
unformat (input,
"%s", &str) == 0)
64 int verbose = va_arg (*args,
int);
66 const char *bundle_type[] = {
73 return format (s,
"%-20s%-10s%-20s%s",
"Name",
"Type",
"Source",
78 s =
format (s,
"name: %s\n",
b->name);
79 s =
format (s,
"description: %s\n",
b->description);
80 s =
format (s,
"source: %s\n",
b->src->name);
81 for (
int i = 0;
i <
b->n_events;
i++)
88 s =
format (s,
"%-20s%-10s%-20s%s",
b->name, bundle_type[
b->type],
89 b->src->name,
b->description);
107 if (
unformat (line_input,
"verbose"))
131 if (!
vb[
i]->cpu_supports ||
vb[
i]->cpu_supports ())
139 .path =
"show perfmon bundle",
140 .short_help =
"show perfmon bundle [<bundle-name>] [verbose]",
149 int verbose = va_arg (*args,
int);
152 return format (s,
"%-20s%-9s %s",
"Name",
"NumEvents",
"Description");
157 s =
format (s,
"description: %s\n",
src->description);
158 s =
format (s,
"Events:\n");
159 for (
int i = 0;
i <
src->n_events;
i++)
163 if (
src->format_config)
171 if (
src->instances_by_type)
173 s =
format (s,
"Instances:\n");
180 s =
format (s,
" %s:\n ",
it->name);
181 for (
int j = 0; j <
vec_len (
it->instances); j++)
191 s =
format (s,
"%-20s%9u %s",
src->name,
src->n_events,
src->description);
209 if (
unformat (line_input,
"verbose"))
240 .path =
"show perfmon source",
241 .short_help =
"show perfmon source [<source-name>] [verbose]",
258 .path =
"show perfmon active-bundle",
259 .short_help =
"show perfmon active-bundle",
271 table_t table = {}, *t = &table;
291 if (read (pm->
group_fds[
i],
r, (
b->n_events + 3) * sizeof (
u64)) == -1)
303 if (
b->column_headers)
305 char **hdr =
b->column_headers;
311 for (
int i = 0;
i < n_instances;
i++)
320 for (
int j = 0; j < tr->
n_nodes; j++)
330 for (
int j = 0; j < n_row; j++)
336 for (
int j = 0; j < n_row; j++)
355 .path =
"show perfmon statistics",
356 .short_help =
"show perfmon statistics [raw]",
370 .path =
"perfmon reset",
371 .short_help =
"perfmon reset",
407 .path =
"perfmon start",
408 .short_help =
"perfmon start bundle [<bundle-name>]",
421 .path =
"perfmon stop",
422 .short_help =
"perfmon stop",
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
@ PERFMON_BUNDLE_TYPE_NODE
static vlib_cli_command_t perfmon_reset_command
(constructor) VLIB_CLI_COMMAND (perfmon_reset_command)
void perfmon_reset(vlib_main_t *vm)
perfmon_bundle_t * active_bundle
static vlib_cli_command_t show_perfmon_source_command
(constructor) VLIB_CLI_COMMAND (show_perfmon_source_command)
perfmon_main_t perfmon_main
#define clib_error_return(e, args...)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
u8 * format_perfmon_source(u8 *s, va_list *args)
vnet_hw_if_output_node_runtime_t * r
perfmon_instance_type_t * active_instance_type
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
perfmon_thread_runtime_t * thread_runtimes
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void table_set_cell_fg_color(table_t *t, int c, int r, table_text_attr_color_t v)
static clib_error_t * show_perfmon_source_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
@ PERFMON_BUNDLE_TYPE_THREAD
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static clib_error_t * perfmon_stop_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void table_add_header_col(table_t *t, int n_strings,...)
@ PERFMON_BUNDLE_TYPE_SYSTEM
sll srl srl sll sra u16x4 i
static clib_error_t * show_perfmon_stats_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define VLIB_CLI_COMMAND(x,...)
save_rewrite_length must be aligned so that reass doesn t overwrite it
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static vlib_cli_command_t show_perfmon_stats_command
(constructor) VLIB_CLI_COMMAND (show_perfmon_stats_command)
u8 * format_perfmon_bundle(u8 *s, va_list *args)
static clib_error_t * perfmon_reset_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vnet_buffer_opaque_t * vb(void *vb_arg)
static vlib_cli_command_t show_perfmon_active_bundle_command
(constructor) VLIB_CLI_COMMAND (show_perfmon_active_bundle_command)
static clib_error_t * perfmon_start_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_free(V)
Free vector's memory (no header).
void table_free(table_t *t)
static vlib_cli_command_t perfmon_start_command
(constructor) VLIB_CLI_COMMAND (perfmon_start_command)
format_function_t format_vlib_node_name
#define hash_get_mem(h, key)
description fragment has unexpected format
void table_format_title(table_t *t, char *fmt,...)
#define clib_error_return_unix(e, args...)
void table_format_cell(table_t *t, int c, int r, char *fmt,...)
static vlib_cli_command_t show_perfmon_bundle_command
(constructor) VLIB_CLI_COMMAND (show_perfmon_bundle_command)
perfmon_node_stats_t * node_stats
clib_error_t * perfmon_stop(vlib_main_t *vm)
uword unformat_perfmon_bundle_name(unformat_input_t *input, va_list *args)
void table_add_header_row(table_t *t, int n_strings,...)
static clib_error_t * show_perfmon_active_bundle_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
clib_error_t * perfmon_start(vlib_main_t *vm, perfmon_bundle_t *b)
format_function_t format_table
void table_set_cell_align(table_t *t, int c, int r, table_text_attr_align_t a)
#define hash_foreach_mem(key_var, value_var, h, body)
static clib_error_t * show_perfmon_bundle_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
uword unformat_perfmon_source_name(unformat_input_t *input, va_list *args)
static vlib_cli_command_t perfmon_stop_command
(constructor) VLIB_CLI_COMMAND (perfmon_stop_command)