summaryrefslogtreecommitdiffstats
path: root/src/vlib/counter.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2018-06-01 18:52:25 -0400
committerDave Barach <dave@barachs.net>2018-06-08 11:42:01 -0400
commit048a4e5a000017d0d632ebf02dcc23d9bf9ccf72 (patch)
tree5f00dd3888faae59e316059506d064ba0a17fb5a /src/vlib/counter.c
parent59ae61ee7587502c0446655ecbe3daa296498f56 (diff)
export counters in a memfd segment
also export per-node error counters directory entries implement object types Change-Id: I8ce8e0a754e1be9de895c44ed9be6533b4ecef0f Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlib/counter.c')
-rw-r--r--src/vlib/counter.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/vlib/counter.c b/src/vlib/counter.c
index 62f4bd66ddc..29cd004fc3e 100644
--- a/src/vlib/counter.c
+++ b/src/vlib/counter.c
@@ -74,15 +74,32 @@ vlib_clear_combined_counters (vlib_combined_counter_main_t * cm)
}
}
+void *vlib_stats_push_heap (void) __attribute__ ((weak));
+void *
+vlib_stats_push_heap (void)
+{
+ return 0;
+};
+
+void vlib_stats_pop_heap (void *, void *) __attribute__ ((weak));
+void
+vlib_stats_pop_heap (void *notused, void *notused2)
+{
+};
+
+
void
vlib_validate_simple_counter (vlib_simple_counter_main_t * cm, u32 index)
{
vlib_thread_main_t *tm = vlib_get_thread_main ();
int i;
+ void *oldheap = vlib_stats_push_heap ();
vec_validate (cm->counters, tm->n_vlib_mains - 1);
for (i = 0; i < tm->n_vlib_mains; i++)
vec_validate_aligned (cm->counters[i], index, CLIB_CACHE_LINE_BYTES);
+
+ vlib_stats_pop_heap (cm, oldheap);
}
void
@@ -90,10 +107,13 @@ vlib_validate_combined_counter (vlib_combined_counter_main_t * cm, u32 index)
{
vlib_thread_main_t *tm = vlib_get_thread_main ();
int i;
+ void *oldheap = vlib_stats_push_heap ();
vec_validate (cm->counters, tm->n_vlib_mains - 1);
for (i = 0; i < tm->n_vlib_mains; i++)
vec_validate_aligned (cm->counters[i], index, CLIB_CACHE_LINE_BYTES);
+
+ vlib_stats_pop_heap (cm, oldheap);
}
u32