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

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Tue Mar 7 15:00:44 UTC 2017


----- 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

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com


More information about the lttng-dev mailing list