|
FD.io VPP
v21.10.1-2-g0a485f517
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);
100 return clib_strcmp ((
char *) (*n1)->name, (
char *) (*n2)->name);
116 if (
unformat (line_input,
"verbose"))
151 .path =
"show perfmon bundle",
152 .short_help =
"show perfmon bundle [<bundle-name>] [verbose]",
161 int verbose = va_arg (*args,
int);
164 return format (s,
"%-20s%-9s %s",
"Name",
"NumEvents",
"Description");
169 s =
format (s,
"description: %s\n",
src->description);
170 s =
format (s,
"Events:\n");
171 for (
int i = 0;
i <
src->n_events;
i++)
175 if (
src->format_config)
183 if (
src->instances_by_type)
185 s =
format (s,
"Instances:\n");
192 s =
format (s,
" %s:\n ",
it->name);
193 for (
int j = 0; j <
vec_len (
it->instances); j++)
203 s =
format (s,
"%-20s%9u %s",
src->name,
src->n_events,
src->description);
221 if (
unformat (line_input,
"verbose"))
252 .path =
"show perfmon source",
253 .short_help =
"show perfmon source [<source-name>] [verbose]",
270 .path =
"show perfmon active-bundle",
271 .short_help =
"show perfmon active-bundle",
283 table_t table = {}, *t = &table;
303 if (read (pm->
group_fds[
i],
r, (
b->n_events + 3) * sizeof (
u64)) == -1)
315 if (
b->column_headers)
317 char **hdr =
b->column_headers;
323 for (
int i = 0;
i < n_instances;
i++)
332 for (
int j = 0; j < tr->
n_nodes; j++)
342 for (
int j = 0; j < n_row; j++)
349 for (
int j = 0; j < n_row; j++)
368 .path =
"show perfmon statistics",
369 .short_help =
"show perfmon statistics [raw]",
383 .path =
"perfmon reset",
384 .short_help =
"perfmon reset",
420 .path =
"perfmon start",
421 .short_help =
"perfmon start bundle [<bundle-name>]",
434 .path =
"perfmon stop",
435 .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...)
@ PERFMON_BUNDLE_TYPE_UNKNOWN
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
u8 * format_perfmon_source(u8 *s, va_list *args)
#define clib_strcmp(s1, s2)
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)
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 int bundle_name_sort_cmp(void *a1, void *a2)
static clib_error_t * perfmon_stop_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
@ PERFMON_BUNDLE_TYPE_SYSTEM
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)
#define hash_get_mem(h, key)
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).
static vlib_cli_command_t perfmon_start_command
(constructor) VLIB_CLI_COMMAND (perfmon_start_command)
format_function_t format_vlib_node_name
description fragment has unexpected format
#define clib_error_return_unix(e, args...)
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
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)
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)
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)
#define hash_foreach_mem(key_var, value_var, h, body)
static vlib_cli_command_t perfmon_stop_command
(constructor) VLIB_CLI_COMMAND (perfmon_stop_command)
vl_api_fib_path_type_t type