libosmocore
0.9.6.311-c977
Osmocom core library
|
utility routines for keeping some statistics. More...
#include <string.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/statistics.h>
Functions | |
static | LLIST_HEAD (counters) |
struct osmo_counter * | osmo_counter_alloc (const char *name) |
Allocate a new counter. More... | |
void | osmo_counter_free (struct osmo_counter *ctr) |
Free the specified counter. More... | |
int | osmo_counters_for_each (int(*handle_counter)(struct osmo_counter *, void *), void *data) |
Iterate over all counters. More... | |
struct osmo_counter * | osmo_counter_get_by_name (const char *name) |
Resolve counter by human-readable name. More... | |
int | osmo_counter_difference (struct osmo_counter *ctr) |
Return the counter difference since the last call to this function. More... | |
Variables | |
void * | tall_ctr_ctx |
utility routines for keeping some statistics.
|
static |
struct osmo_counter* osmo_counter_alloc | ( | const char * | name | ) |
Allocate a new counter.
References osmo_counter::list, llist_add_tail(), osmo_counter::name, name, and tall_ctr_ctx.
int osmo_counter_difference | ( | struct osmo_counter * | ctr | ) |
Return the counter difference since the last call to this function.
References osmo_counter::previous, and osmo_counter::value.
Referenced by handle_counter().
void osmo_counter_free | ( | struct osmo_counter * | ctr | ) |
Free the specified counter.
[in] | ctr | Counter |
References osmo_counter::list, and llist_del().
struct osmo_counter* osmo_counter_get_by_name | ( | const char * | name | ) |
Resolve counter by human-readable name.
[in] | name | human-readable name of counter |
References osmo_counter::list, llist_for_each_entry, and osmo_counter::name.
int osmo_counters_for_each | ( | int(*)(struct osmo_counter *, void *) | handle_counter, |
void * | data | ||
) |
Iterate over all counters.
[in] | handle_counter | Call-back function, aborts if rc < 0 |
[in] | data | Private dtata handed through to handle_counter |
References handle_counter(), osmo_counter::list, and llist_for_each_entry.
Referenced by osmo_stats_report().
void* tall_ctr_ctx |
Referenced by osmo_counter_alloc().