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),
20 __field( int, dev_major )
21 __field( int, dev_minor )
22 __field( int, result )
26 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev);
27 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
28 __entry->result = result;
31 TP_printk("dev %d,%d result %d",
32 __entry->dev_major, __entry->dev_minor, __entry->result)
35 DECLARE_EVENT_CLASS(jbd2_commit,
37 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
39 TP_ARGS(journal, commit_transaction),
42 __field( int, dev_major )
43 __field( int, dev_minor )
44 __field( char, sync_commit )
45 __field( int, transaction )
49 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev);
50 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
51 __entry->sync_commit = commit_transaction->t_synchronous_commit;
52 __entry->transaction = commit_transaction->t_tid;
55 TP_printk("dev %d,%d transaction %d sync %d",
56 __entry->dev_major, __entry->dev_minor,
57 __entry->transaction, __entry->sync_commit)
60 DEFINE_EVENT(jbd2_commit, jbd2_start_commit,
62 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
64 TP_ARGS(journal, commit_transaction)
67 DEFINE_EVENT(jbd2_commit, jbd2_commit_locking,
69 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
71 TP_ARGS(journal, commit_transaction)
74 DEFINE_EVENT(jbd2_commit, jbd2_commit_flushing,
76 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
78 TP_ARGS(journal, commit_transaction)
81 DEFINE_EVENT(jbd2_commit, jbd2_commit_logging,
83 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
85 TP_ARGS(journal, commit_transaction)
88 TRACE_EVENT(jbd2_end_commit,
89 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
91 TP_ARGS(journal, commit_transaction),
94 __field( int, dev_major )
95 __field( int, dev_minor )
96 __field( char, sync_commit )
97 __field( int, transaction )
102 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev);
103 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
104 __entry->sync_commit = commit_transaction->t_synchronous_commit;
105 __entry->transaction = commit_transaction->t_tid;
106 __entry->head = journal->j_tail_sequence;
109 TP_printk("dev %d,%d transaction %d sync %d head %d",
110 __entry->dev_major, __entry->dev_minor,
111 __entry->transaction, __entry->sync_commit, __entry->head)
114 TRACE_EVENT(jbd2_submit_inode_data,
115 TP_PROTO(struct inode *inode),
120 __field( int, dev_major )
121 __field( int, dev_minor )
122 __field( ino_t, ino )
126 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
127 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
128 __entry->ino = inode->i_ino;
131 TP_printk("dev %d,%d ino %lu",
132 __entry->dev_major, __entry->dev_minor,
133 (unsigned long) __entry->ino)
136 TRACE_EVENT(jbd2_run_stats,
137 TP_PROTO(dev_t dev, unsigned long tid,
138 struct transaction_run_stats_s *stats),
140 TP_ARGS(dev, tid, stats),
143 __field( int, dev_major )
144 __field( int, dev_minor )
145 __field( unsigned long, tid )
146 __field( unsigned long, wait )
147 __field( unsigned long, running )
148 __field( unsigned long, locked )
149 __field( unsigned long, flushing )
150 __field( unsigned long, logging )
151 __field( __u32, handle_count )
152 __field( __u32, blocks )
153 __field( __u32, blocks_logged )
157 __entry->dev_major = MAJOR(dev);
158 __entry->dev_minor = MINOR(dev);
160 __entry->wait = stats->rs_wait;
161 __entry->running = stats->rs_running;
162 __entry->locked = stats->rs_locked;
163 __entry->flushing = stats->rs_flushing;
164 __entry->logging = stats->rs_logging;
165 __entry->handle_count = stats->rs_handle_count;
166 __entry->blocks = stats->rs_blocks;
167 __entry->blocks_logged = stats->rs_blocks_logged;
170 TP_printk("dev %d,%d tid %lu wait %u running %u locked %u flushing %u "
171 "logging %u handle_count %u blocks %u blocks_logged %u",
172 __entry->dev_major, __entry->dev_minor, __entry->tid,
173 jiffies_to_msecs(__entry->wait),
174 jiffies_to_msecs(__entry->running),
175 jiffies_to_msecs(__entry->locked),
176 jiffies_to_msecs(__entry->flushing),
177 jiffies_to_msecs(__entry->logging),
178 __entry->handle_count, __entry->blocks,
179 __entry->blocks_logged)
182 TRACE_EVENT(jbd2_checkpoint_stats,
183 TP_PROTO(dev_t dev, unsigned long tid,
184 struct transaction_chp_stats_s *stats),
186 TP_ARGS(dev, tid, stats),
189 __field( int, dev_major )
190 __field( int, dev_minor )
191 __field( unsigned long, tid )
192 __field( unsigned long, chp_time )
193 __field( __u32, forced_to_close )
194 __field( __u32, written )
195 __field( __u32, dropped )
199 __entry->dev_major = MAJOR(dev);
200 __entry->dev_minor = MINOR(dev);
202 __entry->chp_time = stats->cs_chp_time;
203 __entry->forced_to_close= stats->cs_forced_to_close;
204 __entry->written = stats->cs_written;
205 __entry->dropped = stats->cs_dropped;
208 TP_printk("dev %d,%d tid %lu chp_time %u forced_to_close %u "
209 "written %u dropped %u",
210 __entry->dev_major, __entry->dev_minor, __entry->tid,
211 jiffies_to_msecs(__entry->chp_time),
212 __entry->forced_to_close, __entry->written, __entry->dropped)
215 TRACE_EVENT(jbd2_cleanup_journal_tail,
217 TP_PROTO(journal_t *journal, tid_t first_tid,
218 unsigned long block_nr, unsigned long freed),
220 TP_ARGS(journal, first_tid, block_nr, freed),
223 __field( int, dev_major )
224 __field( int, dev_minor )
225 __field( tid_t, tail_sequence )
226 __field( tid_t, first_tid )
227 __field(unsigned long, block_nr )
228 __field(unsigned long, freed )
232 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev);
233 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
234 __entry->tail_sequence = journal->j_tail_sequence;
235 __entry->first_tid = first_tid;
236 __entry->block_nr = block_nr;
237 __entry->freed = freed;
240 TP_printk("dev %d,%d from %u to %u offset %lu freed %lu",
241 __entry->dev_major, __entry->dev_minor,
242 __entry->tail_sequence, __entry->first_tid,
243 __entry->block_nr, __entry->freed)
246 #endif /* _TRACE_JBD2_H */
248 /* This part must be outside protection */
249 #include <trace/define_trace.h>