X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=include%2Fwrapper%2Fkprobes.h;fp=include%2Fwrapper%2Fkprobes.h;h=4d6993e26d7dab40c77675ef8c09e5d96ca36a68;hb=087269072e2d96540d137789a6c91687edeb33bd;hp=0000000000000000000000000000000000000000;hpb=0aebcd682f2b7dc028e635297c504b39439551da;p=lttng-modules.git diff --git a/include/wrapper/kprobes.h b/include/wrapper/kprobes.h new file mode 100644 index 00000000..4d6993e2 --- /dev/null +++ b/include/wrapper/kprobes.h @@ -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 + */ + +#ifndef _LTTNG_WRAPPER_KPROBES_H +#define _LTTNG_WRAPPER_KPROBES_H + +#include +#include + +#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 */