fix: kprobes: Use rethook for kretprobe if possible (v5.18)
[lttng-modules.git] / include / wrapper / kprobes.h
index b546d615dce45a56142fa71b502c1ecd5fb5e619..51d32b7cc225981efb0bde2785b953bf3bc26d8b 100644 (file)
@@ -29,4 +29,21 @@ struct kretprobe *lttng_get_kretprobe(struct kretprobe_instance *ri)
 
 #endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) */
 
+
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0))
+static inline
+unsigned long lttng_get_kretprobe_retaddr(struct kretprobe_instance *ri)
+{
+       return get_kretprobe_retaddr(ri);
+}
+
+#else
+
+static inline
+unsigned long lttng_get_kretprobe_retaddr(struct kretprobe_instance *ri)
+{
+       return (unsigned long) ri->ret_addr;
+}
+#endif
+
 #endif /* _LTTNG_WRAPPER_KPROBES_H */
This page took 0.023812 seconds and 4 git commands to generate.