From b63dbc537c02b1978345744ab34765b2d75011a6 Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Fri, 14 Jun 2019 10:26:14 +0200 Subject: stats: add version field to stat segment base header Add a version in the base header of the stat segment To make support for multiple reader implementations safer. Change-Id: I6816e2a51a98c2df1e621e80d4ef0b4ba4e9f47b Type: feature Signed-off-by: Ole Troan --- src/vpp-api/client/stat_client.c | 14 ++++++++++++++ src/vpp-api/client/stat_client.h | 2 ++ 2 files changed, 16 insertions(+) (limited to 'src/vpp-api/client') diff --git a/src/vpp-api/client/stat_client.c b/src/vpp-api/client/stat_client.c index 8991806448a..cfe213d938a 100644 --- a/src/vpp-api/client/stat_client.c +++ b/src/vpp-api/client/stat_client.c @@ -509,6 +509,20 @@ stat_segment_index_to_name (uint32_t index) 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 * diff --git a/src/vpp-api/client/stat_client.h b/src/vpp-api/client/stat_client.h index 901ec325522..12faddb7bce 100644 --- a/src/vpp-api/client/stat_client.h +++ b/src/vpp-api/client/stat_client.h @@ -78,6 +78,8 @@ double stat_segment_heartbeat (void); 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 */ -- cgit 1.2.3-korg