FD.io VPP  v18.01.2-1-g9b554f3
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 IP4_MFIB_COUNTER_BATCH_SIZE   24
 
#define IP6_MFIB_COUNTER_BATCH_SIZE   15
 
#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)
 
static void dslock (stats_main_t *sm, int release_hint, int tag)
 
void stats_dslock_with_hint (int hint, int tag)
 
static 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 int mfib_table_stats_walk_cb (fib_node_index_t fei, void *ctx)
 
static void do_ip4_mfib_counters (stats_main_t *sm)
 
static void do_ip6_mfib_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_ip4_mfib_stats_t_handler (vl_api_want_ip4_mfib_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_ip6_mfib_stats_t_handler (vl_api_want_ip6_mfib_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 83 of file stats.c.

#define f64_endian (   a)

Definition at line 30 of file stats.c.

#define f64_print (   a,
 
)

Definition at line 31 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) \
_(WANT_IP4_MFIB_STATS, want_ip4_mfib_stats) \
_(WANT_IP6_MFIB_STATS, want_ip6_mfib_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 47 of file stats.c.

#define IP4_FIB_COUNTER_BATCH_SIZE   48

Definition at line 84 of file stats.c.

#define IP4_MFIB_COUNTER_BATCH_SIZE   24

Definition at line 86 of file stats.c.

#define IP6_FIB_COUNTER_BATCH_SIZE   30

Definition at line 85 of file stats.c.

#define IP6_MFIB_COUNTER_BATCH_SIZE   15

Definition at line 87 of file stats.c.

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

Definition at line 1314 of file stats.c.

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

Definition at line 1314 of file stats.c.

#define SIMPLE_COUNTER_BATCH_SIZE   126

Definition at line 82 of file stats.c.

#define STATS_DEBUG   0

Definition at line 22 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 90 of file stats.c.

#define vl_api_vnet_interface_combined_counters_t_endian   vl_noop_handler

Definition at line 2701 of file stats.c.

#define vl_api_vnet_interface_combined_counters_t_print   vl_noop_handler

Definition at line 2702 of file stats.c.

#define vl_api_vnet_interface_simple_counters_t_endian   vl_noop_handler

Definition at line 2699 of file stats.c.

#define vl_api_vnet_interface_simple_counters_t_print   vl_noop_handler

Definition at line 2700 of file stats.c.

#define vl_api_vnet_ip4_fib_counters_t_endian   vl_noop_handler

Definition at line 2703 of file stats.c.

#define vl_api_vnet_ip4_fib_counters_t_print   vl_noop_handler

Definition at line 2704 of file stats.c.

#define vl_api_vnet_ip4_nbr_counters_t_endian   vl_noop_handler

Definition at line 2707 of file stats.c.

#define vl_api_vnet_ip4_nbr_counters_t_print   vl_noop_handler

Definition at line 2708 of file stats.c.

#define vl_api_vnet_ip6_fib_counters_t_endian   vl_noop_handler

Definition at line 2705 of file stats.c.

#define vl_api_vnet_ip6_fib_counters_t_print   vl_noop_handler

Definition at line 2706 of file stats.c.

#define vl_api_vnet_ip6_nbr_counters_t_endian   vl_noop_handler

Definition at line 2709 of file stats.c.

#define vl_api_vnet_ip6_nbr_counters_t_print   vl_noop_handler

Definition at line 2710 of file stats.c.

#define vl_endianfun   /* define message structures */

Definition at line 37 of file stats.c.

#define vl_msg_name_crc_list

Definition at line 68 of file stats.c.

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

Definition at line 42 of file stats.c.

#define vl_printfun

Definition at line 43 of file stats.c.

#define vl_typedefs   /* define message structures */

Definition at line 33 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 1906 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 320 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 390 of file stats.c.

static void do_combined_interface_counters ( stats_main_t sm)
static

Definition at line 624 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 745 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 1428 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void do_ip4_mfib_counters ( stats_main_t sm)
static

Definition at line 1621 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 1221 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 1927 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void do_ip6_mfib_counters ( stats_main_t sm)
static

Definition at line 1760 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 1376 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 445 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 942 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 198 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void dsunlock ( stats_main_t sm)
static

Definition at line 231 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 429 of file stats.c.

u8* format_vnet_interface_combined_counters ( u8 s,
va_list *  args 
)

Definition at line 94 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 141 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 259 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 364 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 499 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 403 of file stats.c.

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

Definition at line 1101 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 1163 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 1137 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 1317 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 1289 of file stats.c.

+ Here is the call graph for this function:

static int mfib_table_stats_walk_cb ( fib_node_index_t  fei,
void *  ctx 
)
static

Definition at line 1606 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 283 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 73 of file stats.c.

+ Here is the caller graph for this function:

void stats_dslock_with_hint ( int  hint,
int  tag 
)

Definition at line 224 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 252 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 2713 of file stats.c.

+ Here is the call graph for this function:

int stats_memclnt_delete_callback ( u32  client_index)

Definition at line 2681 of file stats.c.

+ Here is the caller graph for this function:

static void stats_thread_fn ( void *  arg)
static

Definition at line 2078 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 2628 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 578 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 2136 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 2190 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 2239 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 2289 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 2338 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 540 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 2435 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 2473 of file stats.c.

+ Here is the call graph for this function:

static void vl_api_want_ip4_mfib_stats_t_handler ( vl_api_want_ip4_mfib_stats_t mp)
static

Definition at line 2509 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 2618 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 2545 of file stats.c.

+ Here is the call graph for this function:

static void vl_api_want_ip6_mfib_stats_t_handler ( vl_api_want_ip6_mfib_stats_t mp)
static

Definition at line 2581 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 2623 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 682 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 877 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 2387 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 24 of file stats.c.