From: Mathieu Desnoyers Date: Tue, 15 Apr 2014 15:20:44 +0000 (-0400) Subject: Fix: ext4 update instrumentation to 3.15 kernel X-Git-Tag: v2.5.0-rc1~12 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=11af8f5535c9b734b14e4477d49ad51034fa0fd2;p=lttng-modules.git Fix: ext4 update instrumentation to 3.15 kernel Signed-off-by: Mathieu Desnoyers --- diff --git a/instrumentation/events/lttng-module/ext4.h b/instrumentation/events/lttng-module/ext4.h index d7429040..322c3405 100644 --- a/instrumentation/events/lttng-module/ext4.h +++ b/instrumentation/events/lttng-module/ext4.h @@ -1698,7 +1698,38 @@ TRACE_EVENT(ext4_direct_IO_exit, __entry->rw, __entry->ret) ) -TRACE_EVENT(ext4_fallocate_enter, +TRACE_EVENT(ext4_fallocate_exit, + TP_PROTO(struct inode *inode, loff_t offset, + unsigned int max_blocks, int ret), + + TP_ARGS(inode, offset, max_blocks, ret), + + TP_STRUCT__entry( + __field( dev_t, dev ) + __field( ino_t, ino ) + __field( loff_t, pos ) + __field( unsigned int, blocks ) + __field( int, ret ) + ), + + TP_fast_assign( + tp_assign(dev, inode->i_sb->s_dev) + tp_assign(ino, inode->i_ino) + tp_assign(pos, offset) + tp_assign(blocks, max_blocks) + tp_assign(ret, ret) + ), + + TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d", + MAJOR(__entry->dev), MINOR(__entry->dev), + (unsigned long) __entry->ino, + __entry->pos, __entry->blocks, + __entry->ret) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) + +DECLARE_EVENT_CLASS(ext4__fallocate_mode, TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), TP_ARGS(inode, offset, len, mode), @@ -1706,52 +1737,74 @@ TRACE_EVENT(ext4_fallocate_enter, TP_STRUCT__entry( __field( dev_t, dev ) __field( ino_t, ino ) - __field( loff_t, pos ) - __field( loff_t, len ) + __field( loff_t, offset ) + __field( loff_t, len ) __field( int, mode ) ), TP_fast_assign( tp_assign(dev, inode->i_sb->s_dev) tp_assign(ino, inode->i_ino) - tp_assign(pos, offset) + tp_assign(offset, offset) tp_assign(len, len) tp_assign(mode, mode) ), - TP_printk("dev %d,%d ino %lu pos %lld len %lld mode %d", + TP_printk("dev %d,%d ino %lu offset %lld len %lld mode %s", MAJOR(__entry->dev), MINOR(__entry->dev), - (unsigned long) __entry->ino, __entry->pos, - __entry->len, __entry->mode) + (unsigned long) __entry->ino, + __entry->offset, __entry->len, + show_falloc_mode(__entry->mode)) ) -TRACE_EVENT(ext4_fallocate_exit, - TP_PROTO(struct inode *inode, loff_t offset, - unsigned int max_blocks, int ret), +DEFINE_EVENT(ext4__fallocate_mode, ext4_fallocate_enter, - TP_ARGS(inode, offset, max_blocks, ret), + TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), + + TP_ARGS(inode, offset, len, mode) +) + +DEFINE_EVENT(ext4__fallocate_mode, ext4_punch_hole, + + TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), + + TP_ARGS(inode, offset, len, mode) +) + +DEFINE_EVENT(ext4__fallocate_mode, ext4_zero_range, + + TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), + + TP_ARGS(inode, offset, len, mode) +) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ + +TRACE_EVENT(ext4_fallocate_enter, + TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), + + TP_ARGS(inode, offset, len, mode), TP_STRUCT__entry( __field( dev_t, dev ) __field( ino_t, ino ) __field( loff_t, pos ) - __field( unsigned int, blocks ) - __field( int, ret ) + __field( loff_t, len ) + __field( int, mode ) ), TP_fast_assign( tp_assign(dev, inode->i_sb->s_dev) tp_assign(ino, inode->i_ino) tp_assign(pos, offset) - tp_assign(blocks, max_blocks) - tp_assign(ret, ret) + tp_assign(len, len) + tp_assign(mode, mode) ), - TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d", + TP_printk("dev %d,%d ino %lu pos %lld len %lld mode %d", MAJOR(__entry->dev), MINOR(__entry->dev), - (unsigned long) __entry->ino, - __entry->pos, __entry->blocks, - __entry->ret) + (unsigned long) __entry->ino, __entry->pos, + __entry->len, __entry->mode) ) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) @@ -1781,7 +1834,9 @@ TRACE_EVENT(ext4_punch_hole, __entry->offset, __entry->len) ) -#endif +#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ TRACE_EVENT(ext4_unlink_enter, TP_PROTO(struct inode *parent, struct dentry *dentry),