diff options
Diffstat (limited to 'src/shared/libosmocore/src/statistics.c')
-rw-r--r-- | src/shared/libosmocore/src/statistics.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/shared/libosmocore/src/statistics.c b/src/shared/libosmocore/src/statistics.c index 34e6a408..83bb6ed3 100644 --- a/src/shared/libosmocore/src/statistics.c +++ b/src/shared/libosmocore/src/statistics.c @@ -20,12 +20,11 @@ * */ +#include <string.h> -#include <sys/types.h> - -#include <osmocore/linuxlist.h> -#include <osmocore/talloc.h> -#include <osmocore/statistics.h> +#include <osmocom/core/linuxlist.h> +#include <osmocom/core/talloc.h> +#include <osmocom/core/statistics.h> static LLIST_HEAD(counters); @@ -64,3 +63,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; +} |