aboutsummaryrefslogtreecommitdiffstats
path: root/src/statistics.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/statistics.c')
-rw-r--r--src/statistics.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/statistics.c b/src/statistics.c
index 183005df..d1ffe526 100644
--- a/src/statistics.c
+++ b/src/statistics.c
@@ -64,3 +64,13 @@ int counters_for_each(int (*handle_counter)(struct counter *, void *), void *dat
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;
+}