diff mbox

[lttng-modules] Fix: update btrfs instrumentation for kernel 4.11

Message ID 1488898408-27166-1-git-send-email-francis.deslauriers@efficios.com
State Superseded, archived
Headers show

Commit Message

Francis Deslauriers March 7, 2017, 2:53 p.m. UTC
Signed-off-by: Francis Deslauriers <francis.deslauriers at efficios.com>
---
 instrumentation/events/lttng-module/btrfs.h | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Mathieu Desnoyers March 7, 2017, 3 p.m. UTC | #1
----- On Mar 7, 2017, at 9:53 AM, Francis Deslauriers francis.deslauriers at efficios.com wrote:

> Signed-off-by: Francis Deslauriers <francis.deslauriers at efficios.com>
> ---
> instrumentation/events/lttng-module/btrfs.h | 9 +++++++++
> 1 file changed, 9 insertions(+)
> 
> diff --git a/instrumentation/events/lttng-module/btrfs.h
> b/instrumentation/events/lttng-module/btrfs.h
> index cc7ba50..2955e28 100644
> --- a/instrumentation/events/lttng-module/btrfs.h
> +++ b/instrumentation/events/lttng-module/btrfs.h
> @@ -87,9 +87,18 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode,
> btrfs_inode_evict,
> 
> LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
> 
> +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
> +
> +	TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode,
> +		struct extent_map *map),
> +
> +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
> +
> 	TP_PROTO(struct btrfs_root *root, struct inode *inode,
> 		struct extent_map *map),
> 
> +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
> +

Please try to keep the #ifdeffery around the entire LTTNG_TRACEPOINT_EVENT,
even if it means we copy-paste a bit of code. It becomes easier to
maintain in the long run than having spaghetti-like ifdefs within the
macros.

Thanks,

Mathieu

> 	TP_ARGS(root, inode, map),
> 
> 	TP_FIELDS(
> --
> 2.7.4
diff mbox

Patch

diff --git a/instrumentation/events/lttng-module/btrfs.h b/instrumentation/events/lttng-module/btrfs.h
index cc7ba50..2955e28 100644
--- a/instrumentation/events/lttng-module/btrfs.h
+++ b/instrumentation/events/lttng-module/btrfs.h
@@ -87,9 +87,18 @@  LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict,
 
 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
+
+	TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode,
+		struct extent_map *map),
+
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
+
 	TP_PROTO(struct btrfs_root *root, struct inode *inode,
 		struct extent_map *map),
 
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
+
 	TP_ARGS(root, inode, map),
 
 	TP_FIELDS(