aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2021-10-04 23:24:49 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2021-10-18 23:01:19 +0200
commitea662d4c35174da63947df7409c8fd9ae0df0710 (patch)
treedd9e65b676cb6c6ba07b35d1211a7362593265ab
parenta3e1fb0e9520298d58d07e2beab2cf93e9a0d922 (diff)
downloadbackports-ea662d4c35174da63947df7409c8fd9ae0df0710.tar.gz
headers: Add linux/kcov.h
This adds empty implementation for kcov_remote_start_common() and kcov_remote_stop() on older kernel versions. kcov will probably not work properly when used with backports and older kernel versions. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--backport/backport-include/linux/kcov.h16
-rw-r--r--backport/backport-include/linux/sched.h5
2 files changed, 21 insertions, 0 deletions
diff --git a/backport/backport-include/linux/kcov.h b/backport/backport-include/linux/kcov.h
new file mode 100644
index 00000000..92095e63
--- /dev/null
+++ b/backport/backport-include/linux/kcov.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __BACKPORTS_LINUX_KCOV_H
+#define __BACKPORTS_LINUX_KCOV_H
+#include <linux/version.h>
+#if LINUX_VERSION_IS_GEQ(4,6,0)
+#include_next <linux/kcov.h>
+#endif
+
+#if LINUX_VERSION_IS_LESS(5,5,0)
+#define kcov_remote_stop LINUX_BACKPORT(kcov_remote_stop)
+static inline void kcov_remote_stop(void) {}
+#define kcov_remote_start_common LINUX_BACKPORT(kcov_remote_start_common)
+static inline void kcov_remote_start_common(u64 id) {}
+#endif
+
+#endif /* __BACKPORTS_LINUX_KCOV_H */
diff --git a/backport/backport-include/linux/sched.h b/backport/backport-include/linux/sched.h
index 36263857..6a5cf8db 100644
--- a/backport/backport-include/linux/sched.h
+++ b/backport/backport-include/linux/sched.h
@@ -4,6 +4,11 @@
#include_next <linux/sched.h>
#include <linux/version.h>
+/* kcov was added in 4.6 and is included since then */
+#if LINUX_VERSION_IS_LESS(4,6,0)
+#include <linux/kcov.h>
+#endif
+
#if LINUX_VERSION_IS_LESS(5,9,0)
#if LINUX_VERSION_IS_GEQ(4,11,0)
#include <uapi/linux/sched/types.h>