Fix: update writeback instrumentation for kernel 4.14
[lttng-modules.git] / lttng-cpuhotplug.h
CommitLineData
1e367326
MD
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
1e367326
MD
24struct lttng_cpuhp_node;
25
26#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
da3b99a6
MD
27
28#include <linux/cpuhotplug.h>
29
1e367326
MD
30enum lttng_cpuhp_component {
31 LTTNG_RING_BUFFER_FRONTEND,
32 LTTNG_RING_BUFFER_BACKEND,
33 LTTNG_RING_BUFFER_ITER,
34 LTTNG_CONTEXT_PERF_COUNTERS,
35};
36
37struct lttng_cpuhp_node {
38 enum lttng_cpuhp_component component;
39 struct hlist_node node;
40};
41
42extern enum cpuhp_state lttng_hp_prepare;
43extern enum cpuhp_state lttng_hp_online;
44
45int lttng_cpuhp_rb_backend_prepare(unsigned int cpu,
46 struct lttng_cpuhp_node *node);
47int lttng_cpuhp_rb_frontend_dead(unsigned int cpu,
48 struct lttng_cpuhp_node *node);
49int lttng_cpuhp_rb_frontend_online(unsigned int cpu,
50 struct lttng_cpuhp_node *node);
51int lttng_cpuhp_rb_frontend_offline(unsigned int cpu,
52 struct lttng_cpuhp_node *node);
53int lttng_cpuhp_rb_iter_online(unsigned int cpu,
54 struct lttng_cpuhp_node *node);
55
56/* Ring buffer is a separate library. */
57void lttng_rb_set_hp_prepare(enum cpuhp_state val);
58void lttng_rb_set_hp_online(enum cpuhp_state val);
59
60extern enum cpuhp_state lttng_rb_hp_prepare;
61extern enum cpuhp_state lttng_rb_hp_online;
62
63#endif
64
65#endif /* LTTNG_CPUHOTPLUG_H */
This page took 0.025968 seconds and 4 git commands to generate.