40 #ifndef included_vlib_counter_h 41 #define included_vlib_counter_h 79 my_minis = cm->
minis[cpu_index];
82 new = old + increment;
87 __sync_fetch_and_add (&cm->
maxi[index],
new);
110 v += cm->
maxi[index];
213 u32 packet_increment,
217 u32 old_packets, new_packets;
218 i32 old_bytes, new_bytes;
221 my_minis = cm->
minis[cpu_index];
225 old_bytes = mini->
bytes;
227 new_packets = old_packets + packet_increment;
228 new_bytes = old_bytes + byte_increment;
231 mini->
bytes = new_bytes;
238 __sync_fetch_and_add (&maxi->
packets, new_packets);
239 __sync_fetch_and_add (&maxi->
bytes, new_bytes);
301 #define vlib_counter_len(cm) vec_len((cm)->maxi) u64 * value_at_last_serialize
sll srl srl sll sra u16x4 i
void vlib_clear_combined_counters(vlib_combined_counter_main_t *cm)
void vlib_validate_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
vlib_counter_t * value_at_last_serialize
always_inline u64 vlib_get_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
u64 * value_at_last_clear
always_inline void vlib_counter_add(vlib_counter_t *a, vlib_counter_t *b)
always_inline void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 cpu_index, u32 index, u32 packet_increment, u32 byte_increment)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
serialize_function_t unserialize_vlib_simple_counter_main
always_inline void vlib_counter_zero(vlib_counter_t *a)
always_inline void vlib_increment_simple_counter(vlib_simple_counter_main_t *cm, u32 cpu_index, u32 index, u32 increment)
static void vlib_get_combined_counter(vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
u32 last_incremental_serialize_index
always_inline void vlib_counter_sub(vlib_counter_t *a, vlib_counter_t *b)
serialize_function_t serialize_vlib_combined_counter_main
u32 last_incremental_serialize_index
vlib_mini_counter_t ** minis
void vlib_validate_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
serialize_function_t serialize_vlib_simple_counter_main
serialize_function_t unserialize_vlib_combined_counter_main
always_inline void vlib_zero_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void( serialize_function_t)(serialize_main_t *m, va_list *va)
always_inline void vlib_zero_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
vlib_counter_t * value_at_last_clear
void vlib_clear_simple_counters(vlib_simple_counter_main_t *cm)