|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
40 #ifndef included_vlib_counter_h
41 #define included_vlib_counter_h
80 my_counters[
index] += increment;
99 my_counters[
index] -= decrement;
140 my_counters =
cm->counters[
i];
141 v += my_counters[
index];
163 my_counters =
cm->counters[
i];
164 my_counters[
index] = 0;
176 a->packets +=
b->packets;
177 a->bytes +=
b->bytes;
189 a->packets -=
b->packets;
190 a->bytes -=
b->bytes;
199 a->packets =
a->bytes = 0;
283 my_counters =
cm->counters[
i];
305 my_counters =
cm->counters[
i];
343 #define vlib_counter_len(cm) vec_len((cm)->maxi)
counter_t ** counters
Per-thread u64 non-atomic counters.
static void vlib_decrement_simple_counter(vlib_simple_counter_main_t *cm, u32 thread_index, u32 index, u64 decrement)
Decrement a simple counter.
void vlib_validate_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
validate a simple counter
static counter_t vlib_get_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
Get the value of a simple counter Scrapes the entire set of per-thread counters.
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
char * name
The counter collection's name.
void vlib_free_combined_counter(vlib_combined_counter_main_t *cm)
static void vlib_counter_zero(vlib_counter_t *a)
Clear a combined counter.
vlib_counter_t ** counters
Per-thread u64 non-atomic counter pairs.
static void vlib_increment_simple_counter(vlib_simple_counter_main_t *cm, u32 thread_index, u32 index, u64 increment)
Increment a simple counter.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
Combined counter to hold both packets and byte differences.
static void vlib_prefetch_combined_counter(const vlib_combined_counter_main_t *cm, u32 thread_index, u32 index)
Pre-fetch a per-thread combined counter for the given object index.
uint64_t counter_t
64bit counters
static void vlib_zero_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
Clear a combined counter Clears the set of per-thread counters.
char * name
The counter collection's name.
static void vlib_counter_sub(vlib_counter_t *a, vlib_counter_t *b)
Subtract combined counters, results in the first counter.
vnet_feature_config_main_t * cm
static void vlib_counter_add(vlib_counter_t *a, vlib_counter_t *b)
Add two combined counters, results in the first counter.
counter_t packets
packet counter
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
static void vlib_set_simple_counter(vlib_simple_counter_main_t *cm, u32 thread_index, u32 index, u64 value)
Set a simple counter.
void vlib_free_simple_counter(vlib_simple_counter_main_t *cm)
A collection of combined counters.
static void vlib_zero_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
Clear a simple counter Clears the set of per-thread u16 counters, and the u64 counter.
u32 vlib_simple_counter_n_counters(const vlib_simple_counter_main_t *cm)
The number of counters (not the number of per-thread counters)
char * stat_segment_name
Name in stat segment directory.
counter_t bytes
byte counter
char * stat_segment_name
Name in stat segment directory.
A collection of simple counters.
void vlib_validate_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
validate a combined counter
u32 vlib_combined_counter_n_counters(const vlib_combined_counter_main_t *cm)
The number of counters (not the number of per-thread counters)
int vlib_validate_combined_counter_will_expand(vlib_combined_counter_main_t *cm, u32 index)
static_always_inline void clib_prefetch_store(void *p)
void vlib_clear_combined_counters(vlib_combined_counter_main_t *cm)
Clear a collection of combined counters.
void vlib_clear_simple_counters(vlib_simple_counter_main_t *cm)
Clear a collection of simple counters.