2 * SPDX-License-Identifier: MIT
4 * Copyright (C) 2020 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 #ifndef _LTTNG_COUNTER_TYPES_H
10 #define _LTTNG_COUNTER_TYPES_H
15 #include <sys/types.h>
16 #include "counter-config.h"
17 #include <lttng/ust-config.h>
18 #include "shm_types.h"
20 struct lib_counter_dimension
{
22 * Max. number of indexable elements.
26 * The stride for a dimension is the multiplication factor which
27 * should be applied to its index to take into account other
28 * dimensions nested inside.
33 struct lib_counter_layout
{
35 unsigned long *overflow_bitmap
;
36 unsigned long *underflow_bitmap
;
39 struct lttng_counter_shm_handle handle
;
42 enum lib_counter_arithmetic
{
43 LIB_COUNTER_ARITHMETIC_MODULAR
,
44 LIB_COUNTER_ARITHMETIC_SATURATE
,
49 int64_t allocated_elem
;
50 struct lib_counter_dimension
*dimensions
;
51 enum lib_counter_arithmetic arithmetic
;
65 } global_sum_step
; /* 0 if unused */
66 struct lib_counter_config config
;
68 struct lib_counter_layout global_counters
;
69 struct lib_counter_layout
*percpu_counters
;
72 struct lttng_counter_shm_object_table
*object_table
;
75 #endif /* _LTTNG_COUNTER_TYPES_H */