2 * SPDX-License-Identifier: MIT
4 * Copyright (C) 2020 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 #ifndef _LTTNG_COUNTER_H
10 #define _LTTNG_COUNTER_H
13 #include <lttng/ust-config.h>
14 #include "counter-types.h"
15 #include "ust-helper.h"
17 /* max_nr_elem is for each dimension. */
19 struct lib_counter
*lttng_counter_create(const struct lib_counter_config
*config
,
21 const size_t *max_nr_elem
,
22 int64_t global_sum_step
,
23 int global_counter_fd
,
24 int nr_counter_cpu_fds
,
25 const int *counter_cpu_fds
,
28 void lttng_counter_destroy(struct lib_counter
*counter
);
31 int lttng_counter_set_global_shm(struct lib_counter
*counter
, int fd
);
33 int lttng_counter_set_cpu_shm(struct lib_counter
*counter
, int cpu
, int fd
);
36 int lttng_counter_get_global_shm(struct lib_counter
*counter
, int *fd
, size_t *len
);
38 int lttng_counter_get_cpu_shm(struct lib_counter
*counter
, int cpu
, int *fd
, size_t *len
);
41 int lttng_counter_read(const struct lib_counter_config
*config
,
42 struct lib_counter
*counter
,
43 const size_t *dimension_indexes
,
44 int cpu
, int64_t *value
,
45 bool *overflow
, bool *underflow
);
47 int lttng_counter_aggregate(const struct lib_counter_config
*config
,
48 struct lib_counter
*counter
,
49 const size_t *dimension_indexes
,
51 bool *overflow
, bool *underflow
);
53 int lttng_counter_clear(const struct lib_counter_config
*config
,
54 struct lib_counter
*counter
,
55 const size_t *dimension_indexes
);
57 #endif /* _LTTNG_COUNTER_H */
This page took 0.071112 seconds and 4 git commands to generate.