18 #include <sys/types.h> 21 #include <netinet/in.h> 83 u64 significant_errors = 0;
88 for (vm_index = 0; vm_index < vec_len (gm->my_vlib_mains); vm_index++)
90 this_vlib_main = gm->my_vlib_mains[vm_index];
91 em = &this_vlib_main->error_main;
92 significant_errors += em->counters[code] -
93 ((vec_len(em->counters_last_clear) > code) ?
94 em->counters_last_clear[code] : 0);
99 return (significant_errors);
119 u64 input_packets, last_input_packets, new_sig_errors;
120 f64 last_runtime, dt, now;
125 last_input_packets = 0;
128 last_input_packets = 0;
147 dt = now - last_runtime;
151 last_input_packets = input_packets;
166 .name =
"gmon-process",
188 memset (ma, 0,
sizeof (*ma));
198 "vpp_vector_rate", (
char *) v, sizeof (*v));
202 "vpp_input_rate", (
char *) v, sizeof (*v));
206 "vpp_sig_error_rate",
207 (
char *) v, sizeof (*v));
212 "vpp_pid", (
char *) swp, sizeof (*swp));
227 "vpp_sig_error_rate");
262 return VNET_API_ERROR_NO_SUCH_ENTRY;
283 else if (
unformat (input,
"disable"))
299 (0,
"significant_error_enable_disable returned %d", rv);
307 .path =
"set significant error",
308 .short_help =
"set significant error <counter-index-nnn> [disable]",
sll srl srl sll sra u16x4 i
void * svmdb_local_get_variable_reference(svmdb_client_t *client, svmdb_namespace_t namespace, char *var)
Fixed length block allocator.
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).
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
static f64 vlib_last_vector_length_per_node(vlib_main_t *vm)
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)
#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 * vpe_api_init(vlib_main_t *vm)
static u64 vnet_get_aggregate_rx_packets(void)
static clib_error_t * set_significant_error_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).
#define VLIB_MAIN_LOOP_EXIT_FUNCTION(x)
vlib_main_t vlib_global_main
#define VLIB_CLI_COMMAND(x,...)
void svmdb_local_set_vec_variable(svmdb_client_t *client, char *var, void *val_arg, u32 elsize)
clib_error_t * vlibmemory_init(vlib_main_t *vm)
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)
vlib_main_t ** vlib_mains
void svm_region_unmap(void *rp_arg)
svmdb_client_t * svmdb_map(svmdb_map_args_t *dba)
svmdb_client_t * svmdb_client
#define VLIB_REGISTER_NODE(x,...)
#define clib_error_return(e, args...)
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".