Fix Linux 3.8 ext4 probe support
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 13 Mar 2013 18:56:49 +0000 (14:56 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 13 Mar 2013 18:56:49 +0000 (14:56 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/ext4.h
probes/lttng-probe-ext4.c

index 4bc428543a8a36e25327b69f1020cb0f84d4ee47..72d605421753921f9823a7249c4aea55cd5ea0ed 100644 (file)
@@ -1850,6 +1850,54 @@ DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter,
        TP_ARGS(inode, lblk, len, flags)
 )
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+
+DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
+       TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int ret),
+
+       TP_ARGS(inode, map, ret),
+
+       TP_STRUCT__entry(
+               __field(        dev_t,          dev             )
+               __field(        ino_t,          ino             )
+               __field(        ext4_fsblk_t,   pblk            )
+               __field(        ext4_lblk_t,    lblk            )
+               __field(        unsigned int,   len             )
+               __field(        unsigned int,   flags           )
+               __field(        int,            ret             )
+       ),
+
+       TP_fast_assign(
+               tp_assign(dev, inode->i_sb->s_dev)
+               tp_assign(ino, inode->i_ino)
+               tp_assign(pblk, map->m_pblk)
+               tp_assign(lblk, map->m_lblk)
+               tp_assign(len, map->m_len)
+               tp_assign(flags, map->m_flags)
+               tp_assign(ret, ret)
+       ),
+
+       TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u flags %x ret %d",
+                 MAJOR(__entry->dev), MINOR(__entry->dev),
+                 (unsigned long) __entry->ino,
+                 __entry->lblk, __entry->pblk,
+                 __entry->len, __entry->flags, __entry->ret)
+)
+
+DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit,
+       TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int ret),
+
+       TP_ARGS(inode, map, ret)
+)
+
+DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit,
+       TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int ret),
+
+       TP_ARGS(inode, map, ret)
+)
+
+#else  /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */
+
 DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
        TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
                 ext4_fsblk_t pblk, unsigned int len, int ret),
@@ -1895,6 +1943,8 @@ DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit,
        TP_ARGS(inode, lblk, pblk, len, ret)
 )
 
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */
+
 TRACE_EVENT(ext4_ext_load_extent,
        TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk),
 
@@ -2015,11 +2065,19 @@ DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
 #endif
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+
 TRACE_EVENT(ext4_ext_handle_uninitialized_extents,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+       TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int flags,
+                unsigned int allocated, ext4_fsblk_t newblock),
+
+       TP_ARGS(inode, map, flags, allocated, newblock),
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */
        TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
                 unsigned int allocated, ext4_fsblk_t newblock),
 
        TP_ARGS(inode, map, allocated, newblock),
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */
 
        TP_STRUCT__entry(
                __field(        dev_t,          dev             )
@@ -2035,7 +2093,11 @@ TRACE_EVENT(ext4_ext_handle_uninitialized_extents,
        TP_fast_assign(
                tp_assign(dev, inode->i_sb->s_dev)
                tp_assign(ino, inode->i_ino)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+               tp_assign(flags, flags)
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */
                tp_assign(flags, map->m_flags)
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */
                tp_assign(lblk, map->m_lblk)
                tp_assign(pblk, map->m_pblk)
                tp_assign(len, map->m_len)
index 19c9b681d5ac4638631afd95e4b7ca6318f8f346..176186e3516a7c4b55ef3da11636db309bed0a9e 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/fs.h>
 #include <../fs/ext4/ext4.h>
 #include <../fs/ext4/mballoc.h>
+#include <../fs/ext4/ext4_extents.h>
 #include <linux/dcache.h>
 
 /*
This page took 0.028383 seconds and 4 git commands to generate.