Move liblttng-ust-pthread-wrapper to 'src/lib/'
[lttng-ust.git] / src / common / counter / 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
ebabbf58
MD
10/*
11 * 4kB of per-cpu data available.
12 */
13#define LTTNG_COUNTER_PER_CPU_MEM_SIZE 4096
14
1d18d519
MJ
15extern int __lttng_counter_num_possible_cpus
16 __attribute__((visibility("hidden")));
ddabe860 17
1d18d519
MJ
18extern void _lttng_counter_get_num_possible_cpus(void)
19 __attribute__((visibility("hidden")));
ebabbf58
MD
20
21static inline
22int lttng_counter_num_possible_cpus(void)
23{
24 if (!__lttng_counter_num_possible_cpus)
25 _lttng_counter_get_num_possible_cpus();
26 return __lttng_counter_num_possible_cpus;
27}
28
29#define lttng_counter_for_each_possible_cpu(cpu) \
30 for ((cpu) = 0; (cpu) < lttng_counter_num_possible_cpus(); (cpu)++)
31
32#endif /* _LIBCOUNTER_SMP_H */
This page took 0.026318 seconds and 4 git commands to generate.