From 58492a83722caf1c49977d73abf931418ce1f8f2 Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Tue, 4 Sep 2018 13:19:12 +0200 Subject: STATS: Dynamically mapped shared memory segment Move from using a hash to a vector with offsets into shared memory. Limit exposure of VPP data structures and include files to external stats library and applications. Change-Id: Ic06129f12d10cf4c4946a86d9bc734eacff2c7da Signed-off-by: Ole Troan --- src/vpp-api/client/stat_client.h | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'src/vpp-api/client/stat_client.h') diff --git a/src/vpp-api/client/stat_client.h b/src/vpp-api/client/stat_client.h index 73e91b1881b..c1a0ecf4753 100644 --- a/src/vpp-api/client/stat_client.h +++ b/src/vpp-api/client/stat_client.h @@ -17,8 +17,9 @@ #ifndef included_stat_client_h #define included_stat_client_h -#include -#include +#include +#include +#include typedef struct { @@ -26,31 +27,25 @@ typedef struct stat_directory_type_t type; union { - f64 scalar_value; - u64 error_value; - u64 *vector_pointer; + double scalar_value; + uint64_t error_value; counter_t **simple_counter_vec; vlib_counter_t **combined_counter_vec; }; } stat_segment_data_t; -typedef struct -{ - char *name; - stat_segment_directory_entry_t *ep; -} stat_segment_cached_pointer_t; - int stat_segment_connect (char *socket_name); void stat_segment_disconnect (void); -u8 **stat_segment_ls (u8 ** pattern); -stat_segment_data_t *stat_segment_dump (u8 ** counter_vec); -stat_segment_cached_pointer_t *stat_segment_register (u8 ** counter_vec); -/* Collects registered counters */ -stat_segment_data_t *stat_segment_collect (stat_segment_cached_pointer_t *); -void stat_segment_data_free (stat_segment_data_t * res); -f64 stat_segment_heartbeat (void); -u8 **stat_segment_string_vector (u8 ** string_vector, char *string); +uint8_t **stat_segment_string_vector (uint8_t ** string_vector, char *string); int stat_segment_vec_len (void *vec); +uint32_t *stat_segment_ls (uint8_t ** pattern); +stat_segment_data_t *stat_segment_dump (uint32_t * counter_vec); +stat_segment_data_t *stat_segment_dump_entry (uint32_t index); +void stat_segment_data_free (stat_segment_data_t * res); + +double stat_segment_heartbeat (void); + +char *stat_segment_index_to_name (uint32_t index); #endif /* included_stat_client_h */ -- cgit 1.2.3-korg