ext4: Add new tracepoint for jbd2_cleanup_journal_tail
authorTheodore Ts'o <tytso@mit.edu>
Wed, 23 Dec 2009 12:45:44 +0000 (07:45 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 23 Dec 2009 12:45:44 +0000 (07:45 -0500)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/jbd2/checkpoint.c
include/trace/events/jbd2.h

index 886849370950f462627f0a9d2df692ec4d117d97..30beb11ef928f35c75d52e4d1f68857fe370172c 100644 (file)
@@ -507,6 +507,7 @@ int jbd2_cleanup_journal_tail(journal_t *journal)
        if (blocknr < journal->j_tail)
                freed = freed + journal->j_last - journal->j_first;
 
+       trace_jbd2_cleanup_journal_tail(journal, first_tid, blocknr, freed);
        jbd_debug(1,
                  "Cleaning journal tail from %d to %d (offset %lu), "
                  "freeing %lu\n",
index 96b370a050deb27ca6fe8393990e52734dbbff09..bf16545cc97756d263305f17712f522b979bbf32 100644 (file)
@@ -199,6 +199,34 @@ TRACE_EVENT(jbd2_checkpoint_stats,
                  __entry->forced_to_close, __entry->written, __entry->dropped)
 );
 
+TRACE_EVENT(jbd2_cleanup_journal_tail,
+
+       TP_PROTO(journal_t *journal, tid_t first_tid,
+                unsigned long block_nr, unsigned long freed),
+
+       TP_ARGS(journal, first_tid, block_nr, freed),
+
+       TP_STRUCT__entry(
+               __field(        dev_t,  dev                     )
+               __field(        tid_t,  tail_sequence           )
+               __field(        tid_t,  first_tid               )
+               __field(unsigned long,  block_nr                )
+               __field(unsigned long,  freed                   )
+       ),
+
+       TP_fast_assign(
+               __entry->dev            = journal->j_fs_dev->bd_dev;
+               __entry->tail_sequence  = journal->j_tail_sequence;
+               __entry->first_tid      = first_tid;
+               __entry->block_nr       = block_nr;
+               __entry->freed          = freed;
+       ),
+
+       TP_printk("dev %s from %u to %u offset %lu freed %lu",
+                 jbd2_dev_to_name(__entry->dev), __entry->tail_sequence,
+                 __entry->first_tid, __entry->block_nr, __entry->freed)
+);
+
 #endif /* _TRACE_JBD2_H */
 
 /* This part must be outside protection */