diff options
author | Ritesh Harjani <riteshh@linux.ibm.com> | 2022-03-12 08:39:52 +0300 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2022-03-16 00:45:36 +0300 |
commit | 1d2e2440c5191da82b1191298909283a58f0ece8 (patch) | |
tree | 9381a7a3456b9d2b32c2eec107156f9983004ef7 /include | |
parent | 08f4c42abad1b93914a93f9042e2443593bd3137 (diff) | |
download | linux-1d2e2440c5191da82b1191298909283a58f0ece8.tar.xz |
ext4: add transaction tid info in fc_track events
This patch adds the transaction & inode tid info in trace events for
callers of ext4_fc_track_template(). This is helpful in debugging race
conditions where an inode could belong to two different transaction tids.
It also fixes the checkpatch warnings which says use tabs instead of
spaces.
Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
Link: https://lore.kernel.org/r/c203c09dc11bb372803c430f621f25a4b8c2c8b4.1647057583.git.riteshh@linux.ibm.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include')
-rw-r--r-- | include/trace/events/ext4.h | 113 |
1 files changed, 68 insertions, 45 deletions
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 20654aaf9495..6bd90df07b5c 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h @@ -2782,32 +2782,41 @@ TRACE_EVENT(ext4_fc_stats, DECLARE_EVENT_CLASS(ext4_fc_track_dentry, - TP_PROTO(struct inode *inode, struct dentry *dentry, int ret), + TP_PROTO(handle_t *handle, struct inode *inode, + struct dentry *dentry, int ret), - TP_ARGS(inode, dentry, ret), + TP_ARGS(handle, inode, dentry, ret), TP_STRUCT__entry( __field(dev_t, dev) + __field(tid_t, t_tid) __field(ino_t, i_ino) + __field(tid_t, i_sync_tid) __field(int, error) ), TP_fast_assign( + struct ext4_inode_info *ei = EXT4_I(inode); + __entry->dev = inode->i_sb->s_dev; + __entry->t_tid = handle->h_transaction->t_tid; __entry->i_ino = inode->i_ino; + __entry->i_sync_tid = ei->i_sync_tid; __entry->error = ret; ), - TP_printk("dev %d,%d, ino %lu, error %d", + TP_printk("dev %d,%d, t_tid %u, ino %lu, i_sync_tid %u, error %d", MAJOR(__entry->dev), MINOR(__entry->dev), - __entry->i_ino, __entry->error + __entry->t_tid, __entry->i_ino, __entry->i_sync_tid, + __entry->error ) ); #define DEFINE_EVENT_CLASS_DENTRY(__type) \ DEFINE_EVENT(ext4_fc_track_dentry, ext4_fc_track_##__type, \ - TP_PROTO(struct inode *inode, struct dentry *dentry, int ret), \ - TP_ARGS(inode, dentry, ret) \ + TP_PROTO(handle_t *handle, struct inode *inode, \ + struct dentry *dentry, int ret), \ + TP_ARGS(handle, inode, dentry, ret) \ ) DEFINE_EVENT_CLASS_DENTRY(create); @@ -2815,52 +2824,66 @@ DEFINE_EVENT_CLASS_DENTRY(link); DEFINE_EVENT_CLASS_DENTRY(unlink); TRACE_EVENT(ext4_fc_track_inode, - TP_PROTO(struct inode *inode, int ret), + TP_PROTO(handle_t *handle, struct inode *inode, int ret), - TP_ARGS(inode, ret), + TP_ARGS(handle, inode, ret), - TP_STRUCT__entry( - __field(dev_t, dev) - __field(int, ino) - __field(int, error) - ), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(tid_t, t_tid) + __field(ino_t, i_ino) + __field(tid_t, i_sync_tid) + __field(int, error) + ), - TP_fast_assign( - __entry->dev = inode->i_sb->s_dev; - __entry->ino = inode->i_ino; - __entry->error = ret; - ), + TP_fast_assign( + struct ext4_inode_info *ei = EXT4_I(inode); - TP_printk("dev %d:%d, inode %d, error %d", - MAJOR(__entry->dev), MINOR(__entry->dev), - __entry->ino, __entry->error) + __entry->dev = inode->i_sb->s_dev; + __entry->t_tid = handle->h_transaction->t_tid; + __entry->i_ino = inode->i_ino; + __entry->i_sync_tid = ei->i_sync_tid; + __entry->error = ret; + ), + + TP_printk("dev %d:%d, t_tid %u, inode %lu, i_sync_tid %u, error %d", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->t_tid, __entry->i_ino, __entry->i_sync_tid, + __entry->error) ); TRACE_EVENT(ext4_fc_track_range, - TP_PROTO(struct inode *inode, long start, long end, int ret), - - TP_ARGS(inode, start, end, ret), - - TP_STRUCT__entry( - __field(dev_t, dev) - __field(int, ino) - __field(long, start) - __field(long, end) - __field(int, error) - ), - - TP_fast_assign( - __entry->dev = inode->i_sb->s_dev; - __entry->ino = inode->i_ino; - __entry->start = start; - __entry->end = end; - __entry->error = ret; - ), - - TP_printk("dev %d:%d, inode %d, error %d, start %ld, end %ld", - MAJOR(__entry->dev), MINOR(__entry->dev), - __entry->ino, __entry->error, __entry->start, - __entry->end) + TP_PROTO(handle_t *handle, struct inode *inode, + long start, long end, int ret), + + TP_ARGS(handle, inode, start, end, ret), + + TP_STRUCT__entry( + __field(dev_t, dev) + __field(tid_t, t_tid) + __field(ino_t, i_ino) + __field(tid_t, i_sync_tid) + __field(long, start) + __field(long, end) + __field(int, error) + ), + + TP_fast_assign( + struct ext4_inode_info *ei = EXT4_I(inode); + + __entry->dev = inode->i_sb->s_dev; + __entry->t_tid = handle->h_transaction->t_tid; + __entry->i_ino = inode->i_ino; + __entry->i_sync_tid = ei->i_sync_tid; + __entry->start = start; + __entry->end = end; + __entry->error = ret; + ), + + TP_printk("dev %d:%d, t_tid %u, inode %lu, i_sync_tid %u, error %d, start %ld, end %ld", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->t_tid, __entry->i_ino, __entry->i_sync_tid, + __entry->error, __entry->start, __entry->end) ); TRACE_EVENT(ext4_fc_cleanup, |