From 9c6a613feb2d718c5756cecbcd3ab84156241db2 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 21 Feb 2017 05:33:14 -0800 Subject: make per-adj counters configurable Change-Id: Ifdd2b204ecf7d855f1269c11224b9c825311904d Signed-off-by: Neale Ranns --- src/vnet/adj/adj.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/vnet/adj/adj.h') diff --git a/src/vnet/adj/adj.h b/src/vnet/adj/adj.h index 29bae6733b3..fcc5890c7d7 100644 --- a/src/vnet/adj/adj.h +++ b/src/vnet/adj/adj.h @@ -108,6 +108,12 @@ extern ip_adjacency_t *adj_pool; */ extern vlib_combined_counter_main_t adjacency_counters; +/** + * @brief Global Config for enabling per-adjacency counters + * This is configurable because it comes with a non-negligible + * performance cost. */ +extern int adj_per_adj_counters; + /** * @brief * Get a pointer to an adjacency object from its index @@ -118,4 +124,13 @@ adj_get (adj_index_t adj_index) return (vec_elt_at_index(adj_pool, adj_index)); } +/** + * @brief Get the global configuration option for enabling per-adj counters + */ +static inline int +adj_are_counters_enabled (void) +{ + return (adj_per_adj_counters); +} + #endif -- cgit 1.2.3-korg