make per-adj counters configurable
Change-Id: Ifdd2b204ecf7d855f1269c11224b9c825311904d
Signed-off-by: Neale Ranns <nranns@cisco.com>
diff --git a/src/vnet/adj/adj.h b/src/vnet/adj/adj.h
index 29bae67..fcc5890 100644
--- a/src/vnet/adj/adj.h
+++ b/src/vnet/adj/adj.h
@@ -109,6 +109,12 @@
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 @@
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