diff options
author | Damjan Marion <damarion@cisco.com> | 2022-03-01 15:51:18 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2022-03-09 13:51:31 +0000 |
commit | 8973b07eecbbfe23a5267975f8052a5c6339c756 (patch) | |
tree | fe4d3507ff24c18743d3241cd9ab049ee2add062 /src/vpp-api/client/stat_client.c | |
parent | 317cace6185ae134d78a38e1a20249baf751035e (diff) |
stats: refactor
Type: refactor
Change-Id: Ifd533a095d979dc55bfbe5fac7e0b7510a4d900c
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vpp-api/client/stat_client.c')
-rw-r--r-- | src/vpp-api/client/stat_client.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/vpp-api/client/stat_client.c b/src/vpp-api/client/stat_client.c index b0c83919f03..a5eafaf5f68 100644 --- a/src/vpp-api/client/stat_client.c +++ b/src/vpp-api/client/stat_client.c @@ -29,7 +29,8 @@ #include <vppinfra/vec.h> #include <vppinfra/lock.h> #include <stdatomic.h> -#include <vpp/stats/stat_segment.h> +#include <vlib/vlib.h> +#include <vlib/stats/stats.h> #include <vpp-api/client/stat_client.h> stat_client_main_t stat_client_main; @@ -81,8 +82,8 @@ recv_fd (int sock) return fd; } -static stat_segment_directory_entry_t * -get_stat_vector_r (stat_client_main_t * sm) +static vlib_stats_entry_t * +get_stat_vector_r (stat_client_main_t *sm) { ASSERT (sm->shared_header); return stat_segment_adjust (sm, @@ -172,7 +173,7 @@ double stat_segment_heartbeat_r (stat_client_main_t * sm) { stat_segment_access_t sa; - stat_segment_directory_entry_t *ep; + vlib_stats_entry_t *ep; /* Has directory been updated? */ if (sm->shared_header->epoch != sm->current_epoch) @@ -223,7 +224,7 @@ stat_vec_combined_init (vlib_counter_t c) * threads), otherwise copy out all values. */ static stat_segment_data_t -copy_data (stat_segment_directory_entry_t *ep, u32 index2, char *name, +copy_data (vlib_stats_entry_t *ep, u32 index2, char *name, stat_client_main_t *sm) { stat_segment_data_t result = { 0 }; @@ -297,7 +298,7 @@ copy_data (stat_segment_directory_entry_t *ep, u32 index2, char *name, case STAT_DIR_TYPE_SYMLINK: /* Gather info from all threads into a vector */ { - stat_segment_directory_entry_t *ep2; + vlib_stats_entry_t *ep2; ep2 = vec_elt_at_index (sm->directory_vector, ep->index1); return copy_data (ep2, ep->index2, ep->name, sm); } @@ -370,7 +371,7 @@ stat_segment_ls_r (uint8_t ** patterns, stat_client_main_t * sm) if (stat_segment_access_start (&sa, sm)) return 0; - stat_segment_directory_entry_t *counter_vec = get_stat_vector_r (sm); + vlib_stats_entry_t *counter_vec = get_stat_vector_r (sm); for (j = 0; j < vec_len (counter_vec); j++) { for (i = 0; i < vec_len (patterns); i++) @@ -413,7 +414,7 @@ stat_segment_data_t * stat_segment_dump_r (uint32_t * stats, stat_client_main_t * sm) { int i; - stat_segment_directory_entry_t *ep; + vlib_stats_entry_t *ep; stat_segment_data_t *res = 0; stat_segment_access_t sa; @@ -474,7 +475,7 @@ stat_segment_string_vector (uint8_t ** string_vector, const char *string) stat_segment_data_t * stat_segment_dump_entry_r (uint32_t index, stat_client_main_t * sm) { - stat_segment_directory_entry_t *ep; + vlib_stats_entry_t *ep; stat_segment_data_t *res = 0; stat_segment_access_t sa; @@ -504,9 +505,9 @@ stat_segment_dump_entry (uint32_t index) char * stat_segment_index_to_name_r (uint32_t index, stat_client_main_t * sm) { - stat_segment_directory_entry_t *ep; + vlib_stats_entry_t *ep; stat_segment_access_t sa; - stat_segment_directory_entry_t *vec; + vlib_stats_entry_t *vec; /* Has directory been update? */ if (sm->shared_header->epoch != sm->current_epoch) |