| 1 | /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) |
| 2 | * |
| 3 | * counter/config.h |
| 4 | * |
| 5 | * LTTng Counters Configuration |
| 6 | * |
| 7 | * Copyright (C) 2020 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| 8 | */ |
| 9 | |
| 10 | #ifndef _LTTNG_COUNTER_CONFIG_H |
| 11 | #define _LTTNG_COUNTER_CONFIG_H |
| 12 | |
| 13 | #include <linux/types.h> |
| 14 | #include <linux/percpu.h> |
| 15 | |
| 16 | enum lib_counter_config_alloc { |
| 17 | COUNTER_ALLOC_PER_CPU = (1 << 0), |
| 18 | COUNTER_ALLOC_GLOBAL = (1 << 1), |
| 19 | }; |
| 20 | |
| 21 | enum lib_counter_config_sync { |
| 22 | COUNTER_SYNC_PER_CPU, |
| 23 | COUNTER_SYNC_GLOBAL, |
| 24 | }; |
| 25 | |
| 26 | struct lib_counter_config { |
| 27 | u32 alloc; /* enum lib_counter_config_alloc flags */ |
| 28 | enum lib_counter_config_sync sync; |
| 29 | enum { |
| 30 | COUNTER_ARITHMETIC_MODULAR, |
| 31 | COUNTER_ARITHMETIC_SATURATE, /* TODO */ |
| 32 | } arithmetic; |
| 33 | enum { |
| 34 | COUNTER_SIZE_8_BIT = 1, |
| 35 | COUNTER_SIZE_16_BIT = 2, |
| 36 | COUNTER_SIZE_32_BIT = 4, |
| 37 | COUNTER_SIZE_64_BIT = 8, |
| 38 | } counter_size; |
| 39 | }; |
| 40 | |
| 41 | #endif /* _LTTNG_COUNTER_CONFIG_H */ |