Hide libringbuffer private symbols
[lttng-ust.git] / libringbuffer / smp.h
1 /*
2 * SPDX-License-Identifier: LGPL-2.1-only
3 *
4 * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 */
6
7 #ifndef _LIBRINGBUFFER_SMP_H
8 #define _LIBRINGBUFFER_SMP_H
9
10 #include "ust-helper.h"
11 #include "getcpu.h"
12
13 /*
14 * 4kB of per-cpu data available. Enough to hold the control structures,
15 * but not ring buffers.
16 */
17 #define PER_CPU_MEM_SIZE 4096
18
19 LTTNG_HIDDEN
20 extern int __num_possible_cpus;
21 LTTNG_HIDDEN
22 extern void _get_num_possible_cpus(void);
23
24 static inline
25 int num_possible_cpus(void)
26 {
27 if (!__num_possible_cpus)
28 _get_num_possible_cpus();
29 return __num_possible_cpus;
30 }
31
32 #define for_each_possible_cpu(cpu) \
33 for ((cpu) = 0; (cpu) < num_possible_cpus(); (cpu)++)
34
35 #endif /* _LIBRINGBUFFER_SMP_H */
This page took 0.029273 seconds and 4 git commands to generate.