1 #ifndef _LIBRINGBUFFER_SMP_H
2 #define _LIBRINGBUFFER_SMP_H
7 * Copyright 2011 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 * Dual LGPL v2.1/GPL v2 license.
12 #include <lttng/core.h>
15 * 4kB of per-cpu data available. Enough to hold the control structures,
16 * but not ring buffers.
18 #define PER_CPU_MEM_SIZE 4096
20 extern int __num_possible_cpus
;
21 extern void _get_num_possible_cpus(void);
24 int num_possible_cpus(void)
26 if (!__num_possible_cpus
)
27 _get_num_possible_cpus();
28 return __num_possible_cpus
;
32 * get_cpu() returns the current CPU number. It may change due to
33 * migration, so it is only statistically accurate.
42 if (caa_likely(cpu
>= 0))
45 * If getcpu(2) is not implemented in the Kernel use CPU 0 as fallback.
50 #else /* #else #ifndef UST_VALGRIND */
55 * Valgrind does not support the sched_getcpu() vsyscall.
56 * It causes it to detect a segfault in the program and stop it.
57 * So if we want to check libust with valgrind, we have to refrain
58 * from using this call. TODO: it would probably be better to return
59 * other values too, to better test it.
63 #endif /* #else #ifndef UST_VALGRIND */
70 #define for_each_possible_cpu(cpu) \
71 for ((cpu) = 0; (cpu) < num_possible_cpus(); (cpu)++)
73 #endif /* _LIBRINGBUFFER_SMP_H */
This page took 0.03597 seconds and 4 git commands to generate.