diff options
author | Damjan Marion <damarion@cisco.com> | 2022-05-06 12:39:10 +0200 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2022-05-06 12:15:00 +0000 |
commit | 0530d09f9e9c0dab6bea32cf15a09fd885a6cbb7 (patch) | |
tree | 976364f5af4aaff81c1e90e36b8ee9373e3e5396 /src/vlib | |
parent | 6d953240bcdba267bccc84887b7ff73ce3e9d933 (diff) |
stats: add vlib_stats_free_string_vector
Type: improvement
Change-Id: Ifa9f908b24b5fe867826601d32eeb4f0d639fbeb
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib')
-rw-r--r-- | src/vlib/stats/stats.c | 7 | ||||
-rw-r--r-- | src/vlib/stats/stats.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/vlib/stats/stats.c b/src/vlib/stats/stats.c index e3a1a8a04d6..b7743ec70f2 100644 --- a/src/vlib/stats/stats.c +++ b/src/vlib/stats/stats.c @@ -348,6 +348,13 @@ vlib_stats_set_string_vector (vlib_stats_string_vector_t *svp, vlib_stats_segment_unlock (); } +void +vlib_stats_free_string_vector (vlib_stats_string_vector_t *sv) +{ + vlib_stats_header_t *sh = vec_header (*sv); + vlib_stats_remove_entry (sh->entry_index); +} + u32 vlib_stats_add_counter_vector (char *fmt, ...) { diff --git a/src/vlib/stats/stats.h b/src/vlib/stats/stats.h index 5f5581ca62b..b07f21724a0 100644 --- a/src/vlib/stats/stats.h +++ b/src/vlib/stats/stats.h @@ -144,6 +144,7 @@ typedef u8 **vlib_stats_string_vector_t; vlib_stats_string_vector_t vlib_stats_add_string_vector (char *fmt, ...); void vlib_stats_set_string_vector (vlib_stats_string_vector_t *sv, u32 index, char *fmt, ...); +void vlib_stats_free_string_vector (vlib_stats_string_vector_t *sv); /* symlink */ u32 vlib_stats_add_symlink (u32 entry_index, u32 vector_index, char *fmt, ...); |