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
14 #include <lttng/ust-config.h>
15 #include "counter-types.h"
18 /* max_nr_elem is for each dimension. */
20 struct lib_counter
*lttng_counter_create(const struct lib_counter_config
*config
,
22 const size_t *max_nr_elem
,
23 int64_t global_sum_step
,
24 int global_counter_fd
,
25 int nr_counter_cpu_fds
,
26 const int *counter_cpu_fds
,
29 void lttng_counter_destroy(struct lib_counter
*counter
);
32 int lttng_counter_set_global_shm(struct lib_counter
*counter
, int fd
);
34 int lttng_counter_set_cpu_shm(struct lib_counter
*counter
, int cpu
, int fd
);
37 int lttng_counter_get_global_shm(struct lib_counter
*counter
, int *fd
, size_t *len
);
39 int lttng_counter_get_cpu_shm(struct lib_counter
*counter
, int cpu
, int *fd
, size_t *len
);
42 * Has counter received all expected shm ?
45 bool lttng_counter_ready(struct lib_counter
*counter
);
48 int lttng_counter_read(const struct lib_counter_config
*config
,
49 struct lib_counter
*counter
,
50 const size_t *dimension_indexes
,
51 int cpu
, int64_t *value
,
52 bool *overflow
, bool *underflow
);
54 int lttng_counter_aggregate(const struct lib_counter_config
*config
,
55 struct lib_counter
*counter
,
56 const size_t *dimension_indexes
,
58 bool *overflow
, bool *underflow
);
60 int lttng_counter_clear(const struct lib_counter_config
*config
,
61 struct lib_counter
*counter
,
62 const size_t *dimension_indexes
);
64 #endif /* _LTTNG_COUNTER_H */
This page took 0.033035 seconds and 6 git commands to generate.