18 #include <sys/types.h> 21 #include <netinet/in.h> 74 u64 significant_errors = 0;
83 significant_errors += em->
counters[code] -
90 return (significant_errors);
110 u64 input_packets, last_input_packets, new_sig_errors;
111 f64 last_runtime, dt, now;
116 last_input_packets = 0;
119 last_input_packets = 0;
130 vector_rate = vlib_last_vector_length_per_node (vm);
133 dt = now - last_runtime;
137 last_input_packets = input_packets;
152 .name =
"gmon-process",
184 "vpp_vector_rate", (
char *) v, sizeof (*v));
188 "vpp_input_rate", (
char *) v, sizeof (*v));
192 "vpp_sig_error_rate",
193 (
char *) v, sizeof (*v));
198 "vpp_pid", (
char *) swp, sizeof (*swp));
213 "vpp_sig_error_rate");
248 return VNET_API_ERROR_NO_SUCH_ENTRY;
269 else if (
unformat (input,
"disable"))
285 (0,
"significant_error_enable_disable returned %d", rv);
293 .path =
"set significant error",
294 .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)
#define clib_bitmap_foreach(i, ai)
Macro to iterate across set bits in a bitmap.
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
u64 * counters_last_clear
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)
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,...)
sll srl srl sll sra u16x4 i
#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 api_main_t * vlibapi_get_main(void)
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".