From 5f3e240321dd00b251f91a37c70fc551a140c87b Mon Sep 17 00:00:00 2001 From: changfengnan Date: Sat, 8 Oct 2022 20:05:18 +0800 Subject: ext4: split ext4_journal_start trace for debug we might want to know why jbd2 thread using high io for detail, split ext4_journal_start trace to ext4_journal_start_sb and ext4_journal_start_inode, show ino and handle type when possible. Signed-off-by: changfengnan Link: https://lore.kernel.org/r/20221008120518.74870-1-changfengnan@bytedance.com Signed-off-by: Theodore Ts'o --- include/trace/events/ext4.h | 57 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 11 deletions(-) (limited to 'include/trace/events/ext4.h') diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 229e8fae66a3..44dc438c9242 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h @@ -1744,18 +1744,19 @@ TRACE_EVENT(ext4_load_inode, (unsigned long) __entry->ino) ); -TRACE_EVENT(ext4_journal_start, +TRACE_EVENT(ext4_journal_start_sb, TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks, - int revoke_creds, unsigned long IP), + int revoke_creds, int type, unsigned long IP), - TP_ARGS(sb, blocks, rsv_blocks, revoke_creds, IP), + TP_ARGS(sb, blocks, rsv_blocks, revoke_creds, type, IP), TP_STRUCT__entry( - __field( dev_t, dev ) - __field(unsigned long, ip ) - __field( int, blocks ) - __field( int, rsv_blocks ) - __field( int, revoke_creds ) + __field( dev_t, dev ) + __field( unsigned long, ip ) + __field( int, blocks ) + __field( int, rsv_blocks ) + __field( int, revoke_creds ) + __field( int, type ) ), TP_fast_assign( @@ -1764,11 +1765,45 @@ TRACE_EVENT(ext4_journal_start, __entry->blocks = blocks; __entry->rsv_blocks = rsv_blocks; __entry->revoke_creds = revoke_creds; + __entry->type = type; + ), + + TP_printk("dev %d,%d blocks %d, rsv_blocks %d, revoke_creds %d," + " type %d, caller %pS", MAJOR(__entry->dev), + MINOR(__entry->dev), __entry->blocks, __entry->rsv_blocks, + __entry->revoke_creds, __entry->type, (void *)__entry->ip) +); + +TRACE_EVENT(ext4_journal_start_inode, + TP_PROTO(struct inode *inode, int blocks, int rsv_blocks, + int revoke_creds, int type, unsigned long IP), + + TP_ARGS(inode, blocks, rsv_blocks, revoke_creds, type, IP), + + TP_STRUCT__entry( + __field( unsigned long, ino ) + __field( dev_t, dev ) + __field( unsigned long, ip ) + __field( int, blocks ) + __field( int, rsv_blocks ) + __field( int, revoke_creds ) + __field( int, type ) + ), + + TP_fast_assign( + __entry->dev = inode->i_sb->s_dev; + __entry->ip = IP; + __entry->blocks = blocks; + __entry->rsv_blocks = rsv_blocks; + __entry->revoke_creds = revoke_creds; + __entry->type = type; + __entry->ino = inode->i_ino; ), - TP_printk("dev %d,%d blocks %d, rsv_blocks %d, revoke_creds %d, " - "caller %pS", MAJOR(__entry->dev), MINOR(__entry->dev), - __entry->blocks, __entry->rsv_blocks, __entry->revoke_creds, + TP_printk("dev %d,%d blocks %d, rsv_blocks %d, revoke_creds %d," + " type %d, ino %lu, caller %pS", MAJOR(__entry->dev), + MINOR(__entry->dev), __entry->blocks, __entry->rsv_blocks, + __entry->revoke_creds, __entry->type, __entry->ino, (void *)__entry->ip) ); -- cgit v1.2.3