18 #include <sys/types.h> 21 #include <netinet/in.h> 75 u64 significant_errors = 0;
80 for (vm_index = 0; vm_index < vec_len (gm->my_vlib_mains); vm_index++)
82 this_vlib_main = gm->my_vlib_mains[vm_index];
83 em = &this_vlib_main->error_main;
84 significant_errors += em->counters[code] -
85 ((vec_len(em->counters_last_clear) > code) ?
86 em->counters_last_clear[code] : 0);
91 return (significant_errors);
111 u64 input_packets, last_input_packets, new_sig_errors;
112 f64 last_runtime, dt, now;
117 last_input_packets = 0;
120 last_input_packets = 0;
131 vector_rate = vlib_last_vector_length_per_node (vm);
134 dt = now - last_runtime;
138 last_input_packets = input_packets;
153 .name =
"gmon-process",
185 "vpp_vector_rate", (
char *) v, sizeof (*v));
189 "vpp_input_rate", (
char *) v, sizeof (*v));
193 "vpp_sig_error_rate",
194 (
char *) v, sizeof (*v));
199 "vpp_pid", (
char *) swp, sizeof (*swp));
214 "vpp_sig_error_rate");
249 return VNET_API_ERROR_NO_SUCH_ENTRY;
270 else if (
unformat (input,
"disable"))
286 (0,
"significant_error_enable_disable returned %d", rv);
294 .path =
"set significant error",
295 .short_help =
"set significant error <counter-index-nnn> [disable]",
void * svmdb_local_get_variable_reference(svmdb_client_t *client, svmdb_namespace_t namespace, char *var)
static u64 vnet_get_aggregate_rx_packets(void)
Optimized string handling code, including c11-compliant "safe C library" variants.
Fixed length block allocator.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static f64 vlib_time_now(vlib_main_t *vm)
static uword gmon_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
int api_uid
uid for the api shared memory region
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap. ...
vlib_main_t ** my_vlib_mains
int api_gid
gid for the api shared memory region
vlib_main_t ** vlib_mains
static vlib_node_registration_t gmon_process_node
(constructor) VLIB_REGISTER_NODE (gmon_process_node)
static uword vlib_process_suspend(vlib_main_t *vm, f64 dt)
Suspend a vlib cooperative multi-tasking thread for a period of time.
#define VLIB_INIT_FUNCTION(x)
const char * root_path
Chroot path to the shared memory API files.
#define clib_error_return(e, args...)
#define vlib_call_init_function(vm, x)
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
static clib_error_t * gmon_exit(vlib_main_t *vm)
vlib_error_main_t error_main
static clib_error_t * set_significant_error_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
clib_error_t * vlibmemory_init(vlib_main_t *vm)
API main structure, used by both vpp and binary API clients.
#define VLIB_REGISTER_NODE(x,...)
#define vec_free(V)
Free vector's memory (no header).
clib_error_t * vpe_api_init(vlib_main_t *vm)
#define VLIB_MAIN_LOOP_EXIT_FUNCTION(x)
#define VLIB_CLI_COMMAND(x,...)
void svmdb_local_set_vec_variable(svmdb_client_t *client, char *var, void *val_arg, u32 elsize)
static u64 get_significant_errors(gmon_main_t *gm)
Bitmaps built as vectors of machine words.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void svm_region_unmap(void *rp_arg)
svmdb_client_t * svmdb_map(svmdb_map_args_t *dba)
svmdb_client_t * svmdb_client
static int significant_error_enable_disable(gmon_main_t *gm, u32 index, int enable)
VLIB_API_INIT_FUNCTION(publish_pid)
static clib_error_t * gmon_init(vlib_main_t *vm)
static clib_error_t * publish_pid(vlib_main_t *vm)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".