Implement lttng_ust_get_cpu()
[lttng-ust.git] / libringbuffer / smp.h
CommitLineData
a6352fd4
MD
1#ifndef _LIBRINGBUFFER_SMP_H
2#define _LIBRINGBUFFER_SMP_H
3
4/*
5 * libringbuffer/smp.h
6 *
7 * Copyright 2011 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 *
9 * Dual LGPL v2.1/GPL v2 license.
10 */
11
4318ae1b 12#include <lttng/core.h>
2b2d6ff7 13#include "getcpu.h"
a6352fd4
MD
14
15/*
16 * 4kB of per-cpu data available. Enough to hold the control structures,
17 * but not ring buffers.
18 */
19#define PER_CPU_MEM_SIZE 4096
20
21extern int __num_possible_cpus;
22extern void _get_num_possible_cpus(void);
23
24static inline
25int num_possible_cpus(void)
26{
27 if (!__num_possible_cpus)
28 _get_num_possible_cpus();
29 return __num_possible_cpus;
30}
31
a6352fd4
MD
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.025176 seconds and 4 git commands to generate.