X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Fwrapper%2Fkprobes.h;h=d906bcba7dc3ff0427f966f44699d2000e4b7128;hb=refs%2Fheads%2Fmaster;hp=4d6993e26d7dab40c77675ef8c09e5d96ca36a68;hpb=087269072e2d96540d137789a6c91687edeb33bd;p=lttng-modules.git diff --git a/include/wrapper/kprobes.h b/include/wrapper/kprobes.h index 4d6993e2..d906bcba 100644 --- a/include/wrapper/kprobes.h +++ b/include/wrapper/kprobes.h @@ -9,9 +9,9 @@ #define _LTTNG_WRAPPER_KPROBES_H #include -#include +#include -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) static inline struct kretprobe *lttng_get_kretprobe(struct kretprobe_instance *ri) @@ -19,7 +19,7 @@ struct kretprobe *lttng_get_kretprobe(struct kretprobe_instance *ri) return get_kretprobe(ri); } -#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) */ +#else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) */ static inline struct kretprobe *lttng_get_kretprobe(struct kretprobe_instance *ri) @@ -27,6 +27,24 @@ struct kretprobe *lttng_get_kretprobe(struct kretprobe_instance *ri) return ri->rp; } -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) */ +#endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) */ + + +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) || \ + LTTNG_RHEL_KERNEL_RANGE(5,14,0,163,0,0, 5,15,0,0,0,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 */