Move to kernel style SPDX license identifiers
[lttng-ust.git] / libcounter / smp.h
CommitLineData
ebabbf58 1/*
c0c0989a 2 * SPDX-License-Identifier: LGPL-2.1-only
ebabbf58
MD
3 *
4 * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ebabbf58
MD
5 */
6
c0c0989a
MJ
7#ifndef _LIBCOUNTER_SMP_H
8#define _LIBCOUNTER_SMP_H
9
3d5db36a
MJ
10#include "helper.h"
11
ebabbf58
MD
12/*
13 * 4kB of per-cpu data available.
14 */
15#define LTTNG_COUNTER_PER_CPU_MEM_SIZE 4096
16
3d5db36a 17LTTNG_HIDDEN
ebabbf58 18extern int __lttng_counter_num_possible_cpus;
3d5db36a 19LTTNG_HIDDEN
ebabbf58
MD
20extern void _lttng_counter_get_num_possible_cpus(void);
21
22static inline
23int lttng_counter_num_possible_cpus(void)
24{
25 if (!__lttng_counter_num_possible_cpus)
26 _lttng_counter_get_num_possible_cpus();
27 return __lttng_counter_num_possible_cpus;
28}
29
30#define lttng_counter_for_each_possible_cpu(cpu) \
31 for ((cpu) = 0; (cpu) < lttng_counter_num_possible_cpus(); (cpu)++)
32
33#endif /* _LIBCOUNTER_SMP_H */
This page took 0.023658 seconds and 4 git commands to generate.