summaryrefslogtreecommitdiffstats
path: root/src/vlib/error.c
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-05-16 15:01:34 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-05-22 09:43:49 +0000
commit233e4681830bc2a9cd40deb4b5909b4e310d1a2a (patch)
tree495c36ffbafdfaf8c85672024e2162ea8ee923ac /src/vlib/error.c
parenta29d18ae6bb7cda3923693a052c3b9208588be8e (diff)
stats: support multiple works for error counters
The current code only allowed access to the main thread error counters. That is not so useful for a multi worker instance. No return a vector indexed by thread of counter_t values. Type: fix Change-Id: Ie322c8889c0c8175e1116e71de04a2cf453b9ed7 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vlib/error.c')
-rw-r--r--src/vlib/error.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/vlib/error.c b/src/vlib/error.c
index a416649cfa7..7c61f319fc0 100644
--- a/src/vlib/error.c
+++ b/src/vlib/error.c
@@ -39,6 +39,7 @@
#include <vlib/vlib.h>
#include <vppinfra/heap.h>
+#include <vlib/stat_weak_inlines.h>
uword
vlib_error_drop_buffers (vlib_main_t * vm,
@@ -109,20 +110,6 @@ vlib_error_drop_buffers (vlib_main_t * vm,
return n_buffers;
}
-void vlib_stats_register_error_index (u8 *, u64 *, u64)
- __attribute__ ((weak));
-void
-vlib_stats_register_error_index (u8 * notused, u64 * notused2, u64 notused3)
-{
-};
-
-void vlib_stats_pop_heap2 (void *, u32, void *) __attribute__ ((weak));
-void
-vlib_stats_pop_heap2 (void *notused, u32 notused2, void *notused3)
-{
-};
-
-
/* Reserves given number of error codes for given node. */
void
vlib_register_errors (vlib_main_t * vm,
@@ -132,7 +119,6 @@ vlib_register_errors (vlib_main_t * vm,
vlib_node_t *n = vlib_get_node (vm, node_index);
uword l;
void *oldheap;
- void *vlib_stats_push_heap (void) __attribute__ ((weak));
ASSERT (vlib_get_thread_index () == 0);
@@ -157,7 +143,7 @@ vlib_register_errors (vlib_main_t * vm,
vec_validate (vm->error_elog_event_types, l - 1);
/* Switch to the stats segment ... */
- oldheap = vlib_stats_push_heap ();
+ oldheap = vlib_stats_push_heap (0);
/* Allocate a counter/elog type for each error. */
vec_validate (em->counters, l - 1);
@@ -186,7 +172,7 @@ vlib_register_errors (vlib_main_t * vm,
}
/* (re)register the em->counters base address, switch back to main heap */
- vlib_stats_pop_heap2 (em->counters, vm->thread_index, oldheap);
+ vlib_stats_pop_heap2 (em->counters, vm->thread_index, oldheap, 1);
{
elog_event_type_t t;