fix: kprobes: Remove kretprobe hash (v5.11)
[lttng-modules.git] / include / wrapper / kprobes.h
diff --git a/include/wrapper/kprobes.h b/include/wrapper/kprobes.h
new file mode 100644 (file)
index 0000000..4d6993e
--- /dev/null
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
+ *
+ * src/wrapper/kprobes.h
+ *
+ * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com>
+ */
+
+#ifndef _LTTNG_WRAPPER_KPROBES_H
+#define _LTTNG_WRAPPER_KPROBES_H
+
+#include <linux/kprobes.h>
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
+
+static inline
+struct kretprobe *lttng_get_kretprobe(struct kretprobe_instance *ri)
+{
+       return get_kretprobe(ri);
+}
+
+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) */
+
+static inline
+struct kretprobe *lttng_get_kretprobe(struct kretprobe_instance *ri)
+{
+       return ri->rp;
+}
+
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) */
+
+#endif /* _LTTNG_WRAPPER_KPROBES_H */
This page took 0.027146 seconds and 4 git commands to generate.