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 TRACE_EVENT(jbd2_start_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 TRACE_EVENT(jbd2_commit_locking
,
58 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
60 TP_ARGS(journal
, commit_transaction
),
64 __field( char, sync_commit
)
65 __field( int, transaction
)
69 __entry
->dev
= journal
->j_fs_dev
->bd_dev
;
70 __entry
->sync_commit
= commit_transaction
->t_synchronous_commit
;
71 __entry
->transaction
= commit_transaction
->t_tid
;
74 TP_printk("dev %s transaction %d sync %d",
75 jbd2_dev_to_name(__entry
->dev
), __entry
->transaction
,
79 TRACE_EVENT(jbd2_commit_flushing
,
81 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
83 TP_ARGS(journal
, commit_transaction
),
87 __field( char, sync_commit
)
88 __field( int, transaction
)
92 __entry
->dev
= journal
->j_fs_dev
->bd_dev
;
93 __entry
->sync_commit
= commit_transaction
->t_synchronous_commit
;
94 __entry
->transaction
= commit_transaction
->t_tid
;
97 TP_printk("dev %s transaction %d sync %d",
98 jbd2_dev_to_name(__entry
->dev
), __entry
->transaction
,
102 TRACE_EVENT(jbd2_commit_logging
,
104 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
106 TP_ARGS(journal
, commit_transaction
),
109 __field( dev_t
, dev
)
110 __field( char, sync_commit
)
111 __field( int, transaction
)
115 __entry
->dev
= journal
->j_fs_dev
->bd_dev
;
116 __entry
->sync_commit
= commit_transaction
->t_synchronous_commit
;
117 __entry
->transaction
= commit_transaction
->t_tid
;
120 TP_printk("dev %s transaction %d sync %d",
121 jbd2_dev_to_name(__entry
->dev
), __entry
->transaction
,
122 __entry
->sync_commit
)
125 TRACE_EVENT(jbd2_end_commit
,
126 TP_PROTO(journal_t
*journal
, transaction_t
*commit_transaction
),
128 TP_ARGS(journal
, commit_transaction
),
131 __field( dev_t
, dev
)
132 __field( char, sync_commit
)
133 __field( int, transaction
)
138 __entry
->dev
= journal
->j_fs_dev
->bd_dev
;
139 __entry
->sync_commit
= commit_transaction
->t_synchronous_commit
;
140 __entry
->transaction
= commit_transaction
->t_tid
;
141 __entry
->head
= journal
->j_tail_sequence
;
144 TP_printk("dev %s transaction %d sync %d head %d",
145 jbd2_dev_to_name(__entry
->dev
), __entry
->transaction
,
146 __entry
->sync_commit
, __entry
->head
)
149 TRACE_EVENT(jbd2_submit_inode_data
,
150 TP_PROTO(struct inode
*inode
),
155 __field( dev_t
, dev
)
156 __field( ino_t
, ino
)
160 __entry
->dev
= inode
->i_sb
->s_dev
;
161 __entry
->ino
= inode
->i_ino
;
164 TP_printk("dev %s ino %lu",
165 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
)
168 TRACE_EVENT(jbd2_run_stats
,
169 TP_PROTO(dev_t dev
, unsigned long tid
,
170 struct transaction_run_stats_s
*stats
),
172 TP_ARGS(dev
, tid
, stats
),
175 __field( dev_t
, dev
)
176 __field( unsigned long, tid
)
177 __field( unsigned long, wait
)
178 __field( unsigned long, running
)
179 __field( unsigned long, locked
)
180 __field( unsigned long, flushing
)
181 __field( unsigned long, logging
)
182 __field( __u32
, handle_count
)
183 __field( __u32
, blocks
)
184 __field( __u32
, blocks_logged
)
190 __entry
->wait
= stats
->rs_wait
;
191 __entry
->running
= stats
->rs_running
;
192 __entry
->locked
= stats
->rs_locked
;
193 __entry
->flushing
= stats
->rs_flushing
;
194 __entry
->logging
= stats
->rs_logging
;
195 __entry
->handle_count
= stats
->rs_handle_count
;
196 __entry
->blocks
= stats
->rs_blocks
;
197 __entry
->blocks_logged
= stats
->rs_blocks_logged
;
200 TP_printk("dev %s tid %lu wait %u running %u locked %u flushing %u "
201 "logging %u handle_count %u blocks %u blocks_logged %u",
202 jbd2_dev_to_name(__entry
->dev
), __entry
->tid
,
203 jiffies_to_msecs(__entry
->wait
),
204 jiffies_to_msecs(__entry
->running
),
205 jiffies_to_msecs(__entry
->locked
),
206 jiffies_to_msecs(__entry
->flushing
),
207 jiffies_to_msecs(__entry
->logging
),
208 __entry
->handle_count
, __entry
->blocks
,
209 __entry
->blocks_logged
)
212 TRACE_EVENT(jbd2_checkpoint_stats
,
213 TP_PROTO(dev_t dev
, unsigned long tid
,
214 struct transaction_chp_stats_s
*stats
),
216 TP_ARGS(dev
, tid
, stats
),
219 __field( dev_t
, dev
)
220 __field( unsigned long, tid
)
221 __field( unsigned long, chp_time
)
222 __field( __u32
, forced_to_close
)
223 __field( __u32
, written
)
224 __field( __u32
, dropped
)
230 __entry
->chp_time
= stats
->cs_chp_time
;
231 __entry
->forced_to_close
= stats
->cs_forced_to_close
;
232 __entry
->written
= stats
->cs_written
;
233 __entry
->dropped
= stats
->cs_dropped
;
236 TP_printk("dev %s tid %lu chp_time %u forced_to_close %u "
237 "written %u dropped %u",
238 jbd2_dev_to_name(__entry
->dev
), __entry
->tid
,
239 jiffies_to_msecs(__entry
->chp_time
),
240 __entry
->forced_to_close
, __entry
->written
, __entry
->dropped
)
243 #endif /* _TRACE_JBD2_H */
245 /* This part must be outside protection */
246 #include <trace/define_trace.h>