Change-Id: Ie2a1086e829fc2aacf8ba74a33ba0b87bbbb60fc
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
#include <stdint.h>
#include <lttng/ust-config.h>
#include "counter-types.h"
#include <stdint.h>
#include <lttng/ust-config.h>
#include "counter-types.h"
/* max_nr_elem is for each dimension. */
/* max_nr_elem is for each dimension. */
struct lib_counter *lttng_counter_create(const struct lib_counter_config *config,
size_t nr_dimensions,
const size_t *max_nr_elem,
struct lib_counter *lttng_counter_create(const struct lib_counter_config *config,
size_t nr_dimensions,
const size_t *max_nr_elem,
int nr_counter_cpu_fds,
const int *counter_cpu_fds,
bool is_daemon);
int nr_counter_cpu_fds,
const int *counter_cpu_fds,
bool is_daemon);
void lttng_counter_destroy(struct lib_counter *counter);
void lttng_counter_destroy(struct lib_counter *counter);
int lttng_counter_set_global_shm(struct lib_counter *counter, int fd);
int lttng_counter_set_global_shm(struct lib_counter *counter, int fd);
int lttng_counter_set_cpu_shm(struct lib_counter *counter, int cpu, int fd);
int lttng_counter_set_cpu_shm(struct lib_counter *counter, int cpu, int fd);
int lttng_counter_get_global_shm(struct lib_counter *counter, int *fd, size_t *len);
int lttng_counter_get_global_shm(struct lib_counter *counter, int *fd, size_t *len);
int lttng_counter_get_cpu_shm(struct lib_counter *counter, int cpu, int *fd, size_t *len);
int lttng_counter_get_cpu_shm(struct lib_counter *counter, int cpu, int *fd, size_t *len);
int lttng_counter_read(const struct lib_counter_config *config,
struct lib_counter *counter,
const size_t *dimension_indexes,
int cpu, int64_t *value,
bool *overflow, bool *underflow);
int lttng_counter_read(const struct lib_counter_config *config,
struct lib_counter *counter,
const size_t *dimension_indexes,
int cpu, int64_t *value,
bool *overflow, bool *underflow);
int lttng_counter_aggregate(const struct lib_counter_config *config,
struct lib_counter *counter,
const size_t *dimension_indexes,
int64_t *value,
bool *overflow, bool *underflow);
int lttng_counter_aggregate(const struct lib_counter_config *config,
struct lib_counter *counter,
const size_t *dimension_indexes,
int64_t *value,
bool *overflow, bool *underflow);
int lttng_counter_clear(const struct lib_counter_config *config,
struct lib_counter *counter,
const size_t *dimension_indexes);
int lttng_counter_clear(const struct lib_counter_config *config,
struct lib_counter *counter,
const size_t *dimension_indexes);
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* 4kB of per-cpu data available.
*/
#define LTTNG_COUNTER_PER_CPU_MEM_SIZE 4096
/*
* 4kB of per-cpu data available.
*/
#define LTTNG_COUNTER_PER_CPU_MEM_SIZE 4096
extern int __lttng_counter_num_possible_cpus;
extern int __lttng_counter_num_possible_cpus;
extern void _lttng_counter_get_num_possible_cpus(void);
static inline
extern void _lttng_counter_get_num_possible_cpus(void);
static inline