blob: bf16545cc97756d263305f17712f522b979bbf32 [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(
20 __field( dev_t, dev )
21 __field( int, result )
22 ),
23
24 TP_fast_assign(
25 __entry->dev = journal->j_fs_dev->bd_dev;
26 __entry->result = result;
27 ),
28
29 TP_printk("dev %s result %d",
30 jbd2_dev_to_name(__entry->dev), __entry->result)
31);
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(
40 __field( dev_t, dev )
41 __field( char, sync_commit )
42 __field( int, transaction )
43 ),
44
45 TP_fast_assign(
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;
49 ),
50
51 TP_printk("dev %s transaction %d sync %d",
52 jbd2_dev_to_name(__entry->dev), __entry->transaction,
53 __entry->sync_commit)
54);
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
84TRACE_EVENT(jbd2_end_commit,
85 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
86
87 TP_ARGS(journal, commit_transaction),
88
89 TP_STRUCT__entry(
90 __field( dev_t, dev )
91 __field( char, sync_commit )
92 __field( int, transaction )
93 __field( int, head )
94 ),
95
96 TP_fast_assign(
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;
101 ),
102
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)
106);
107
108TRACE_EVENT(jbd2_submit_inode_data,
109 TP_PROTO(struct inode *inode),
110
111 TP_ARGS(inode),
112
113 TP_STRUCT__entry(
114 __field( dev_t, dev )
115 __field( ino_t, ino )
116 ),
117
118 TP_fast_assign(
119 __entry->dev = inode->i_sb->s_dev;
120 __entry->ino = inode->i_ino;
121 ),
122
123 TP_printk("dev %s ino %lu",
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400124 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino)
Theodore Ts'o879c5e62009-06-17 11:47:48 -0400125);
126
Theodore Ts'obf699322009-09-30 00:32:06 -0400127TRACE_EVENT(jbd2_run_stats,
128 TP_PROTO(dev_t dev, unsigned long tid,
129 struct transaction_run_stats_s *stats),
130
131 TP_ARGS(dev, tid, stats),
132
133 TP_STRUCT__entry(
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 )
144 ),
145
146 TP_fast_assign(
147 __entry->dev = dev;
148 __entry->tid = tid;
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;
157 ),
158
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)
169);
170
171TRACE_EVENT(jbd2_checkpoint_stats,
172 TP_PROTO(dev_t dev, unsigned long tid,
173 struct transaction_chp_stats_s *stats),
174
175 TP_ARGS(dev, tid, stats),
176
177 TP_STRUCT__entry(
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 )
184 ),
185
186 TP_fast_assign(
187 __entry->dev = dev;
188 __entry->tid = tid;
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;
193 ),
194
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)
200);
201
Theodore Ts'o71f2be22009-12-23 07:45:44 -0500202TRACE_EVENT(jbd2_cleanup_journal_tail,
203
204 TP_PROTO(journal_t *journal, tid_t first_tid,
205 unsigned long block_nr, unsigned long freed),
206
207 TP_ARGS(journal, first_tid, block_nr, freed),
208
209 TP_STRUCT__entry(
210 __field( dev_t, dev )
211 __field( tid_t, tail_sequence )
212 __field( tid_t, first_tid )
213 __field(unsigned long, block_nr )
214 __field(unsigned long, freed )
215 ),
216
217 TP_fast_assign(
218 __entry->dev = journal->j_fs_dev->bd_dev;
219 __entry->tail_sequence = journal->j_tail_sequence;
220 __entry->first_tid = first_tid;
221 __entry->block_nr = block_nr;
222 __entry->freed = freed;
223 ),
224
225 TP_printk("dev %s from %u to %u offset %lu freed %lu",
226 jbd2_dev_to_name(__entry->dev), __entry->tail_sequence,
227 __entry->first_tid, __entry->block_nr, __entry->freed)
228);
229
Theodore Ts'o879c5e62009-06-17 11:47:48 -0400230#endif /* _TRACE_JBD2_H */
231
232/* This part must be outside protection */
233#include <trace/define_trace.h>