ext4: add tracepoint for ext4_journal_start
authorTheodore Ts'o <tytso@mit.edu>
Mon, 11 Jul 2011 02:37:50 +0000 (22:37 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 11 Jul 2011 02:37:50 +0000 (22:37 -0400)
This will help debug who is responsible for starting a jbd2 transaction.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/super.c
include/trace/events/ext4.h

index 9ea71aa..7910e61 100644 (file)
@@ -269,6 +269,7 @@ handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks)
        journal_t *journal;
        handle_t  *handle;
 
+       trace_ext4_journal_start(sb, nblocks, _RET_IP_);
        if (sb->s_flags & MS_RDONLY)
                return ERR_PTR(-EROFS);
 
index 5ce2b2f..6f27a59 100644 (file)
@@ -1520,6 +1520,28 @@ TRACE_EVENT(ext4_load_inode,
                  (unsigned long) __entry->ino)
 );
 
+TRACE_EVENT(ext4_journal_start,
+       TP_PROTO(struct super_block *sb, int nblocks, unsigned long IP),
+
+       TP_ARGS(sb, nblocks, IP),
+
+       TP_STRUCT__entry(
+               __field(        dev_t,  dev                     )
+               __field(          int,  nblocks                 )
+               __field(unsigned long,  ip                      )
+       ),
+
+       TP_fast_assign(
+               __entry->dev     = sb->s_dev;
+               __entry->nblocks = nblocks;
+               __entry->ip      = IP;
+       ),
+
+       TP_printk("dev %d,%d nblocks %d caller %pF",
+                 MAJOR(__entry->dev), MINOR(__entry->dev),
+                 __entry->nblocks, (void *)__entry->ip)
+);
+
 #endif /* _TRACE_EXT4_H */
 
 /* This part must be outside protection */