X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=wrapper%2Fuprobes.h;h=5a678c5d8d0317cccd366e1abdc39b741d75546c;hb=5e22c27b94232371a9dd58abc868439a9e050fec;hp=6ea9df189878bd48603dd86c3ab7bfa53d99a00e;hpb=8134eb60252cc167be0306bfb3780c4507eb0d16;p=lttng-modules.git diff --git a/wrapper/uprobes.h b/wrapper/uprobes.h index 6ea9df18..5a678c5d 100644 --- a/wrapper/uprobes.h +++ b/wrapper/uprobes.h @@ -14,13 +14,13 @@ #ifndef _LTTNG_WRAPPER_UPROBES_H #define _LTTNG_WRAPPER_UPROBES_H -#include +#include -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) #include /* Use kallsym lookup for version before 3.9. */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) static inline int wrapper_uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc) @@ -52,6 +52,19 @@ int wrapper_uprobe_register(struct inode *inode, loff_t offset, struct uprobe_co } } +/* + * Canary function to check for 'uprobe_register()' at compile time. + * + * From 'include/linux/uprobes.h': + * + * extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); + */ +static inline +int __canary__uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc) +{ + return uprobe_register(inode, offset, uc); +} + static inline void wrapper_uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc) { @@ -66,6 +79,20 @@ void wrapper_uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe WARN_ON(1); } } + +/* + * Canary function to check for 'uprobe_unregister()' at compile time. + * + * From 'include/linux/uprobes.h': + * + * extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); + */ +static inline +void __canary__uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc) +{ + uprobe_unregister(inode, offset, uc); +} + #endif #else /* Version < 3.5, before uprobe was added. */