new file mode 100644
@@ -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 */
@@ -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>
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> --- backport/backport-include/linux/kcov.h | 16 ++++++++++++++++ backport/backport-include/linux/sched.h | 5 +++++ 2 files changed, 21 insertions(+) create mode 100644 backport/backport-include/linux/kcov.h