summaryrefslogtreecommitdiffstats
path: root/src/shared/libosmocore/src/statistics.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2011-04-26 00:28:18 +0200
committerPablo Neira Ayuso <pablo@gnumonks.org>2011-04-26 00:28:18 +0200
commitf0059596a20bfa406a500ca5d6b34bf88d333ed3 (patch)
tree41bc483077171529e20084ede0784dd6af076056 /src/shared/libosmocore/src/statistics.c
parentd9639bb010d05a96a6cbced94668c5754a4f0de9 (diff)
parent28dbfe9bf7a799ab1da2563fd5e007d007b54168 (diff)
Merge commit '28dbfe9bf7a799ab1da2563fd5e007d007b54168'
Diffstat (limited to 'src/shared/libosmocore/src/statistics.c')
-rw-r--r--src/shared/libosmocore/src/statistics.c19
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;
+}