Add a function to search for a counter by name
diff --git a/src/statistics.c b/src/statistics.c
index 183005d..d1ffe52 100644
--- a/src/statistics.c
+++ b/src/statistics.c
@@ -64,3 +64,13 @@
 	return rc;
 }
 
+struct counter *counter_get_by_name(const char *name)
+{
+	struct counter *ctr;
+
+	llist_for_each_entry(ctr, &counters, list) {
+		if (!strcmp(ctr->name, name))
+			return ctr;
+	}
+	return NULL;
+}