diff options
author | Pablo Neira Ayuso <pablo@gnumonks.org> | 2011-04-26 00:28:18 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@gnumonks.org> | 2011-04-26 00:28:18 +0200 |
commit | f0059596a20bfa406a500ca5d6b34bf88d333ed3 (patch) | |
tree | 41bc483077171529e20084ede0784dd6af076056 /src/shared/libosmocore/src/statistics.c | |
parent | d9639bb010d05a96a6cbced94668c5754a4f0de9 (diff) | |
parent | 28dbfe9bf7a799ab1da2563fd5e007d007b54168 (diff) |
Merge commit '28dbfe9bf7a799ab1da2563fd5e007d007b54168'
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; +} |