X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Fwrapper%2Fkprobes.h;h=51d32b7cc225981efb0bde2785b953bf3bc26d8b;hb=3c46ddc134621dba65030263aa321dd6bdae3ba3;hp=4d6993e26d7dab40c77675ef8c09e5d96ca36a68;hpb=087269072e2d96540d137789a6c91687edeb33bd;p=lttng-modules.git diff --git a/include/wrapper/kprobes.h b/include/wrapper/kprobes.h index 4d6993e2..51d32b7c 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,23 @@ 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)) +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 */