STATS: Dynamically mapped shared memory segment
[vpp.git] / src / vlib / counter.h
index 60e2055..3aacc9b 100644 (file)
@@ -40,6 +40,8 @@
 #ifndef included_vlib_counter_h
 #define included_vlib_counter_h
 
+#include <vlib/counter_types.h>
+
 /** \file
 
     Optimized thread-safe counters.
@@ -50,9 +52,6 @@
     The idea is to drastically eliminate atomic operations.
 */
 
-/** 64bit counters */
-typedef u64 counter_t;
-
 /** A collection of simple counters */
 
 typedef struct
@@ -63,6 +62,7 @@ typedef struct
                                            serialized incrementally. */
 
   char *name;                  /**< The counter collection's name. */
+  char *stat_segment_name;    /**< Name in stat segment directory */
 } vlib_simple_counter_main_t;
 
 /** The number of counters (not the number of per-thread counters) */
@@ -134,14 +134,6 @@ vlib_zero_simple_counter (vlib_simple_counter_main_t * cm, u32 index)
     }
 }
 
-/** Combined counter to hold both packets and byte differences.
- */
-typedef struct
-{
-  counter_t packets;                   /**< packet counter */
-  counter_t bytes;                     /**< byte counter  */
-} vlib_counter_t;
-
 /** Add two combined counters, results in the first counter
     @param [in,out] a - (vlib_counter_t *) dst counter
     @param b - (vlib_counter_t *) src counter
@@ -183,6 +175,7 @@ typedef struct
   vlib_counter_t *value_at_last_serialize; /**< Counter values as of last serialize. */
   u32 last_incremental_serialize_index;        /**< Last counter index serialized incrementally. */
   char *name; /**< The counter collection's name. */
+  char *stat_segment_name;     /**< Name in stat segment directory */
 } vlib_combined_counter_main_t;
 
 /** The number of counters (not the number of per-thread counters) */