| 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 | struct lttng_cpuhp_node; |
| 25 | |
| 26 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) |
| 27 | |
| 28 | #include <linux/cpuhotplug.h> |
| 29 | |
| 30 | enum 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 | |
| 37 | struct lttng_cpuhp_node { |
| 38 | enum lttng_cpuhp_component component; |
| 39 | struct hlist_node node; |
| 40 | }; |
| 41 | |
| 42 | extern enum cpuhp_state lttng_hp_prepare; |
| 43 | extern enum cpuhp_state lttng_hp_online; |
| 44 | |
| 45 | int lttng_cpuhp_rb_backend_prepare(unsigned int cpu, |
| 46 | struct lttng_cpuhp_node *node); |
| 47 | int lttng_cpuhp_rb_frontend_dead(unsigned int cpu, |
| 48 | struct lttng_cpuhp_node *node); |
| 49 | int lttng_cpuhp_rb_frontend_online(unsigned int cpu, |
| 50 | struct lttng_cpuhp_node *node); |
| 51 | int lttng_cpuhp_rb_frontend_offline(unsigned int cpu, |
| 52 | struct lttng_cpuhp_node *node); |
| 53 | int lttng_cpuhp_rb_iter_online(unsigned int cpu, |
| 54 | struct lttng_cpuhp_node *node); |
| 55 | |
| 56 | /* Ring buffer is a separate library. */ |
| 57 | void lttng_rb_set_hp_prepare(enum cpuhp_state val); |
| 58 | void lttng_rb_set_hp_online(enum cpuhp_state val); |
| 59 | |
| 60 | extern enum cpuhp_state lttng_rb_hp_prepare; |
| 61 | extern enum cpuhp_state lttng_rb_hp_online; |
| 62 | |
| 63 | #endif |
| 64 | |
| 65 | #endif /* LTTNG_CPUHOTPLUG_H */ |