Fix: 4.10 hotplug adaptation backward compat
[lttng-modules.git] / lttng-cpuhotplug.h
1 #ifndef LTTNG_CPUHOTPLUG_H
2 #define LTTNG_CPUHOTPLUG_H
3
4 /*
5 * lttng-cpuhotplug.h
6 *
7 * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; only
12 * version 2.1 of the License.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24 #include <linux/cpuhotplug.h>
25
26 struct lttng_cpuhp_node;
27
28 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
29 enum lttng_cpuhp_component {
30 LTTNG_RING_BUFFER_FRONTEND,
31 LTTNG_RING_BUFFER_BACKEND,
32 LTTNG_RING_BUFFER_ITER,
33 LTTNG_CONTEXT_PERF_COUNTERS,
34 };
35
36 struct lttng_cpuhp_node {
37 enum lttng_cpuhp_component component;
38 struct hlist_node node;
39 };
40
41 extern enum cpuhp_state lttng_hp_prepare;
42 extern enum cpuhp_state lttng_hp_online;
43
44 int lttng_cpuhp_rb_backend_prepare(unsigned int cpu,
45 struct lttng_cpuhp_node *node);
46 int lttng_cpuhp_rb_frontend_dead(unsigned int cpu,
47 struct lttng_cpuhp_node *node);
48 int lttng_cpuhp_rb_frontend_online(unsigned int cpu,
49 struct lttng_cpuhp_node *node);
50 int lttng_cpuhp_rb_frontend_offline(unsigned int cpu,
51 struct lttng_cpuhp_node *node);
52 int lttng_cpuhp_rb_iter_online(unsigned int cpu,
53 struct lttng_cpuhp_node *node);
54
55 /* Ring buffer is a separate library. */
56 void lttng_rb_set_hp_prepare(enum cpuhp_state val);
57 void lttng_rb_set_hp_online(enum cpuhp_state val);
58
59 extern enum cpuhp_state lttng_rb_hp_prepare;
60 extern enum cpuhp_state lttng_rb_hp_online;
61
62 #endif
63
64 #endif /* LTTNG_CPUHOTPLUG_H */
This page took 0.032927 seconds and 4 git commands to generate.