2 * SPDX-License-Identifier: LGPL-2.1-only
4 * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 #ifndef _LIBCOUNTER_SMP_H
8 #define _LIBCOUNTER_SMP_H
10 #include "ust-helper.h"
13 * 4kB of per-cpu data available.
15 #define LTTNG_COUNTER_PER_CPU_MEM_SIZE 4096
18 extern int __lttng_counter_num_possible_cpus
;
20 extern void _lttng_counter_get_num_possible_cpus(void);
23 int lttng_counter_num_possible_cpus(void)
25 if (!__lttng_counter_num_possible_cpus
)
26 _lttng_counter_get_num_possible_cpus();
27 return __lttng_counter_num_possible_cpus
;
30 #define lttng_counter_for_each_possible_cpu(cpu) \
31 for ((cpu) = 0; (cpu) < lttng_counter_num_possible_cpus(); (cpu)++)
33 #endif /* _LIBCOUNTER_SMP_H */