blob: 127993dbf322efa40bc68222551ff181132122b4 [file] [log] [blame]
Li Zefand0b6e042009-07-13 10:33:21 +08001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM jbd2
3
Theodore Ts'o879c5e62009-06-17 11:47:48 -04004#if !defined(_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_JBD2_H
6
7#include <linux/jbd2.h>
8#include <linux/tracepoint.h>
9
Theodore Ts'obf699322009-09-30 00:32:06 -040010struct transaction_chp_stats_s;
11struct transaction_run_stats_s;
12
Theodore Ts'o879c5e62009-06-17 11:47:48 -040013TRACE_EVENT(jbd2_checkpoint,
14
15 TP_PROTO(journal_t *journal, int result),
16
17 TP_ARGS(journal, result),
18
19 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040020 __field( dev_t, dev )
Theodore Ts'o879c5e62009-06-17 11:47:48 -040021 __field( int, result )
22 ),
23
24 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040025 __entry->dev = journal->j_fs_dev->bd_dev;
Theodore Ts'o879c5e62009-06-17 11:47:48 -040026 __entry->result = result;
27 ),
28
Theodore Ts'o4862fd62011-07-10 22:05:08 -040029 TP_printk("dev %d,%d result %d",
30 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->result)
Theodore Ts'o879c5e62009-06-17 11:47:48 -040031);
32
Li Zefan071688f2009-11-26 15:06:55 +080033DECLARE_EVENT_CLASS(jbd2_commit,
Theodore Ts'o879c5e62009-06-17 11:47:48 -040034
35 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
36
37 TP_ARGS(journal, commit_transaction),
38
39 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040040 __field( dev_t, dev )
Theodore Ts'o879c5e62009-06-17 11:47:48 -040041 __field( char, sync_commit )
42 __field( int, transaction )
43 ),
44
45 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040046 __entry->dev = journal->j_fs_dev->bd_dev;
Theodore Ts'o879c5e62009-06-17 11:47:48 -040047 __entry->sync_commit = commit_transaction->t_synchronous_commit;
48 __entry->transaction = commit_transaction->t_tid;
49 ),
50
Theodore Ts'o4862fd62011-07-10 22:05:08 -040051 TP_printk("dev %d,%d transaction %d sync %d",
52 MAJOR(__entry->dev), MINOR(__entry->dev),
53 __entry->transaction, __entry->sync_commit)
Theodore Ts'o879c5e62009-06-17 11:47:48 -040054);
55
Li Zefan071688f2009-11-26 15:06:55 +080056DEFINE_EVENT(jbd2_commit, jbd2_start_commit,
Theodore Ts'o879c5e62009-06-17 11:47:48 -040057
58 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
59
Li Zefan071688f2009-11-26 15:06:55 +080060 TP_ARGS(journal, commit_transaction)
Theodore Ts'o879c5e62009-06-17 11:47:48 -040061);
62
Li Zefan071688f2009-11-26 15:06:55 +080063DEFINE_EVENT(jbd2_commit, jbd2_commit_locking,
Theodore Ts'o879c5e62009-06-17 11:47:48 -040064
65 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
66
Li Zefan071688f2009-11-26 15:06:55 +080067 TP_ARGS(journal, commit_transaction)
Theodore Ts'o879c5e62009-06-17 11:47:48 -040068);
69
Li Zefan071688f2009-11-26 15:06:55 +080070DEFINE_EVENT(jbd2_commit, jbd2_commit_flushing,
Theodore Ts'o879c5e62009-06-17 11:47:48 -040071
72 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
73
Li Zefan071688f2009-11-26 15:06:55 +080074 TP_ARGS(journal, commit_transaction)
75);
Theodore Ts'o879c5e62009-06-17 11:47:48 -040076
Li Zefan071688f2009-11-26 15:06:55 +080077DEFINE_EVENT(jbd2_commit, jbd2_commit_logging,
Theodore Ts'o879c5e62009-06-17 11:47:48 -040078
Li Zefan071688f2009-11-26 15:06:55 +080079 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
Theodore Ts'o879c5e62009-06-17 11:47:48 -040080
Li Zefan071688f2009-11-26 15:06:55 +080081 TP_ARGS(journal, commit_transaction)
Theodore Ts'o879c5e62009-06-17 11:47:48 -040082);
83
Seiji Aguchi2201c592012-02-20 17:53:01 -050084DEFINE_EVENT(jbd2_commit, jbd2_drop_transaction,
85
86 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
87
88 TP_ARGS(journal, commit_transaction)
89);
90
Theodore Ts'o879c5e62009-06-17 11:47:48 -040091TRACE_EVENT(jbd2_end_commit,
92 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
93
94 TP_ARGS(journal, commit_transaction),
95
96 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040097 __field( dev_t, dev )
Theodore Ts'o879c5e62009-06-17 11:47:48 -040098 __field( char, sync_commit )
99 __field( int, transaction )
100 __field( int, head )
101 ),
102
103 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400104 __entry->dev = journal->j_fs_dev->bd_dev;
Theodore Ts'o879c5e62009-06-17 11:47:48 -0400105 __entry->sync_commit = commit_transaction->t_synchronous_commit;
106 __entry->transaction = commit_transaction->t_tid;
107 __entry->head = journal->j_tail_sequence;
108 ),
109
Theodore Ts'o4862fd62011-07-10 22:05:08 -0400110 TP_printk("dev %d,%d transaction %d sync %d head %d",
111 MAJOR(__entry->dev), MINOR(__entry->dev),
112 __entry->transaction, __entry->sync_commit, __entry->head)
Theodore Ts'o879c5e62009-06-17 11:47:48 -0400113);
114
115TRACE_EVENT(jbd2_submit_inode_data,
116 TP_PROTO(struct inode *inode),
117
118 TP_ARGS(inode),
119
120 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400121 __field( dev_t, dev )
Theodore Ts'o879c5e62009-06-17 11:47:48 -0400122 __field( ino_t, ino )
123 ),
124
125 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400126 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o879c5e62009-06-17 11:47:48 -0400127 __entry->ino = inode->i_ino;
128 ),
129
Theodore Ts'o4862fd62011-07-10 22:05:08 -0400130 TP_printk("dev %d,%d ino %lu",
131 MAJOR(__entry->dev), MINOR(__entry->dev),
132 (unsigned long) __entry->ino)
Theodore Ts'o879c5e62009-06-17 11:47:48 -0400133);
134
Theodore Ts'obf699322009-09-30 00:32:06 -0400135TRACE_EVENT(jbd2_run_stats,
136 TP_PROTO(dev_t dev, unsigned long tid,
137 struct transaction_run_stats_s *stats),
138
139 TP_ARGS(dev, tid, stats),
140
141 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400142 __field( dev_t, dev )
Theodore Ts'obf699322009-09-30 00:32:06 -0400143 __field( unsigned long, tid )
144 __field( unsigned long, wait )
145 __field( unsigned long, running )
146 __field( unsigned long, locked )
147 __field( unsigned long, flushing )
148 __field( unsigned long, logging )
149 __field( __u32, handle_count )
150 __field( __u32, blocks )
151 __field( __u32, blocks_logged )
152 ),
153
154 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400155 __entry->dev = dev;
Theodore Ts'obf699322009-09-30 00:32:06 -0400156 __entry->tid = tid;
157 __entry->wait = stats->rs_wait;
158 __entry->running = stats->rs_running;
159 __entry->locked = stats->rs_locked;
160 __entry->flushing = stats->rs_flushing;
161 __entry->logging = stats->rs_logging;
162 __entry->handle_count = stats->rs_handle_count;
163 __entry->blocks = stats->rs_blocks;
164 __entry->blocks_logged = stats->rs_blocks_logged;
165 ),
166
Theodore Ts'o4862fd62011-07-10 22:05:08 -0400167 TP_printk("dev %d,%d tid %lu wait %u running %u locked %u flushing %u "
Theodore Ts'obf699322009-09-30 00:32:06 -0400168 "logging %u handle_count %u blocks %u blocks_logged %u",
Theodore Ts'o4862fd62011-07-10 22:05:08 -0400169 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid,
Theodore Ts'obf699322009-09-30 00:32:06 -0400170 jiffies_to_msecs(__entry->wait),
171 jiffies_to_msecs(__entry->running),
172 jiffies_to_msecs(__entry->locked),
173 jiffies_to_msecs(__entry->flushing),
174 jiffies_to_msecs(__entry->logging),
175 __entry->handle_count, __entry->blocks,
176 __entry->blocks_logged)
177);
178
179TRACE_EVENT(jbd2_checkpoint_stats,
180 TP_PROTO(dev_t dev, unsigned long tid,
181 struct transaction_chp_stats_s *stats),
182
183 TP_ARGS(dev, tid, stats),
184
185 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400186 __field( dev_t, dev )
Theodore Ts'obf699322009-09-30 00:32:06 -0400187 __field( unsigned long, tid )
188 __field( unsigned long, chp_time )
189 __field( __u32, forced_to_close )
190 __field( __u32, written )
191 __field( __u32, dropped )
192 ),
193
194 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400195 __entry->dev = dev;
Theodore Ts'obf699322009-09-30 00:32:06 -0400196 __entry->tid = tid;
197 __entry->chp_time = stats->cs_chp_time;
198 __entry->forced_to_close= stats->cs_forced_to_close;
199 __entry->written = stats->cs_written;
200 __entry->dropped = stats->cs_dropped;
201 ),
202
Theodore Ts'o4862fd62011-07-10 22:05:08 -0400203 TP_printk("dev %d,%d tid %lu chp_time %u forced_to_close %u "
Theodore Ts'obf699322009-09-30 00:32:06 -0400204 "written %u dropped %u",
Theodore Ts'o4862fd62011-07-10 22:05:08 -0400205 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid,
Theodore Ts'obf699322009-09-30 00:32:06 -0400206 jiffies_to_msecs(__entry->chp_time),
207 __entry->forced_to_close, __entry->written, __entry->dropped)
208);
209
Jan Kara79feb522012-03-13 22:22:54 -0400210TRACE_EVENT(jbd2_update_log_tail,
Theodore Ts'o71f2be22009-12-23 07:45:44 -0500211
212 TP_PROTO(journal_t *journal, tid_t first_tid,
213 unsigned long block_nr, unsigned long freed),
214
215 TP_ARGS(journal, first_tid, block_nr, freed),
216
217 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400218 __field( dev_t, dev )
Theodore Ts'o71f2be22009-12-23 07:45:44 -0500219 __field( tid_t, tail_sequence )
220 __field( tid_t, first_tid )
221 __field(unsigned long, block_nr )
222 __field(unsigned long, freed )
223 ),
224
225 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400226 __entry->dev = journal->j_fs_dev->bd_dev;
Theodore Ts'o71f2be22009-12-23 07:45:44 -0500227 __entry->tail_sequence = journal->j_tail_sequence;
228 __entry->first_tid = first_tid;
229 __entry->block_nr = block_nr;
230 __entry->freed = freed;
231 ),
232
Theodore Ts'o4862fd62011-07-10 22:05:08 -0400233 TP_printk("dev %d,%d from %u to %u offset %lu freed %lu",
234 MAJOR(__entry->dev), MINOR(__entry->dev),
235 __entry->tail_sequence, __entry->first_tid,
236 __entry->block_nr, __entry->freed)
Theodore Ts'o71f2be22009-12-23 07:45:44 -0500237);
238
Jan Kara24bcc892012-03-13 15:41:04 -0400239TRACE_EVENT(jbd2_write_superblock,
Seiji Aguchi2201c592012-02-20 17:53:01 -0500240
Jan Kara79feb522012-03-13 22:22:54 -0400241 TP_PROTO(journal_t *journal, int write_op),
Seiji Aguchi2201c592012-02-20 17:53:01 -0500242
Jan Kara79feb522012-03-13 22:22:54 -0400243 TP_ARGS(journal, write_op),
Seiji Aguchi2201c592012-02-20 17:53:01 -0500244
245 TP_STRUCT__entry(
246 __field( dev_t, dev )
Jan Kara79feb522012-03-13 22:22:54 -0400247 __field( int, write_op )
Seiji Aguchi2201c592012-02-20 17:53:01 -0500248 ),
249
250 TP_fast_assign(
251 __entry->dev = journal->j_fs_dev->bd_dev;
Jan Kara79feb522012-03-13 22:22:54 -0400252 __entry->write_op = write_op;
Seiji Aguchi2201c592012-02-20 17:53:01 -0500253 ),
254
Jan Kara79feb522012-03-13 22:22:54 -0400255 TP_printk("dev %d,%d write_op %x", MAJOR(__entry->dev),
256 MINOR(__entry->dev), __entry->write_op)
Seiji Aguchi2201c592012-02-20 17:53:01 -0500257);
258
Theodore Ts'o879c5e62009-06-17 11:47:48 -0400259#endif /* _TRACE_JBD2_H */
260
261/* This part must be outside protection */
262#include <trace/define_trace.h>