2 #define TRACE_SYSTEM jbd2
4 #if !defined(_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/jbd2.h>
8 #include <linux/tracepoint.h>
10 struct transaction_chp_stats_s
;
11 struct transaction_run_stats_s
;
13 TRACE_EVENT(jbd2_checkpoint
,
15 TP_PROTO(journal_t
*journal
, int result
),
17 TP_ARGS(journal
, result
),
21 __field( int, result
)
25 __entry
->dev
= journal
->j_fs_dev
->bd_dev
;
26 __entry
->result
= result
;
29 TP_printk("dev %s result %d",
30 jbd2_dev_to_name(__entry
->dev
), __entry
->result
)
33 DECLARE_EVENT_CLASS(jbd2_commit
,
35 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
37 TP_ARGS(journal
, commit_transaction
),
41 __field( char, sync_commit
)
42 __field( int, transaction
)
46 __entry
->dev
= journal
->j_fs_dev
->bd_dev
;
47 __entry
->sync_commit
= commit_transaction
->t_synchronous_commit
;
48 __entry
->transaction
= commit_transaction
->t_tid
;
51 TP_printk("dev %s transaction %d sync %d",
52 jbd2_dev_to_name(__entry
->dev
), __entry
->transaction
,
56 DEFINE_EVENT(jbd2_commit
, jbd2_start_commit
,
58 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
60 TP_ARGS(journal
, commit_transaction
)
63 DEFINE_EVENT(jbd2_commit
, jbd2_commit_locking
,
65 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
67 TP_ARGS(journal
, commit_transaction
)
70 DEFINE_EVENT(jbd2_commit
, jbd2_commit_flushing
,
72 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
74 TP_ARGS(journal
, commit_transaction
)
77 DEFINE_EVENT(jbd2_commit
, jbd2_commit_logging
,
79 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
81 TP_ARGS(journal
, commit_transaction
)
84 TRACE_EVENT(jbd2_end_commit
,
85 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
87 TP_ARGS(journal
, commit_transaction
),
91 __field( char, sync_commit
)
92 __field( int, transaction
)
97 __entry
->dev
= journal
->j_fs_dev
->bd_dev
;
98 __entry
->sync_commit
= commit_transaction
->t_synchronous_commit
;
99 __entry
->transaction
= commit_transaction
->t_tid
;
100 __entry
->head
= journal
->j_tail_sequence
;
103 TP_printk("dev %s transaction %d sync %d head %d",
104 jbd2_dev_to_name(__entry
->dev
), __entry
->transaction
,
105 __entry
->sync_commit
, __entry
->head
)
108 TRACE_EVENT(jbd2_submit_inode_data
,
109 TP_PROTO(struct inode
*inode
),
114 __field( dev_t
, dev
)
115 __field( ino_t
, ino
)
119 __entry
->dev
= inode
->i_sb
->s_dev
;
120 __entry
->ino
= inode
->i_ino
;
123 TP_printk("dev %s ino %lu",
124 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
)
127 TRACE_EVENT(jbd2_run_stats
,
128 TP_PROTO(dev_t dev
, unsigned long tid
,
129 struct transaction_run_stats_s
*stats
),
131 TP_ARGS(dev
, tid
, stats
),
134 __field( dev_t
, dev
)
135 __field( unsigned long, tid
)
136 __field( unsigned long, wait
)
137 __field( unsigned long, running
)
138 __field( unsigned long, locked
)
139 __field( unsigned long, flushing
)
140 __field( unsigned long, logging
)
141 __field( __u32
, handle_count
)
142 __field( __u32
, blocks
)
143 __field( __u32
, blocks_logged
)
149 __entry
->wait
= stats
->rs_wait
;
150 __entry
->running
= stats
->rs_running
;
151 __entry
->locked
= stats
->rs_locked
;
152 __entry
->flushing
= stats
->rs_flushing
;
153 __entry
->logging
= stats
->rs_logging
;
154 __entry
->handle_count
= stats
->rs_handle_count
;
155 __entry
->blocks
= stats
->rs_blocks
;
156 __entry
->blocks_logged
= stats
->rs_blocks_logged
;
159 TP_printk("dev %s tid %lu wait %u running %u locked %u flushing %u "
160 "logging %u handle_count %u blocks %u blocks_logged %u",
161 jbd2_dev_to_name(__entry
->dev
), __entry
->tid
,
162 jiffies_to_msecs(__entry
->wait
),
163 jiffies_to_msecs(__entry
->running
),
164 jiffies_to_msecs(__entry
->locked
),
165 jiffies_to_msecs(__entry
->flushing
),
166 jiffies_to_msecs(__entry
->logging
),
167 __entry
->handle_count
, __entry
->blocks
,
168 __entry
->blocks_logged
)
171 TRACE_EVENT(jbd2_checkpoint_stats
,
172 TP_PROTO(dev_t dev
, unsigned long tid
,
173 struct transaction_chp_stats_s
*stats
),
175 TP_ARGS(dev
, tid
, stats
),
178 __field( dev_t
, dev
)
179 __field( unsigned long, tid
)
180 __field( unsigned long, chp_time
)
181 __field( __u32
, forced_to_close
)
182 __field( __u32
, written
)
183 __field( __u32
, dropped
)
189 __entry
->chp_time
= stats
->cs_chp_time
;
190 __entry
->forced_to_close
= stats
->cs_forced_to_close
;
191 __entry
->written
= stats
->cs_written
;
192 __entry
->dropped
= stats
->cs_dropped
;
195 TP_printk("dev %s tid %lu chp_time %u forced_to_close %u "
196 "written %u dropped %u",
197 jbd2_dev_to_name(__entry
->dev
), __entry
->tid
,
198 jiffies_to_msecs(__entry
->chp_time
),
199 __entry
->forced_to_close
, __entry
->written
, __entry
->dropped
)
202 #endif /* _TRACE_JBD2_H */
204 /* This part must be outside protection */
205 #include <trace/define_trace.h>