[PATCH 06/47] headers: Add linux/kcov.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

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>
-- 
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux