#include <linux/jbd2.h>
#include <linux/tracepoint.h>
+#include <linux/version.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
#ifndef _TRACE_JBD2_DEF
#define _TRACE_JBD2_DEF
struct transaction_chp_stats_s;
struct transaction_run_stats_s;
#endif
+#endif
TRACE_EVENT(jbd2_checkpoint,
TP_ARGS(journal, commit_transaction)
)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+DEFINE_EVENT(jbd2_commit, jbd2_drop_transaction,
+
+ TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
+
+ TP_ARGS(journal, commit_transaction)
+)
+#endif
+
TRACE_EVENT(jbd2_end_commit,
TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
(unsigned long) __entry->ino)
)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
TRACE_EVENT(jbd2_run_stats,
TP_PROTO(dev_t dev, unsigned long tid,
struct transaction_run_stats_s *stats),
jiffies_to_msecs(__entry->chp_time),
__entry->forced_to_close, __entry->written, __entry->dropped)
)
+#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+TRACE_EVENT(jbd2_update_log_tail,
+#else
TRACE_EVENT(jbd2_cleanup_journal_tail,
+#endif
TP_PROTO(journal_t *journal, tid_t first_tid,
unsigned long block_nr, unsigned long freed),
__entry->tail_sequence, __entry->first_tid,
__entry->block_nr, __entry->freed)
)
+#endif
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+TRACE_EVENT(jbd2_write_superblock,
+
+ TP_PROTO(journal_t *journal, int write_op),
+
+ TP_ARGS(journal, write_op),
+
+ TP_STRUCT__entry(
+ __field( dev_t, dev )
+ __field( int, write_op )
+ ),
+
+ TP_fast_assign(
+ tp_assign(dev, journal->j_fs_dev->bd_dev)
+ tp_assign(write_op, write_op)
+ ),
+
+ TP_printk("dev %d,%d write_op %x", MAJOR(__entry->dev),
+ MINOR(__entry->dev), __entry->write_op)
+)
+#endif
#endif /* _TRACE_JBD2_H */