Commit | Line | Data |
---|---|---|
a101fa10 MD |
1 | /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) |
2 | * | |
3 | * counter/counter.h | |
4 | * | |
5 | * LTTng Counters API | |
6 | * | |
7 | * Copyright (C) 2020 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
8 | */ | |
9 | ||
10 | #ifndef _LTTNG_COUNTER_H | |
11 | #define _LTTNG_COUNTER_H | |
12 | ||
13 | #include <linux/types.h> | |
14 | #include <linux/percpu.h> | |
15 | #include <counter/config.h> | |
16 | #include <counter/counter-types.h> | |
17 | ||
18 | /* max_nr_elem is for each dimension. */ | |
19 | struct lib_counter *lttng_counter_create(const struct lib_counter_config *config, | |
20 | size_t nr_dimensions, | |
21 | const size_t *max_nr_elem, | |
22 | int64_t global_sum_step); | |
23 | void lttng_counter_destroy(struct lib_counter *counter); | |
24 | ||
25 | int lttng_counter_get_nr_dimensions(const struct lib_counter_config *config, | |
26 | struct lib_counter *counter, | |
27 | size_t *nr_dimensions); | |
28 | int lttng_counter_get_max_nr_elem(const struct lib_counter_config *config, | |
29 | struct lib_counter *counter, | |
30 | size_t *max_nr_elem); /* array of size nr_dimensions */ | |
31 | ||
32 | int lttng_counter_read(const struct lib_counter_config *config, | |
33 | struct lib_counter *counter, | |
34 | const size_t *dimension_indexes, | |
35 | int cpu, int64_t *value, | |
36 | bool *overflow, bool *underflow); | |
37 | int lttng_counter_aggregate(const struct lib_counter_config *config, | |
38 | struct lib_counter *counter, | |
39 | const size_t *dimension_indexes, | |
40 | int64_t *value, | |
41 | bool *overflow, bool *underflow); | |
42 | int lttng_counter_clear(const struct lib_counter_config *config, | |
43 | struct lib_counter *counter, | |
44 | const size_t *dimension_indexes); | |
45 | ||
46 | #endif /* _LTTNG_COUNTER_H */ |