libosmocore 0.9.6-23.20170220git32ee5af8.fc42
Osmocom core library
|
Common routines regarding statistics. More...
Go to the source code of this file.
Data Structures | |
struct | osmo_counter |
Functions | |
static void | osmo_counter_dec (struct osmo_counter *ctr) |
Decrement counter. | |
static void | osmo_counter_inc (struct osmo_counter *ctr) |
Increment counter. | |
static unsigned long | osmo_counter_get (struct osmo_counter *ctr) |
Get current value of counter. | |
static void | osmo_counter_reset (struct osmo_counter *ctr) |
Reset current value of counter to 0. | |
struct osmo_counter * | osmo_counter_alloc (const char *name) |
Allocate a new counter. | |
void | osmo_counter_free (struct osmo_counter *ctr) |
Free the specified counter. | |
int | osmo_counters_for_each (int(*handle_counter)(struct osmo_counter *, void *), void *data) |
Iterate over all counters. | |
struct osmo_counter * | osmo_counter_get_by_name (const char *name) |
Resolve counter by human-readable name. | |
int | osmo_counter_difference (struct osmo_counter *ctr) |
Return the counter difference since the last call to this function. | |
Common routines regarding statistics.
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(* | handle_counter )(struct osmo_counter *, void *), |
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 osmo_counter::list, and llist_for_each_entry.