M: Florin Coras <fcoras@cisco.com>
F: src/vcl
+Statistics Segment
+I: stats
+M: Ole Troan <ot@cisco.com>
+F: src/vpp/stats/
+F: src/vpp-api/client/stat_client.[ch]
+
THE REST
I: misc
C: Contact vpp-dev Mailing List <vpp-dev@fd.io>
return stat_segment_index_to_name_r (index, sm);
}
+uint64_t
+stat_segment_version_r (stat_client_main_t * sm)
+{
+ ASSERT (sm->shared_header);
+ return sm->shared_header->version;
+}
+
+uint64_t
+stat_segment_version (void)
+{
+ stat_client_main_t *sm = &stat_client_main;
+ return stat_segment_version_r (sm);
+}
+
/*
* fd.io coding-style-patch-verification: ON
*
char *stat_segment_index_to_name_r (uint32_t index, stat_client_main_t * sm);
char *stat_segment_index_to_name (uint32_t index);
+uint64_t stat_segment_version (void);
+uint64_t stat_segment_version_r (stat_client_main_t * sm);
#endif /* included_stat_client_h */
typedef struct
{
+ uint64_t version;
uint64_t epoch;
uint64_t in_progress;
uint64_t directory_offset;
int stat_segment_vec_len(void *vec);
uint8_t **stat_segment_string_vector(uint8_t **string_vector, char *string);
char *stat_segment_index_to_name_r (uint32_t index, stat_client_main_t * sm);
+uint64_t stat_segment_version(void);
+uint64_t stat_segment_version_r(stat_client_main_t *sm);
void free(void *ptr);
""")
sm->directory_vector_by_name = hash_create_string (0, sizeof (uword));
sm->shared_header = shared_header = memaddr;
+
+ shared_header->version = STAT_SEGMENT_VERSION;
+
sm->stat_segment_lockp = clib_mem_alloc (sizeof (clib_spinlock_t));
clib_spinlock_init (sm->stat_segment_lockp);
/* Default stat segment 32m */
#define STAT_SEGMENT_DEFAULT_SIZE (32<<20)
+/* Shared segment memory layout version */
+#define STAT_SEGMENT_VERSION 1
+
/*
* Shared header first in the shared memory segment.
*/
typedef struct
{
+ u64 version;
atomic_int_fast64_t epoch;
atomic_int_fast64_t in_progress;
atomic_int_fast64_t directory_offset;