1 #ifndef LTTNG_CPUHOTPLUG_H
2 #define LTTNG_CPUHOTPLUG_H
7 * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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.
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.
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
24 #include <linux/cpuhotplug.h>
26 struct lttng_cpuhp_node
;
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
,
36 struct lttng_cpuhp_node
{
37 enum lttng_cpuhp_component component
;
38 struct hlist_node node
;
41 extern enum cpuhp_state lttng_hp_prepare
;
42 extern enum cpuhp_state lttng_hp_online
;
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
);
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
);
59 extern enum cpuhp_state lttng_rb_hp_prepare
;
60 extern enum cpuhp_state lttng_rb_hp_online
;
64 #endif /* LTTNG_CPUHOTPLUG_H */