FD.io VPP  v17.10-9-gd594711
Vector Packet Processing
stats.c File Reference
+ Include dependency graph for stats.c:

Go to the source code of this file.

Data Structures

struct  ip4_nbr_stats_ctx_t_
 The context passed when collecting adjacency counters. More...
 
struct  ip6_nbr_stats_ctx_t_
 The context passed when collecting adjacency counters. More...
 
struct  add_routes_in_fib_arg_t
 

Macros

#define STATS_DEBUG   0
 
#define f64_endian(a)
 
#define f64_print(a, b)
 
#define vl_typedefs   /* define message structures */
 
#define vl_endianfun   /* define message structures */
 
#define vl_print(handle, ...)   vlib_cli_output (handle, __VA_ARGS__)
 
#define vl_printfun
 
#define foreach_stats_msg
 
#define vl_msg_name_crc_list
 
#define SIMPLE_COUNTER_BATCH_SIZE   126
 
#define COMBINED_COUNTER_BATCH_SIZE   63
 
#define IP4_FIB_COUNTER_BATCH_SIZE   48
 
#define IP6_FIB_COUNTER_BATCH_SIZE   30
 
#define STATS_RELEASE_DELAY_NS   (1000 * 1000 * 5)
 
#define stats_reg(n)   vec_free(registrations[IDX_##n]);
 
#define stats_reg(n)   vec_reset_length(registrations[IDX_##n]);
 
#define stats_reg(n)   vec_add1(registrations[IDX_##n], ~0);
 
#define MIN(x, y)   (((x)<(y))?(x):(y))
 
#define MIN(x, y)   (((x)<(y))?(x):(y))
 
#define vl_api_vnet_interface_simple_counters_t_endian   vl_noop_handler
 
#define vl_api_vnet_interface_simple_counters_t_print   vl_noop_handler
 
#define vl_api_vnet_interface_combined_counters_t_endian   vl_noop_handler
 
#define vl_api_vnet_interface_combined_counters_t_print   vl_noop_handler
 
#define vl_api_vnet_ip4_fib_counters_t_endian   vl_noop_handler
 
#define vl_api_vnet_ip4_fib_counters_t_print   vl_noop_handler
 
#define vl_api_vnet_ip6_fib_counters_t_endian   vl_noop_handler
 
#define vl_api_vnet_ip6_fib_counters_t_print   vl_noop_handler
 
#define vl_api_vnet_ip4_nbr_counters_t_endian   vl_noop_handler
 
#define vl_api_vnet_ip4_nbr_counters_t_print   vl_noop_handler
 
#define vl_api_vnet_ip6_nbr_counters_t_endian   vl_noop_handler
 
#define vl_api_vnet_ip6_nbr_counters_t_print   vl_noop_handler
 
#define stats_reg(n)
 

Typedefs

typedef struct ip4_nbr_stats_ctx_t_ ip4_nbr_stats_ctx_t
 The context passed when collecting adjacency counters. More...
 
typedef struct ip6_nbr_stats_ctx_t_ ip6_nbr_stats_ctx_t
 The context passed when collecting adjacency counters. More...
 

Functions

static void setup_message_id_table (api_main_t *am)
 
u8format_vnet_interface_combined_counters (u8 *s, va_list *args)
 
u8format_vnet_interface_simple_counters (u8 *s, va_list *args)
 
void dslock (stats_main_t *sm, int release_hint, int tag)
 
void stats_dslock_with_hint (int hint, int tag)
 
void dsunlock (stats_main_t *sm)
 
void stats_dsunlock (int hint, int tag)
 
static vpe_client_registration_tget_client_for_stat (u32 reg, u32 item, u32 client_index)
 
static int set_client_for_stat (u32 reg, u32 item, vpe_client_registration_t *client)
 
int clear_client_for_stat (u32 reg, u32 item, u32 client_index)
 
vpe_client_registration_tget_clients_for_stat (u32 reg, u32 item)
 
static void clear_client_reg (u32 **registrations)
 
u32 ** init_client_reg (u32 **registrations)
 
u32 ** enable_all_client_reg (u32 **registrations)
 
static void do_simple_interface_counters (stats_main_t *sm)
 
void handle_client_registration (vpe_client_registration_t *client, u32 stat, u32 item, int enable_disable)
 
static void vl_api_want_interface_combined_stats_t_handler (vl_api_want_interface_combined_stats_t *mp)
 
static void vl_api_vnet_interface_combined_counters_t_handler (vl_api_vnet_interface_combined_counters_t *mp)
 
static void do_combined_interface_counters (stats_main_t *sm)
 
static void vl_api_want_per_interface_combined_stats_t_handler (vl_api_want_per_interface_combined_stats_t *mp)
 
static void do_combined_per_interface_counters (stats_main_t *sm)
 
static void vl_api_want_per_interface_simple_stats_t_handler (vl_api_want_per_interface_simple_stats_t *mp)
 
static void do_simple_per_interface_counters (stats_main_t *sm)
 
static void ip46_fib_stats_delay (stats_main_t *sm, u32 sec, u32 nsec)
 
static adj_walk_rc_t ip4_nbr_stats_cb (adj_index_t ai, void *arg)
 
static void ip4_nbr_ship (stats_main_t *sm, ip4_nbr_stats_ctx_t *ctx)
 
static void do_ip4_nbr_counters (stats_main_t *sm)
 
static adj_walk_rc_t ip6_nbr_stats_cb (adj_index_t ai, void *arg)
 
static void ip6_nbr_ship (stats_main_t *sm, ip6_nbr_stats_ctx_t *ctx)
 
static void do_ip6_nbr_counters (stats_main_t *sm)
 
static void do_ip4_fib_counters (stats_main_t *sm)
 
static void add_routes_in_fib (BVT(clib_bihash_kv)*kvp, void *arg)
 
static void do_ip6_fib_counters (stats_main_t *sm)
 
static void stats_thread_fn (void *arg)
 
static void vl_api_vnet_interface_simple_counters_t_handler (vl_api_vnet_interface_simple_counters_t *mp)
 
static void vl_api_vnet_ip4_fib_counters_t_handler (vl_api_vnet_ip4_fib_counters_t *mp)
 
static void vl_api_vnet_ip4_nbr_counters_t_handler (vl_api_vnet_ip4_nbr_counters_t *mp)
 
static void vl_api_vnet_ip6_fib_counters_t_handler (vl_api_vnet_ip6_fib_counters_t *mp)
 
static void vl_api_vnet_ip6_nbr_counters_t_handler (vl_api_vnet_ip6_nbr_counters_t *mp)
 
static void vl_api_want_stats_t_handler (vl_api_want_stats_t *mp)
 
static void vl_api_want_interface_simple_stats_t_handler (vl_api_want_interface_simple_stats_t *mp)
 
static void vl_api_want_ip4_fib_stats_t_handler (vl_api_want_ip4_fib_stats_t *mp)
 
static void vl_api_want_ip6_fib_stats_t_handler (vl_api_want_ip6_fib_stats_t *mp)
 
static void vl_api_want_ip4_nbr_stats_t_handler (vl_api_want_ip4_nbr_stats_t *mp)
 
static void vl_api_want_ip6_nbr_stats_t_handler (vl_api_want_ip6_nbr_stats_t *mp)
 
static void vl_api_vnet_get_summary_stats_t_handler (vl_api_vnet_get_summary_stats_t *mp)
 
int stats_memclnt_delete_callback (u32 client_index)
 
static clib_error_tstats_init (vlib_main_t *vm)
 
 VLIB_REGISTER_THREAD (stats_thread_reg, static)
 

Variables

stats_main_t stats_main
 

Macro Definition Documentation

#define COMBINED_COUNTER_BATCH_SIZE   63

Definition at line 80 of file stats.c.

#define f64_endian (   a)

Definition at line 29 of file stats.c.

#define f64_print (   a,
 
)

Definition at line 30 of file stats.c.

#define foreach_stats_msg
Value:
_(WANT_STATS, want_stats) \
_(VNET_INTERFACE_SIMPLE_COUNTERS, vnet_interface_simple_counters) \
_(WANT_INTERFACE_SIMPLE_STATS, want_interface_simple_stats) \
_(VNET_INTERFACE_COMBINED_COUNTERS, vnet_interface_combined_counters) \
_(WANT_INTERFACE_COMBINED_STATS, want_interface_combined_stats) \
_(WANT_PER_INTERFACE_COMBINED_STATS, want_per_interface_combined_stats) \
_(WANT_PER_INTERFACE_SIMPLE_STATS, want_per_interface_simple_stats) \
_(VNET_IP4_FIB_COUNTERS, vnet_ip4_fib_counters) \
_(WANT_IP4_FIB_STATS, want_ip4_fib_stats) \
_(VNET_IP6_FIB_COUNTERS, vnet_ip6_fib_counters) \
_(WANT_IP6_FIB_STATS, want_ip6_fib_stats) \
_(VNET_IP4_NBR_COUNTERS, vnet_ip4_nbr_counters) \
_(WANT_IP4_NBR_STATS, want_ip4_nbr_stats) \
_(VNET_IP6_NBR_COUNTERS, vnet_ip6_nbr_counters) \
_(WANT_IP6_NBR_STATS, want_ip6_nbr_stats) \
_(VNET_GET_SUMMARY_STATS, vnet_get_summary_stats)

Definition at line 46 of file stats.c.

#define IP4_FIB_COUNTER_BATCH_SIZE   48

Definition at line 81 of file stats.c.

#define IP6_FIB_COUNTER_BATCH_SIZE   30

Definition at line 82 of file stats.c.

#define MIN (   x,
  y 
)    (((x)<(y))?(x):(y))

Definition at line 1309 of file stats.c.

#define MIN (   x,
  y 
)    (((x)<(y))?(x):(y))

Definition at line 1309 of file stats.c.

#define SIMPLE_COUNTER_BATCH_SIZE   126

Definition at line 79 of file stats.c.

#define STATS_DEBUG   0

Definition at line 21 of file stats.c.

#define stats_reg (   n)    vec_free(registrations[IDX_##n]);
#define stats_reg (   n)    vec_reset_length(registrations[IDX_##n]);
#define stats_reg (   n)    vec_add1(registrations[IDX_##n], ~0);
#define stats_reg (   n)
Value:
sm->stats_registrations[IDX_##n] = 0; \
sm->stats_registration_hash[IDX_##n] = 0;
#define STATS_RELEASE_DELAY_NS   (1000 * 1000 * 5)

Definition at line 85 of file stats.c.

#define vl_api_vnet_interface_combined_counters_t_endian   vl_noop_handler

Definition at line 2329 of file stats.c.

#define vl_api_vnet_interface_combined_counters_t_print   vl_noop_handler

Definition at line 2330 of file stats.c.

#define vl_api_vnet_interface_simple_counters_t_endian   vl_noop_handler

Definition at line 2327 of file stats.c.

#define vl_api_vnet_interface_simple_counters_t_print   vl_noop_handler

Definition at line 2328 of file stats.c.

#define vl_api_vnet_ip4_fib_counters_t_endian   vl_noop_handler

Definition at line 2331 of file stats.c.

#define vl_api_vnet_ip4_fib_counters_t_print   vl_noop_handler

Definition at line 2332 of file stats.c.

#define vl_api_vnet_ip4_nbr_counters_t_endian   vl_noop_handler

Definition at line 2335 of file stats.c.

#define vl_api_vnet_ip4_nbr_counters_t_print   vl_noop_handler

Definition at line 2336 of file stats.c.

#define vl_api_vnet_ip6_fib_counters_t_endian   vl_noop_handler

Definition at line 2333 of file stats.c.

#define vl_api_vnet_ip6_fib_counters_t_print   vl_noop_handler

Definition at line 2334 of file stats.c.

#define vl_api_vnet_ip6_nbr_counters_t_endian   vl_noop_handler

Definition at line 2337 of file stats.c.

#define vl_api_vnet_ip6_nbr_counters_t_print   vl_noop_handler

Definition at line 2338 of file stats.c.

#define vl_endianfun   /* define message structures */

Definition at line 36 of file stats.c.

#define vl_msg_name_crc_list

Definition at line 65 of file stats.c.

#define vl_print (   handle,
  ... 
)    vlib_cli_output (handle, __VA_ARGS__)

Definition at line 41 of file stats.c.

#define vl_printfun

Definition at line 42 of file stats.c.

#define vl_typedefs   /* define message structures */

Definition at line 32 of file stats.c.

Typedef Documentation

The context passed when collecting adjacency counters.

The context passed when collecting adjacency counters.

Function Documentation

static void add_routes_in_fib ( BVT(clib_bihash_kv)*  kvp,
void *  arg 
)
static

Definition at line 1608 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int clear_client_for_stat ( u32  reg,
u32  item,
u32  client_index 
)

Definition at line 315 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void clear_client_reg ( u32 **  registrations)
static

Definition at line 385 of file stats.c.

static void do_combined_interface_counters ( stats_main_t sm)
static

Definition at line 619 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void do_combined_per_interface_counters ( stats_main_t sm)
static

Definition at line 740 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void do_ip4_fib_counters ( stats_main_t sm)
static

Definition at line 1423 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void do_ip4_nbr_counters ( stats_main_t sm)
static

Definition at line 1216 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void do_ip6_fib_counters ( stats_main_t sm)
static

Definition at line 1629 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void do_ip6_nbr_counters ( stats_main_t sm)
static

Definition at line 1371 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void do_simple_interface_counters ( stats_main_t sm)
static

Definition at line 440 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void do_simple_per_interface_counters ( stats_main_t sm)
static

Definition at line 937 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dslock ( stats_main_t sm,
int  release_hint,
int  tag 
)

Definition at line 193 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dsunlock ( stats_main_t sm)

Definition at line 226 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32** enable_all_client_reg ( u32 **  registrations)

Definition at line 424 of file stats.c.

u8* format_vnet_interface_combined_counters ( u8 s,
va_list *  args 
)

Definition at line 89 of file stats.c.

+ Here is the call graph for this function:

u8* format_vnet_interface_simple_counters ( u8 s,
va_list *  args 
)

Definition at line 136 of file stats.c.

+ Here is the call graph for this function:

static vpe_client_registration_t* get_client_for_stat ( u32  reg,
u32  item,
u32  client_index 
)
static

Definition at line 254 of file stats.c.

+ Here is the caller graph for this function:

vpe_client_registration_t* get_clients_for_stat ( u32  reg,
u32  item 
)

Definition at line 359 of file stats.c.

+ Here is the caller graph for this function:

void handle_client_registration ( vpe_client_registration_t client,
u32  stat,
u32  item,
int  enable_disable 
)

Definition at line 494 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32** init_client_reg ( u32 **  registrations)

Definition at line 398 of file stats.c.

static void ip46_fib_stats_delay ( stats_main_t sm,
u32  sec,
u32  nsec 
)
static

Definition at line 1096 of file stats.c.

+ Here is the caller graph for this function:

static void ip4_nbr_ship ( stats_main_t sm,
ip4_nbr_stats_ctx_t ctx 
)
static

Definition at line 1158 of file stats.c.

+ Here is the call graph for this function:

static adj_walk_rc_t ip4_nbr_stats_cb ( adj_index_t  ai,
void *  arg 
)
static

Definition at line 1132 of file stats.c.

+ Here is the call graph for this function:

static void ip6_nbr_ship ( stats_main_t sm,
ip6_nbr_stats_ctx_t ctx 
)
static

Definition at line 1312 of file stats.c.

+ Here is the call graph for this function:

static adj_walk_rc_t ip6_nbr_stats_cb ( adj_index_t  ai,
void *  arg 
)
static

Definition at line 1284 of file stats.c.

+ Here is the call graph for this function:

static int set_client_for_stat ( u32  reg,
u32  item,
vpe_client_registration_t client 
)
static

Definition at line 278 of file stats.c.

+ Here is the caller graph for this function:

static void setup_message_id_table ( api_main_t am)
static

Definition at line 70 of file stats.c.

+ Here is the caller graph for this function:

void stats_dslock_with_hint ( int  hint,
int  tag 
)

Definition at line 219 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void stats_dsunlock ( int  hint,
int  tag 
)

Definition at line 247 of file stats.c.

+ Here is the call graph for this function:

static clib_error_t* stats_init ( vlib_main_t vm)
static

Definition at line 2341 of file stats.c.

+ Here is the call graph for this function:

int stats_memclnt_delete_callback ( u32  client_index)

Definition at line 2309 of file stats.c.

+ Here is the caller graph for this function:

static void stats_thread_fn ( void *  arg)
static

Definition at line 1780 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_vnet_get_summary_stats_t_handler ( vl_api_vnet_get_summary_stats_t mp)
static

Definition at line 2256 of file stats.c.

+ Here is the call graph for this function:

static void vl_api_vnet_interface_combined_counters_t_handler ( vl_api_vnet_interface_combined_counters_t mp)
static

Definition at line 573 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_vnet_interface_simple_counters_t_handler ( vl_api_vnet_interface_simple_counters_t mp)
static

Definition at line 1832 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_vnet_ip4_fib_counters_t_handler ( vl_api_vnet_ip4_fib_counters_t mp)
static

Definition at line 1890 of file stats.c.

+ Here is the call graph for this function:

static void vl_api_vnet_ip4_nbr_counters_t_handler ( vl_api_vnet_ip4_nbr_counters_t mp)
static

Definition at line 1939 of file stats.c.

+ Here is the call graph for this function:

static void vl_api_vnet_ip6_fib_counters_t_handler ( vl_api_vnet_ip6_fib_counters_t mp)
static

Definition at line 1989 of file stats.c.

+ Here is the call graph for this function:

static void vl_api_vnet_ip6_nbr_counters_t_handler ( vl_api_vnet_ip6_nbr_counters_t mp)
static

Definition at line 2038 of file stats.c.

+ Here is the call graph for this function:

static void vl_api_want_interface_combined_stats_t_handler ( vl_api_want_interface_combined_stats_t mp)
static

Definition at line 535 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_want_interface_simple_stats_t_handler ( vl_api_want_interface_simple_stats_t mp)
static

Definition at line 2135 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_want_ip4_fib_stats_t_handler ( vl_api_want_ip4_fib_stats_t mp)
static

Definition at line 2173 of file stats.c.

+ Here is the call graph for this function:

static void vl_api_want_ip4_nbr_stats_t_handler ( vl_api_want_ip4_nbr_stats_t mp)
static

Definition at line 2246 of file stats.c.

static void vl_api_want_ip6_fib_stats_t_handler ( vl_api_want_ip6_fib_stats_t mp)
static

Definition at line 2209 of file stats.c.

+ Here is the call graph for this function:

static void vl_api_want_ip6_nbr_stats_t_handler ( vl_api_want_ip6_nbr_stats_t mp)
static

Definition at line 2251 of file stats.c.

static void vl_api_want_per_interface_combined_stats_t_handler ( vl_api_want_per_interface_combined_stats_t mp)
static

Definition at line 677 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_want_per_interface_simple_stats_t_handler ( vl_api_want_per_interface_simple_stats_t mp)
static

Definition at line 872 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_want_stats_t_handler ( vl_api_want_stats_t mp)
static

Definition at line 2087 of file stats.c.

+ Here is the call graph for this function:

VLIB_REGISTER_THREAD ( stats_thread_reg  ,
static   
)

+ Here is the caller graph for this function:

Variable Documentation

stats_main_t stats_main

Definition at line 23 of file stats.c.