1 /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
3 * src/wrapper/kprobes.h
5 * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
8 #ifndef _LTTNG_WRAPPER_SCHED_H
9 #define _LTTNG_WRAPPER_SCHED_H
11 #include <linux/sched.h>
12 #include <lttng-kernel-version.h>
14 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,14,0) || \
15 LTTNG_RHEL_KERNEL_RANGE(4,18,0,372,0,0, 4,19,0,0,0,0))
17 #define lttng_get_task_state(task) READ_ONCE((task)->__state)
18 #define lttng_task_is_running(task) task_is_running(task)
20 #else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,14,0) */
22 #define lttng_get_task_state(task) ((task)->state)
23 #define lttng_task_is_running(task) (lttng_get_task_state(task) == TASK_RUNNING)
25 #endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,14,0) */
27 #endif /* _LTTNG_WRAPPER_SCHED_H */
This page took 0.033786 seconds and 4 git commands to generate.