diff options
author | Damjan Marion <damarion@cisco.com> | 2022-03-14 13:04:38 +0100 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2022-03-31 15:51:26 +0000 |
commit | 66c858385f3dc1c36682771424a8a9e5a6cd8355 (patch) | |
tree | 7ed7b67b6ee084ce0c1cd9a6d25e3021d3110442 /src/vlib/stats/stats.c | |
parent | 8f60318aca8f1df267f1b9069bc9697e9c4b65b0 (diff) |
stats: convert error counters to normal counters
Change-Id: I9794da718805b40cc922e4f3cf316255398029a9
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vlib/stats/stats.c')
-rw-r--r-- | src/vlib/stats/stats.c | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/src/vlib/stats/stats.c b/src/vlib/stats/stats.c index 61f620469b1..9063fa375e6 100644 --- a/src/vlib/stats/stats.c +++ b/src/vlib/stats/stats.c @@ -244,64 +244,6 @@ vlib_stats_add_gauge (char *fmt, ...) } void -vlib_stats_register_error_index (u64 *em_vec, u64 index, char *fmt, ...) -{ - vlib_stats_segment_t *sm = vlib_stats_get_segment (); - vlib_stats_shared_header_t *shared_header = sm->shared_header; - vlib_stats_entry_t e = {}; - va_list va; - u8 *name; - - va_start (va, fmt); - name = va_format (0, fmt, &va); - va_end (va); - - ASSERT (shared_header); - - vlib_stats_segment_lock (); - u32 vector_index = vlib_stats_find_entry_index ("%v", name); - - if (vector_index == STAT_SEGMENT_INDEX_INVALID) - { - vec_add1 (name, 0); - vlib_stats_set_entry_name (&e, (char *) name); - e.type = STAT_DIR_TYPE_ERROR_INDEX; - e.index = index; - vector_index = vlib_stats_create_counter (&e); - - /* Warn clients to refresh any pointers they might be holding */ - shared_header->directory_vector = sm->directory_vector; - } - - vlib_stats_segment_unlock (); - vec_free (name); -} - -void -vlib_stats_update_error_vector (u64 *error_vector, u32 thread_index, int lock) -{ - vlib_stats_segment_t *sm = vlib_stats_get_segment (); - vlib_stats_shared_header_t *shared_header = sm->shared_header; - void *oldheap = clib_mem_set_heap (sm->heap); - - ASSERT (shared_header); - - if (lock) - vlib_stats_segment_lock (); - - /* Reset the client hash table pointer, since it WILL change! */ - vec_validate (sm->error_vector, thread_index); - sm->error_vector[thread_index] = error_vector; - - shared_header->error_vector = sm->error_vector; - shared_header->directory_vector = sm->directory_vector; - - if (lock) - vlib_stats_segment_unlock (); - clib_mem_set_heap (oldheap); -} - -void vlib_stats_set_gauge (u32 index, u64 value) { vlib_stats_segment_t *sm = vlib_stats_get_segment (); |