1 /* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
5 * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 #ifndef LTTNG_CPUHOTPLUG_H
9 #define LTTNG_CPUHOTPLUG_H
11 struct lttng_cpuhp_node
;
13 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0))
15 #include <linux/cpuhotplug.h>
17 enum lttng_cpuhp_component
{
18 LTTNG_RING_BUFFER_FRONTEND
,
19 LTTNG_RING_BUFFER_BACKEND
,
20 LTTNG_RING_BUFFER_ITER
,
21 LTTNG_CONTEXT_PERF_COUNTERS
,
24 struct lttng_cpuhp_node
{
25 enum lttng_cpuhp_component component
;
26 struct hlist_node node
;
29 extern enum cpuhp_state lttng_hp_prepare
;
30 extern enum cpuhp_state lttng_hp_online
;
32 int lttng_cpuhp_rb_backend_prepare(unsigned int cpu
,
33 struct lttng_cpuhp_node
*node
);
34 int lttng_cpuhp_rb_frontend_dead(unsigned int cpu
,
35 struct lttng_cpuhp_node
*node
);
36 int lttng_cpuhp_rb_frontend_online(unsigned int cpu
,
37 struct lttng_cpuhp_node
*node
);
38 int lttng_cpuhp_rb_frontend_offline(unsigned int cpu
,
39 struct lttng_cpuhp_node
*node
);
40 int lttng_cpuhp_rb_iter_online(unsigned int cpu
,
41 struct lttng_cpuhp_node
*node
);
43 /* Ring buffer is a separate library. */
44 void lttng_rb_set_hp_prepare(enum cpuhp_state val
);
45 void lttng_rb_set_hp_online(enum cpuhp_state val
);
47 extern enum cpuhp_state lttng_rb_hp_prepare
;
48 extern enum cpuhp_state lttng_rb_hp_online
;
52 #endif /* LTTNG_CPUHOTPLUG_H */