blob: bf5518d50423706736c495df4e4aed2cf1bb9263 [file] [log] [blame]
Theodore Ts'o9bffad12009-06-17 11:48:11 -04001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM ext4
3
Li Zefand0b6e042009-07-13 10:33:21 +08004#if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_EXT4_H
6
Theodore Ts'o9bffad12009-06-17 11:48:11 -04007#include <linux/writeback.h>
Theodore Ts'o9bffad12009-06-17 11:48:11 -04008#include <linux/tracepoint.h>
9
Theodore Ts'o3661d282009-09-14 22:59:50 -040010struct ext4_allocation_context;
11struct ext4_allocation_request;
12struct ext4_prealloc_space;
Theodore Ts'ofb40ba02009-09-16 19:30:40 -040013struct ext4_inode_info;
Josh Stone0ef12242009-09-30 00:51:22 -040014struct mpage_da_data;
Theodore Ts'ofb40ba02009-09-16 19:30:40 -040015
16#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
Theodore Ts'o3661d282009-09-14 22:59:50 -040017
Theodore Ts'o9bffad12009-06-17 11:48:11 -040018TRACE_EVENT(ext4_free_inode,
19 TP_PROTO(struct inode *inode),
20
21 TP_ARGS(inode),
22
23 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040024 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040025 __field( ino_t, ino )
Theodore Ts'o59be8e72011-07-30 12:38:46 -040026 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040027 __field( uid_t, uid )
28 __field( gid_t, gid )
Lukas Czernera9c667f2011-06-06 09:51:52 -040029 __field( __u64, blocks )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040030 ),
31
32 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040033 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -040034 __entry->ino = inode->i_ino;
35 __entry->mode = inode->i_mode;
36 __entry->uid = inode->i_uid;
37 __entry->gid = inode->i_gid;
38 __entry->blocks = inode->i_blocks;
39 ),
40
Theodore Ts'oa2690292010-10-27 22:08:50 -040041 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040042 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -040043 (unsigned long) __entry->ino, __entry->mode,
44 __entry->uid, __entry->gid, __entry->blocks)
Theodore Ts'o9bffad12009-06-17 11:48:11 -040045);
46
47TRACE_EVENT(ext4_request_inode,
48 TP_PROTO(struct inode *dir, int mode),
49
50 TP_ARGS(dir, mode),
51
52 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040053 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040054 __field( ino_t, dir )
Theodore Ts'o59be8e72011-07-30 12:38:46 -040055 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040056 ),
57
58 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040059 __entry->dev = dir->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -040060 __entry->dir = dir->i_ino;
61 __entry->mode = mode;
62 ),
63
Theodore Ts'oa2690292010-10-27 22:08:50 -040064 TP_printk("dev %d,%d dir %lu mode 0%o",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040065 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -040066 (unsigned long) __entry->dir, __entry->mode)
Theodore Ts'o9bffad12009-06-17 11:48:11 -040067);
68
69TRACE_EVENT(ext4_allocate_inode,
70 TP_PROTO(struct inode *inode, struct inode *dir, int mode),
71
72 TP_ARGS(inode, dir, mode),
73
74 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040075 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040076 __field( ino_t, ino )
77 __field( ino_t, dir )
Theodore Ts'o59be8e72011-07-30 12:38:46 -040078 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040079 ),
80
81 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040082 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -040083 __entry->ino = inode->i_ino;
84 __entry->dir = dir->i_ino;
85 __entry->mode = mode;
86 ),
87
Theodore Ts'oa2690292010-10-27 22:08:50 -040088 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040089 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -040090 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -040091 (unsigned long) __entry->dir, __entry->mode)
Theodore Ts'o9bffad12009-06-17 11:48:11 -040092);
93
Theodore Ts'o7ff9c072010-11-08 13:51:33 -050094TRACE_EVENT(ext4_evict_inode,
95 TP_PROTO(struct inode *inode),
96
97 TP_ARGS(inode),
98
99 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400100 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500101 __field( ino_t, ino )
102 __field( int, nlink )
103 ),
104
105 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400106 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500107 __entry->ino = inode->i_ino;
108 __entry->nlink = inode->i_nlink;
109 ),
110
111 TP_printk("dev %d,%d ino %lu nlink %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400112 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500113 (unsigned long) __entry->ino, __entry->nlink)
114);
115
116TRACE_EVENT(ext4_drop_inode,
117 TP_PROTO(struct inode *inode, int drop),
118
119 TP_ARGS(inode, drop),
120
121 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400122 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500123 __field( ino_t, ino )
124 __field( int, drop )
125 ),
126
127 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400128 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500129 __entry->ino = inode->i_ino;
130 __entry->drop = drop;
131 ),
132
133 TP_printk("dev %d,%d ino %lu drop %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400134 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500135 (unsigned long) __entry->ino, __entry->drop)
136);
137
138TRACE_EVENT(ext4_mark_inode_dirty,
139 TP_PROTO(struct inode *inode, unsigned long IP),
140
141 TP_ARGS(inode, IP),
142
143 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400144 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500145 __field( ino_t, ino )
146 __field(unsigned long, ip )
147 ),
148
149 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400150 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500151 __entry->ino = inode->i_ino;
152 __entry->ip = IP;
153 ),
154
155 TP_printk("dev %d,%d ino %lu caller %pF",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400156 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500157 (unsigned long) __entry->ino, (void *)__entry->ip)
158);
159
160TRACE_EVENT(ext4_begin_ordered_truncate,
161 TP_PROTO(struct inode *inode, loff_t new_size),
162
163 TP_ARGS(inode, new_size),
164
165 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400166 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500167 __field( ino_t, ino )
168 __field( loff_t, new_size )
169 ),
170
171 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400172 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500173 __entry->ino = inode->i_ino;
174 __entry->new_size = new_size;
175 ),
176
177 TP_printk("dev %d,%d ino %lu new_size %lld",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400178 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500179 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400180 __entry->new_size)
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500181);
182
Li Zefanb5eb34c2009-11-26 15:07:36 +0800183DECLARE_EVENT_CLASS(ext4__write_begin,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400184
185 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
186 unsigned int flags),
187
188 TP_ARGS(inode, pos, len, flags),
189
190 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400191 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400192 __field( ino_t, ino )
193 __field( loff_t, pos )
194 __field( unsigned int, len )
195 __field( unsigned int, flags )
196 ),
197
198 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400199 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400200 __entry->ino = inode->i_ino;
201 __entry->pos = pos;
202 __entry->len = len;
203 __entry->flags = flags;
204 ),
205
Lukas Czernera9c667f2011-06-06 09:51:52 -0400206 TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400207 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400208 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400209 __entry->pos, __entry->len, __entry->flags)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400210);
211
Li Zefanb5eb34c2009-11-26 15:07:36 +0800212DEFINE_EVENT(ext4__write_begin, ext4_write_begin,
213
214 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
215 unsigned int flags),
216
217 TP_ARGS(inode, pos, len, flags)
218);
219
220DEFINE_EVENT(ext4__write_begin, ext4_da_write_begin,
221
222 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
223 unsigned int flags),
224
225 TP_ARGS(inode, pos, len, flags)
226);
227
228DECLARE_EVENT_CLASS(ext4__write_end,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400229 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
230 unsigned int copied),
231
232 TP_ARGS(inode, pos, len, copied),
233
234 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400235 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400236 __field( ino_t, ino )
237 __field( loff_t, pos )
238 __field( unsigned int, len )
239 __field( unsigned int, copied )
240 ),
241
242 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400243 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400244 __entry->ino = inode->i_ino;
245 __entry->pos = pos;
246 __entry->len = len;
247 __entry->copied = copied;
248 ),
249
Lukas Czernera9c667f2011-06-06 09:51:52 -0400250 TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400251 MAJOR(__entry->dev), MINOR(__entry->dev),
252 (unsigned long) __entry->ino,
253 __entry->pos, __entry->len, __entry->copied)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400254);
255
Li Zefanb5eb34c2009-11-26 15:07:36 +0800256DEFINE_EVENT(ext4__write_end, ext4_ordered_write_end,
257
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400258 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
259 unsigned int copied),
260
Li Zefanb5eb34c2009-11-26 15:07:36 +0800261 TP_ARGS(inode, pos, len, copied)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400262);
263
Li Zefanb5eb34c2009-11-26 15:07:36 +0800264DEFINE_EVENT(ext4__write_end, ext4_writeback_write_end,
265
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400266 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
267 unsigned int copied),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400268
Li Zefanb5eb34c2009-11-26 15:07:36 +0800269 TP_ARGS(inode, pos, len, copied)
270);
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400271
Li Zefanb5eb34c2009-11-26 15:07:36 +0800272DEFINE_EVENT(ext4__write_end, ext4_journalled_write_end,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400273
Li Zefanb5eb34c2009-11-26 15:07:36 +0800274 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
275 unsigned int copied),
276
277 TP_ARGS(inode, pos, len, copied)
278);
279
280DEFINE_EVENT(ext4__write_end, ext4_da_write_end,
281
282 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
283 unsigned int copied),
284
285 TP_ARGS(inode, pos, len, copied)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400286);
287
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400288TRACE_EVENT(ext4_da_writepages,
289 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
290
291 TP_ARGS(inode, wbc),
292
293 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400294 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400295 __field( ino_t, ino )
296 __field( long, nr_to_write )
297 __field( long, pages_skipped )
298 __field( loff_t, range_start )
299 __field( loff_t, range_end )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400300 __field( int, sync_mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400301 __field( char, for_kupdate )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400302 __field( char, range_cyclic )
Theodore Ts'o55138e02009-09-29 13:31:31 -0400303 __field( pgoff_t, writeback_index )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400304 ),
305
306 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400307 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400308 __entry->ino = inode->i_ino;
309 __entry->nr_to_write = wbc->nr_to_write;
310 __entry->pages_skipped = wbc->pages_skipped;
311 __entry->range_start = wbc->range_start;
312 __entry->range_end = wbc->range_end;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400313 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400314 __entry->for_kupdate = wbc->for_kupdate;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400315 __entry->range_cyclic = wbc->range_cyclic;
Theodore Ts'o55138e02009-09-29 13:31:31 -0400316 __entry->writeback_index = inode->i_mapping->writeback_index;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400317 ),
318
Theodore Ts'oa107e5a2010-10-27 23:44:47 -0400319 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
Lukas Czernera9c667f2011-06-06 09:51:52 -0400320 "range_start %lld range_end %lld sync_mode %d"
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400321 "for_kupdate %d range_cyclic %d writeback_index %lu",
322 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400323 (unsigned long) __entry->ino, __entry->nr_to_write,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400324 __entry->pages_skipped, __entry->range_start,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400325 __entry->range_end, __entry->sync_mode,
326 __entry->for_kupdate, __entry->range_cyclic,
Theodore Ts'o55138e02009-09-29 13:31:31 -0400327 (unsigned long) __entry->writeback_index)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400328);
329
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400330TRACE_EVENT(ext4_da_write_pages,
331 TP_PROTO(struct inode *inode, struct mpage_da_data *mpd),
332
333 TP_ARGS(inode, mpd),
334
335 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400336 __field( dev_t, dev )
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400337 __field( ino_t, ino )
338 __field( __u64, b_blocknr )
339 __field( __u32, b_size )
340 __field( __u32, b_state )
341 __field( unsigned long, first_page )
342 __field( int, io_done )
343 __field( int, pages_written )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400344 __field( int, sync_mode )
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400345 ),
346
347 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400348 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400349 __entry->ino = inode->i_ino;
350 __entry->b_blocknr = mpd->b_blocknr;
351 __entry->b_size = mpd->b_size;
352 __entry->b_state = mpd->b_state;
353 __entry->first_page = mpd->first_page;
354 __entry->io_done = mpd->io_done;
355 __entry->pages_written = mpd->pages_written;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400356 __entry->sync_mode = mpd->wbc->sync_mode;
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400357 ),
358
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400359 TP_printk("dev %d,%d ino %lu b_blocknr %llu b_size %u b_state 0x%04x "
360 "first_page %lu io_done %d pages_written %d sync_mode %d",
361 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400362 (unsigned long) __entry->ino,
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400363 __entry->b_blocknr, __entry->b_size,
364 __entry->b_state, __entry->first_page,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400365 __entry->io_done, __entry->pages_written,
366 __entry->sync_mode
367 )
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400368);
369
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400370TRACE_EVENT(ext4_da_writepages_result,
371 TP_PROTO(struct inode *inode, struct writeback_control *wbc,
372 int ret, int pages_written),
373
374 TP_ARGS(inode, wbc, ret, pages_written),
375
376 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400377 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400378 __field( ino_t, ino )
379 __field( int, ret )
380 __field( int, pages_written )
381 __field( long, pages_skipped )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400382 __field( int, sync_mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400383 __field( char, more_io )
Theodore Ts'o55138e02009-09-29 13:31:31 -0400384 __field( pgoff_t, writeback_index )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400385 ),
386
387 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400388 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400389 __entry->ino = inode->i_ino;
390 __entry->ret = ret;
391 __entry->pages_written = pages_written;
392 __entry->pages_skipped = wbc->pages_skipped;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400393 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400394 __entry->more_io = wbc->more_io;
Theodore Ts'o55138e02009-09-29 13:31:31 -0400395 __entry->writeback_index = inode->i_mapping->writeback_index;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400396 ),
397
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400398 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
399 " more_io %d sync_mode %d writeback_index %lu",
400 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400401 (unsigned long) __entry->ino, __entry->ret,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400402 __entry->pages_written, __entry->pages_skipped,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400403 __entry->more_io, __entry->sync_mode,
Theodore Ts'o55138e02009-09-29 13:31:31 -0400404 (unsigned long) __entry->writeback_index)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400405);
406
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400407DECLARE_EVENT_CLASS(ext4__page_op,
408 TP_PROTO(struct page *page),
409
410 TP_ARGS(page),
411
412 TP_STRUCT__entry(
413 __field( pgoff_t, index )
414 __field( ino_t, ino )
415 __field( dev_t, dev )
416
417 ),
418
419 TP_fast_assign(
420 __entry->index = page->index;
421 __entry->ino = page->mapping->host->i_ino;
422 __entry->dev = page->mapping->host->i_sb->s_dev;
423 ),
424
425 TP_printk("dev %d,%d ino %lu page_index %lu",
426 MAJOR(__entry->dev), MINOR(__entry->dev),
427 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400428 (unsigned long) __entry->index)
429);
430
431DEFINE_EVENT(ext4__page_op, ext4_writepage,
432
433 TP_PROTO(struct page *page),
434
435 TP_ARGS(page)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400436);
437
438DEFINE_EVENT(ext4__page_op, ext4_readpage,
439
440 TP_PROTO(struct page *page),
441
442 TP_ARGS(page)
443);
444
445DEFINE_EVENT(ext4__page_op, ext4_releasepage,
446
447 TP_PROTO(struct page *page),
448
449 TP_ARGS(page)
450);
451
452TRACE_EVENT(ext4_invalidatepage,
453 TP_PROTO(struct page *page, unsigned long offset),
454
455 TP_ARGS(page, offset),
456
457 TP_STRUCT__entry(
458 __field( pgoff_t, index )
459 __field( unsigned long, offset )
460 __field( ino_t, ino )
461 __field( dev_t, dev )
462
463 ),
464
465 TP_fast_assign(
466 __entry->index = page->index;
467 __entry->offset = offset;
468 __entry->ino = page->mapping->host->i_ino;
469 __entry->dev = page->mapping->host->i_sb->s_dev;
470 ),
471
472 TP_printk("dev %d,%d ino %lu page_index %lu offset %lu",
473 MAJOR(__entry->dev), MINOR(__entry->dev),
474 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400475 (unsigned long) __entry->index, __entry->offset)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400476);
477
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400478TRACE_EVENT(ext4_discard_blocks,
479 TP_PROTO(struct super_block *sb, unsigned long long blk,
480 unsigned long long count),
481
482 TP_ARGS(sb, blk, count),
483
484 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400485 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400486 __field( __u64, blk )
487 __field( __u64, count )
488
489 ),
490
491 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400492 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400493 __entry->blk = blk;
494 __entry->count = count;
495 ),
496
Theodore Ts'oa2690292010-10-27 22:08:50 -0400497 TP_printk("dev %d,%d blk %llu count %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400498 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400499 __entry->blk, __entry->count)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400500);
501
Li Zefanf084db92010-05-17 04:00:00 -0400502DECLARE_EVENT_CLASS(ext4__mb_new_pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400503 TP_PROTO(struct ext4_allocation_context *ac,
504 struct ext4_prealloc_space *pa),
505
506 TP_ARGS(ac, pa),
507
508 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400509 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400510 __field( ino_t, ino )
511 __field( __u64, pa_pstart )
512 __field( __u32, pa_len )
513 __field( __u64, pa_lstart )
514
515 ),
516
517 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400518 __entry->dev = ac->ac_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400519 __entry->ino = ac->ac_inode->i_ino;
520 __entry->pa_pstart = pa->pa_pstart;
521 __entry->pa_len = pa->pa_len;
522 __entry->pa_lstart = pa->pa_lstart;
523 ),
524
Theodore Ts'oa2690292010-10-27 22:08:50 -0400525 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400526 MAJOR(__entry->dev), MINOR(__entry->dev),
527 (unsigned long) __entry->ino,
528 __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400529);
530
Li Zefanf084db92010-05-17 04:00:00 -0400531DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa,
532
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400533 TP_PROTO(struct ext4_allocation_context *ac,
534 struct ext4_prealloc_space *pa),
535
Li Zefanf084db92010-05-17 04:00:00 -0400536 TP_ARGS(ac, pa)
537);
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400538
Li Zefanf084db92010-05-17 04:00:00 -0400539DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400540
Li Zefanf084db92010-05-17 04:00:00 -0400541 TP_PROTO(struct ext4_allocation_context *ac,
542 struct ext4_prealloc_space *pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400543
Li Zefanf084db92010-05-17 04:00:00 -0400544 TP_ARGS(ac, pa)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400545);
546
547TRACE_EVENT(ext4_mb_release_inode_pa,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400548 TP_PROTO(struct ext4_prealloc_space *pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400549 unsigned long long block, unsigned int count),
550
Lukas Czernera9c667f2011-06-06 09:51:52 -0400551 TP_ARGS(pa, block, count),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400552
553 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400554 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400555 __field( ino_t, ino )
556 __field( __u64, block )
557 __field( __u32, count )
558
559 ),
560
561 TP_fast_assign(
Lukas Czernera9c667f2011-06-06 09:51:52 -0400562 __entry->dev = pa->pa_inode->i_sb->s_dev;
563 __entry->ino = pa->pa_inode->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400564 __entry->block = block;
565 __entry->count = count;
566 ),
567
Theodore Ts'oa2690292010-10-27 22:08:50 -0400568 TP_printk("dev %d,%d ino %lu block %llu count %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400569 MAJOR(__entry->dev), MINOR(__entry->dev),
570 (unsigned long) __entry->ino,
571 __entry->block, __entry->count)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400572);
573
574TRACE_EVENT(ext4_mb_release_group_pa,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400575 TP_PROTO(struct ext4_prealloc_space *pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400576
Lukas Czernera9c667f2011-06-06 09:51:52 -0400577 TP_ARGS(pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400578
579 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400580 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400581 __field( __u64, pa_pstart )
582 __field( __u32, pa_len )
583
584 ),
585
586 TP_fast_assign(
Lukas Czernera9c667f2011-06-06 09:51:52 -0400587 __entry->dev = pa->pa_inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400588 __entry->pa_pstart = pa->pa_pstart;
589 __entry->pa_len = pa->pa_len;
590 ),
591
Theodore Ts'oa2690292010-10-27 22:08:50 -0400592 TP_printk("dev %d,%d pstart %llu len %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400593 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400594 __entry->pa_pstart, __entry->pa_len)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400595);
596
597TRACE_EVENT(ext4_discard_preallocations,
598 TP_PROTO(struct inode *inode),
599
600 TP_ARGS(inode),
601
602 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400603 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400604 __field( ino_t, ino )
605
606 ),
607
608 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400609 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400610 __entry->ino = inode->i_ino;
611 ),
612
Theodore Ts'oa2690292010-10-27 22:08:50 -0400613 TP_printk("dev %d,%d ino %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400614 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400615 (unsigned long) __entry->ino)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400616);
617
618TRACE_EVENT(ext4_mb_discard_preallocations,
619 TP_PROTO(struct super_block *sb, int needed),
620
621 TP_ARGS(sb, needed),
622
623 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400624 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400625 __field( int, needed )
626
627 ),
628
629 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400630 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400631 __entry->needed = needed;
632 ),
633
Theodore Ts'oa2690292010-10-27 22:08:50 -0400634 TP_printk("dev %d,%d needed %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400635 MAJOR(__entry->dev), MINOR(__entry->dev),
636 __entry->needed)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400637);
638
639TRACE_EVENT(ext4_request_blocks,
640 TP_PROTO(struct ext4_allocation_request *ar),
641
642 TP_ARGS(ar),
643
644 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400645 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400646 __field( ino_t, ino )
647 __field( unsigned int, flags )
648 __field( unsigned int, len )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400649 __field( __u32, logical )
650 __field( __u32, lleft )
651 __field( __u32, lright )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400652 __field( __u64, goal )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400653 __field( __u64, pleft )
654 __field( __u64, pright )
655 ),
656
657 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400658 __entry->dev = ar->inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400659 __entry->ino = ar->inode->i_ino;
660 __entry->flags = ar->flags;
661 __entry->len = ar->len;
662 __entry->logical = ar->logical;
663 __entry->goal = ar->goal;
664 __entry->lleft = ar->lleft;
665 __entry->lright = ar->lright;
666 __entry->pleft = ar->pleft;
667 __entry->pright = ar->pright;
668 ),
669
Lukas Czernera9c667f2011-06-06 09:51:52 -0400670 TP_printk("dev %d,%d ino %lu flags %u len %u lblk %u goal %llu "
671 "lleft %u lright %u pleft %llu pright %llu ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400672 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -0400673 (unsigned long) __entry->ino, __entry->flags,
674 __entry->len, __entry->logical, __entry->goal,
675 __entry->lleft, __entry->lright, __entry->pleft,
676 __entry->pright)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400677);
678
679TRACE_EVENT(ext4_allocate_blocks,
680 TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block),
681
682 TP_ARGS(ar, block),
683
684 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400685 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400686 __field( ino_t, ino )
687 __field( __u64, block )
688 __field( unsigned int, flags )
689 __field( unsigned int, len )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400690 __field( __u32, logical )
691 __field( __u32, lleft )
692 __field( __u32, lright )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400693 __field( __u64, goal )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400694 __field( __u64, pleft )
695 __field( __u64, pright )
696 ),
697
698 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400699 __entry->dev = ar->inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400700 __entry->ino = ar->inode->i_ino;
701 __entry->block = block;
702 __entry->flags = ar->flags;
703 __entry->len = ar->len;
704 __entry->logical = ar->logical;
705 __entry->goal = ar->goal;
706 __entry->lleft = ar->lleft;
707 __entry->lright = ar->lright;
708 __entry->pleft = ar->pleft;
709 __entry->pright = ar->pright;
710 ),
711
Lukas Czernera9c667f2011-06-06 09:51:52 -0400712 TP_printk("dev %d,%d ino %lu flags %u len %u block %llu lblk %u "
713 "goal %llu lleft %u lright %u pleft %llu pright %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400714 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -0400715 (unsigned long) __entry->ino, __entry->flags,
716 __entry->len, __entry->block, __entry->logical,
717 __entry->goal, __entry->lleft, __entry->lright,
718 __entry->pleft, __entry->pright)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400719);
720
721TRACE_EVENT(ext4_free_blocks,
722 TP_PROTO(struct inode *inode, __u64 block, unsigned long count,
Theodore Ts'oe6362602009-11-23 07:17:05 -0500723 int flags),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400724
Theodore Ts'oe6362602009-11-23 07:17:05 -0500725 TP_ARGS(inode, block, count, flags),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400726
727 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400728 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400729 __field( ino_t, ino )
Theodore Ts'o59be8e72011-07-30 12:38:46 -0400730 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400731 __field( __u64, block )
732 __field( unsigned long, count )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400733 __field( int, flags )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400734 ),
735
736 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400737 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400738 __entry->ino = inode->i_ino;
Theodore Ts'oe6362602009-11-23 07:17:05 -0500739 __entry->mode = inode->i_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400740 __entry->block = block;
741 __entry->count = count;
Theodore Ts'oe6362602009-11-23 07:17:05 -0500742 __entry->flags = flags;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400743 ),
744
Theodore Ts'oa2690292010-10-27 22:08:50 -0400745 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400746 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400747 (unsigned long) __entry->ino,
Theodore Ts'oe6362602009-11-23 07:17:05 -0500748 __entry->mode, __entry->block, __entry->count,
749 __entry->flags)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400750);
751
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400752TRACE_EVENT(ext4_sync_file_enter,
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200753 TP_PROTO(struct file *file, int datasync),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400754
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200755 TP_ARGS(file, datasync),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400756
757 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400758 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400759 __field( ino_t, ino )
760 __field( ino_t, parent )
761 __field( int, datasync )
762 ),
763
764 TP_fast_assign(
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200765 struct dentry *dentry = file->f_path.dentry;
766
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400767 __entry->dev = dentry->d_inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400768 __entry->ino = dentry->d_inode->i_ino;
769 __entry->datasync = datasync;
770 __entry->parent = dentry->d_parent->d_inode->i_ino;
771 ),
772
Lukas Czernera9c667f2011-06-06 09:51:52 -0400773 TP_printk("dev %d,%d ino %lu parent %lu datasync %d ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400774 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400775 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400776 (unsigned long) __entry->parent, __entry->datasync)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400777);
778
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400779TRACE_EVENT(ext4_sync_file_exit,
780 TP_PROTO(struct inode *inode, int ret),
781
782 TP_ARGS(inode, ret),
783
784 TP_STRUCT__entry(
785 __field( int, ret )
786 __field( ino_t, ino )
787 __field( dev_t, dev )
788 ),
789
790 TP_fast_assign(
791 __entry->ret = ret;
792 __entry->ino = inode->i_ino;
793 __entry->dev = inode->i_sb->s_dev;
794 ),
795
Lukas Czernera9c667f2011-06-06 09:51:52 -0400796 TP_printk("dev %d,%d ino %lu ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400797 MAJOR(__entry->dev), MINOR(__entry->dev),
798 (unsigned long) __entry->ino,
799 __entry->ret)
800);
801
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400802TRACE_EVENT(ext4_sync_fs,
803 TP_PROTO(struct super_block *sb, int wait),
804
805 TP_ARGS(sb, wait),
806
807 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400808 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400809 __field( int, wait )
810
811 ),
812
813 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400814 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400815 __entry->wait = wait;
816 ),
817
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400818 TP_printk("dev %d,%d wait %d",
819 MAJOR(__entry->dev), MINOR(__entry->dev),
820 __entry->wait)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400821);
822
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400823TRACE_EVENT(ext4_alloc_da_blocks,
824 TP_PROTO(struct inode *inode),
825
826 TP_ARGS(inode),
827
828 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400829 __field( dev_t, dev )
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400830 __field( ino_t, ino )
831 __field( unsigned int, data_blocks )
832 __field( unsigned int, meta_blocks )
833 ),
834
835 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400836 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400837 __entry->ino = inode->i_ino;
838 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
839 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
840 ),
841
Theodore Ts'oa2690292010-10-27 22:08:50 -0400842 TP_printk("dev %d,%d ino %lu data_blocks %u meta_blocks %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400843 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400844 (unsigned long) __entry->ino,
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400845 __entry->data_blocks, __entry->meta_blocks)
846);
847
Theodore Ts'o296c3552009-09-30 00:32:42 -0400848TRACE_EVENT(ext4_mballoc_alloc,
849 TP_PROTO(struct ext4_allocation_context *ac),
850
851 TP_ARGS(ac),
852
853 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400854 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -0400855 __field( ino_t, ino )
856 __field( __u16, found )
857 __field( __u16, groups )
858 __field( __u16, buddy )
859 __field( __u16, flags )
860 __field( __u16, tail )
861 __field( __u8, cr )
862 __field( __u32, orig_logical )
863 __field( int, orig_start )
864 __field( __u32, orig_group )
865 __field( int, orig_len )
866 __field( __u32, goal_logical )
867 __field( int, goal_start )
868 __field( __u32, goal_group )
869 __field( int, goal_len )
870 __field( __u32, result_logical )
871 __field( int, result_start )
872 __field( __u32, result_group )
873 __field( int, result_len )
874 ),
875
876 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400877 __entry->dev = ac->ac_inode->i_sb->s_dev;
Theodore Ts'o296c3552009-09-30 00:32:42 -0400878 __entry->ino = ac->ac_inode->i_ino;
879 __entry->found = ac->ac_found;
880 __entry->flags = ac->ac_flags;
881 __entry->groups = ac->ac_groups_scanned;
882 __entry->buddy = ac->ac_buddy;
883 __entry->tail = ac->ac_tail;
884 __entry->cr = ac->ac_criteria;
885 __entry->orig_logical = ac->ac_o_ex.fe_logical;
886 __entry->orig_start = ac->ac_o_ex.fe_start;
887 __entry->orig_group = ac->ac_o_ex.fe_group;
888 __entry->orig_len = ac->ac_o_ex.fe_len;
889 __entry->goal_logical = ac->ac_g_ex.fe_logical;
890 __entry->goal_start = ac->ac_g_ex.fe_start;
891 __entry->goal_group = ac->ac_g_ex.fe_group;
892 __entry->goal_len = ac->ac_g_ex.fe_len;
893 __entry->result_logical = ac->ac_f_ex.fe_logical;
894 __entry->result_start = ac->ac_f_ex.fe_start;
895 __entry->result_group = ac->ac_f_ex.fe_group;
896 __entry->result_len = ac->ac_f_ex.fe_len;
897 ),
898
Theodore Ts'oa2690292010-10-27 22:08:50 -0400899 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
Theodore Ts'o296c3552009-09-30 00:32:42 -0400900 "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x "
901 "tail %u broken %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400902 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400903 (unsigned long) __entry->ino,
Theodore Ts'o296c3552009-09-30 00:32:42 -0400904 __entry->orig_group, __entry->orig_start,
905 __entry->orig_len, __entry->orig_logical,
906 __entry->goal_group, __entry->goal_start,
907 __entry->goal_len, __entry->goal_logical,
908 __entry->result_group, __entry->result_start,
909 __entry->result_len, __entry->result_logical,
910 __entry->found, __entry->groups, __entry->cr,
911 __entry->flags, __entry->tail,
912 __entry->buddy ? 1 << __entry->buddy : 0)
913);
914
915TRACE_EVENT(ext4_mballoc_prealloc,
916 TP_PROTO(struct ext4_allocation_context *ac),
917
918 TP_ARGS(ac),
919
920 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400921 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -0400922 __field( ino_t, ino )
923 __field( __u32, orig_logical )
924 __field( int, orig_start )
925 __field( __u32, orig_group )
926 __field( int, orig_len )
927 __field( __u32, result_logical )
928 __field( int, result_start )
929 __field( __u32, result_group )
930 __field( int, result_len )
931 ),
932
933 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400934 __entry->dev = ac->ac_inode->i_sb->s_dev;
Theodore Ts'o296c3552009-09-30 00:32:42 -0400935 __entry->ino = ac->ac_inode->i_ino;
936 __entry->orig_logical = ac->ac_o_ex.fe_logical;
937 __entry->orig_start = ac->ac_o_ex.fe_start;
938 __entry->orig_group = ac->ac_o_ex.fe_group;
939 __entry->orig_len = ac->ac_o_ex.fe_len;
940 __entry->result_logical = ac->ac_b_ex.fe_logical;
941 __entry->result_start = ac->ac_b_ex.fe_start;
942 __entry->result_group = ac->ac_b_ex.fe_group;
943 __entry->result_len = ac->ac_b_ex.fe_len;
944 ),
945
Theodore Ts'oa2690292010-10-27 22:08:50 -0400946 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400947 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400948 (unsigned long) __entry->ino,
Theodore Ts'o296c3552009-09-30 00:32:42 -0400949 __entry->orig_group, __entry->orig_start,
950 __entry->orig_len, __entry->orig_logical,
951 __entry->result_group, __entry->result_start,
952 __entry->result_len, __entry->result_logical)
953);
954
Li Zefanf084db92010-05-17 04:00:00 -0400955DECLARE_EVENT_CLASS(ext4__mballoc,
Eric Sandeen3e1e5f52010-10-27 21:30:07 -0400956 TP_PROTO(struct super_block *sb,
957 struct inode *inode,
958 ext4_group_t group,
959 ext4_grpblk_t start,
960 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -0400961
Eric Sandeen3e1e5f52010-10-27 21:30:07 -0400962 TP_ARGS(sb, inode, group, start, len),
Theodore Ts'o296c3552009-09-30 00:32:42 -0400963
964 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400965 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -0400966 __field( ino_t, ino )
Theodore Ts'o296c3552009-09-30 00:32:42 -0400967 __field( int, result_start )
968 __field( __u32, result_group )
969 __field( int, result_len )
970 ),
971
972 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400973 __entry->dev = sb->s_dev;
Eric Sandeen3e1e5f52010-10-27 21:30:07 -0400974 __entry->ino = inode ? inode->i_ino : 0;
975 __entry->result_start = start;
976 __entry->result_group = group;
977 __entry->result_len = len;
Theodore Ts'o296c3552009-09-30 00:32:42 -0400978 ),
979
Lukas Czernera9c667f2011-06-06 09:51:52 -0400980 TP_printk("dev %d,%d inode %lu extent %u/%d/%d ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400981 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400982 (unsigned long) __entry->ino,
Theodore Ts'o296c3552009-09-30 00:32:42 -0400983 __entry->result_group, __entry->result_start,
Eric Sandeen3e1e5f52010-10-27 21:30:07 -0400984 __entry->result_len)
Theodore Ts'o296c3552009-09-30 00:32:42 -0400985);
986
Li Zefanf084db92010-05-17 04:00:00 -0400987DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard,
988
Eric Sandeen3e1e5f52010-10-27 21:30:07 -0400989 TP_PROTO(struct super_block *sb,
990 struct inode *inode,
991 ext4_group_t group,
992 ext4_grpblk_t start,
993 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -0400994
Eric Sandeen3e1e5f52010-10-27 21:30:07 -0400995 TP_ARGS(sb, inode, group, start, len)
Li Zefanf084db92010-05-17 04:00:00 -0400996);
Theodore Ts'o296c3552009-09-30 00:32:42 -0400997
Li Zefanf084db92010-05-17 04:00:00 -0400998DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free,
Theodore Ts'o296c3552009-09-30 00:32:42 -0400999
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001000 TP_PROTO(struct super_block *sb,
1001 struct inode *inode,
1002 ext4_group_t group,
1003 ext4_grpblk_t start,
1004 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001005
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001006 TP_ARGS(sb, inode, group, start, len)
Theodore Ts'o296c3552009-09-30 00:32:42 -04001007);
1008
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001009TRACE_EVENT(ext4_forget,
1010 TP_PROTO(struct inode *inode, int is_metadata, __u64 block),
1011
1012 TP_ARGS(inode, is_metadata, block),
1013
1014 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001015 __field( dev_t, dev )
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001016 __field( ino_t, ino )
Theodore Ts'o59be8e72011-07-30 12:38:46 -04001017 __field( __u16, mode )
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001018 __field( int, is_metadata )
1019 __field( __u64, block )
1020 ),
1021
1022 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001023 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001024 __entry->ino = inode->i_ino;
1025 __entry->mode = inode->i_mode;
1026 __entry->is_metadata = is_metadata;
1027 __entry->block = block;
1028 ),
1029
Theodore Ts'oa2690292010-10-27 22:08:50 -04001030 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001031 MAJOR(__entry->dev), MINOR(__entry->dev),
1032 (unsigned long) __entry->ino,
1033 __entry->mode, __entry->is_metadata, __entry->block)
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001034);
1035
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001036TRACE_EVENT(ext4_da_update_reserve_space,
1037 TP_PROTO(struct inode *inode, int used_blocks),
1038
1039 TP_ARGS(inode, used_blocks),
1040
1041 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001042 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001043 __field( ino_t, ino )
Theodore Ts'o59be8e72011-07-30 12:38:46 -04001044 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001045 __field( __u64, i_blocks )
1046 __field( int, used_blocks )
1047 __field( int, reserved_data_blocks )
1048 __field( int, reserved_meta_blocks )
1049 __field( int, allocated_meta_blocks )
1050 ),
1051
1052 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001053 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001054 __entry->ino = inode->i_ino;
1055 __entry->mode = inode->i_mode;
1056 __entry->i_blocks = inode->i_blocks;
1057 __entry->used_blocks = used_blocks;
1058 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1059 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
1060 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
1061 ),
1062
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001063 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
1064 "reserved_data_blocks %d reserved_meta_blocks %d "
1065 "allocated_meta_blocks %d",
1066 MAJOR(__entry->dev), MINOR(__entry->dev),
1067 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001068 __entry->mode, __entry->i_blocks,
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001069 __entry->used_blocks, __entry->reserved_data_blocks,
1070 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
1071);
1072
1073TRACE_EVENT(ext4_da_reserve_space,
1074 TP_PROTO(struct inode *inode, int md_needed),
1075
1076 TP_ARGS(inode, md_needed),
1077
1078 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001079 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001080 __field( ino_t, ino )
Theodore Ts'o59be8e72011-07-30 12:38:46 -04001081 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001082 __field( __u64, i_blocks )
1083 __field( int, md_needed )
1084 __field( int, reserved_data_blocks )
1085 __field( int, reserved_meta_blocks )
1086 ),
1087
1088 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001089 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001090 __entry->ino = inode->i_ino;
1091 __entry->mode = inode->i_mode;
1092 __entry->i_blocks = inode->i_blocks;
1093 __entry->md_needed = md_needed;
1094 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1095 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
1096 ),
1097
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001098 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu md_needed %d "
1099 "reserved_data_blocks %d reserved_meta_blocks %d",
1100 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001101 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001102 __entry->mode, __entry->i_blocks,
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001103 __entry->md_needed, __entry->reserved_data_blocks,
1104 __entry->reserved_meta_blocks)
1105);
1106
1107TRACE_EVENT(ext4_da_release_space,
1108 TP_PROTO(struct inode *inode, int freed_blocks),
1109
1110 TP_ARGS(inode, freed_blocks),
1111
1112 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001113 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001114 __field( ino_t, ino )
Theodore Ts'o59be8e72011-07-30 12:38:46 -04001115 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001116 __field( __u64, i_blocks )
1117 __field( int, freed_blocks )
1118 __field( int, reserved_data_blocks )
1119 __field( int, reserved_meta_blocks )
1120 __field( int, allocated_meta_blocks )
1121 ),
1122
1123 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001124 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001125 __entry->ino = inode->i_ino;
1126 __entry->mode = inode->i_mode;
1127 __entry->i_blocks = inode->i_blocks;
1128 __entry->freed_blocks = freed_blocks;
1129 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1130 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
1131 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
1132 ),
1133
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001134 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
1135 "reserved_data_blocks %d reserved_meta_blocks %d "
1136 "allocated_meta_blocks %d",
1137 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001138 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001139 __entry->mode, __entry->i_blocks,
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001140 __entry->freed_blocks, __entry->reserved_data_blocks,
1141 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
1142);
1143
Theodore Ts'of3073332010-05-17 03:00:00 -04001144DECLARE_EVENT_CLASS(ext4__bitmap_load,
1145 TP_PROTO(struct super_block *sb, unsigned long group),
1146
1147 TP_ARGS(sb, group),
1148
1149 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001150 __field( dev_t, dev )
Theodore Ts'of3073332010-05-17 03:00:00 -04001151 __field( __u32, group )
1152
1153 ),
1154
1155 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001156 __entry->dev = sb->s_dev;
Theodore Ts'of3073332010-05-17 03:00:00 -04001157 __entry->group = group;
1158 ),
1159
Theodore Ts'oa2690292010-10-27 22:08:50 -04001160 TP_printk("dev %d,%d group %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001161 MAJOR(__entry->dev), MINOR(__entry->dev),
1162 __entry->group)
Theodore Ts'of3073332010-05-17 03:00:00 -04001163);
1164
1165DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
1166
1167 TP_PROTO(struct super_block *sb, unsigned long group),
1168
1169 TP_ARGS(sb, group)
1170);
1171
1172DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
1173
1174 TP_PROTO(struct super_block *sb, unsigned long group),
1175
1176 TP_ARGS(sb, group)
1177);
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001178
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001179DEFINE_EVENT(ext4__bitmap_load, ext4_read_block_bitmap_load,
1180
1181 TP_PROTO(struct super_block *sb, unsigned long group),
1182
1183 TP_ARGS(sb, group)
1184);
1185
1186DEFINE_EVENT(ext4__bitmap_load, ext4_load_inode_bitmap,
1187
1188 TP_PROTO(struct super_block *sb, unsigned long group),
1189
1190 TP_ARGS(sb, group)
1191);
1192
1193TRACE_EVENT(ext4_direct_IO_enter,
1194 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
1195
1196 TP_ARGS(inode, offset, len, rw),
1197
1198 TP_STRUCT__entry(
1199 __field( ino_t, ino )
1200 __field( dev_t, dev )
1201 __field( loff_t, pos )
1202 __field( unsigned long, len )
1203 __field( int, rw )
1204 ),
1205
1206 TP_fast_assign(
1207 __entry->ino = inode->i_ino;
1208 __entry->dev = inode->i_sb->s_dev;
1209 __entry->pos = offset;
1210 __entry->len = len;
1211 __entry->rw = rw;
1212 ),
1213
Lukas Czernera9c667f2011-06-06 09:51:52 -04001214 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001215 MAJOR(__entry->dev), MINOR(__entry->dev),
1216 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001217 __entry->pos, __entry->len, __entry->rw)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001218);
1219
1220TRACE_EVENT(ext4_direct_IO_exit,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001221 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
1222 int rw, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001223
1224 TP_ARGS(inode, offset, len, rw, ret),
1225
1226 TP_STRUCT__entry(
1227 __field( ino_t, ino )
1228 __field( dev_t, dev )
1229 __field( loff_t, pos )
1230 __field( unsigned long, len )
1231 __field( int, rw )
1232 __field( int, ret )
1233 ),
1234
1235 TP_fast_assign(
1236 __entry->ino = inode->i_ino;
1237 __entry->dev = inode->i_sb->s_dev;
1238 __entry->pos = offset;
1239 __entry->len = len;
1240 __entry->rw = rw;
1241 __entry->ret = ret;
1242 ),
1243
Lukas Czernera9c667f2011-06-06 09:51:52 -04001244 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001245 MAJOR(__entry->dev), MINOR(__entry->dev),
1246 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001247 __entry->pos, __entry->len,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001248 __entry->rw, __entry->ret)
1249);
1250
1251TRACE_EVENT(ext4_fallocate_enter,
1252 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1253
1254 TP_ARGS(inode, offset, len, mode),
1255
1256 TP_STRUCT__entry(
1257 __field( ino_t, ino )
1258 __field( dev_t, dev )
1259 __field( loff_t, pos )
1260 __field( loff_t, len )
1261 __field( int, mode )
1262 ),
1263
1264 TP_fast_assign(
1265 __entry->ino = inode->i_ino;
1266 __entry->dev = inode->i_sb->s_dev;
1267 __entry->pos = offset;
1268 __entry->len = len;
1269 __entry->mode = mode;
1270 ),
1271
Lukas Czernera9c667f2011-06-06 09:51:52 -04001272 TP_printk("dev %d,%d ino %lu pos %lld len %lld mode %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001273 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -04001274 (unsigned long) __entry->ino, __entry->pos,
1275 __entry->len, __entry->mode)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001276);
1277
1278TRACE_EVENT(ext4_fallocate_exit,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001279 TP_PROTO(struct inode *inode, loff_t offset,
1280 unsigned int max_blocks, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001281
1282 TP_ARGS(inode, offset, max_blocks, ret),
1283
1284 TP_STRUCT__entry(
1285 __field( ino_t, ino )
1286 __field( dev_t, dev )
1287 __field( loff_t, pos )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001288 __field( unsigned int, blocks )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001289 __field( int, ret )
1290 ),
1291
1292 TP_fast_assign(
1293 __entry->ino = inode->i_ino;
1294 __entry->dev = inode->i_sb->s_dev;
1295 __entry->pos = offset;
1296 __entry->blocks = max_blocks;
1297 __entry->ret = ret;
1298 ),
1299
Lukas Czernera9c667f2011-06-06 09:51:52 -04001300 TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001301 MAJOR(__entry->dev), MINOR(__entry->dev),
1302 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001303 __entry->pos, __entry->blocks,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001304 __entry->ret)
1305);
1306
1307TRACE_EVENT(ext4_unlink_enter,
1308 TP_PROTO(struct inode *parent, struct dentry *dentry),
1309
1310 TP_ARGS(parent, dentry),
1311
1312 TP_STRUCT__entry(
1313 __field( ino_t, parent )
1314 __field( ino_t, ino )
1315 __field( loff_t, size )
1316 __field( dev_t, dev )
1317 ),
1318
1319 TP_fast_assign(
1320 __entry->parent = parent->i_ino;
1321 __entry->ino = dentry->d_inode->i_ino;
1322 __entry->size = dentry->d_inode->i_size;
1323 __entry->dev = dentry->d_inode->i_sb->s_dev;
1324 ),
1325
Lukas Czernera9c667f2011-06-06 09:51:52 -04001326 TP_printk("dev %d,%d ino %lu size %lld parent %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001327 MAJOR(__entry->dev), MINOR(__entry->dev),
1328 (unsigned long) __entry->ino, __entry->size,
1329 (unsigned long) __entry->parent)
1330);
1331
1332TRACE_EVENT(ext4_unlink_exit,
1333 TP_PROTO(struct dentry *dentry, int ret),
1334
1335 TP_ARGS(dentry, ret),
1336
1337 TP_STRUCT__entry(
1338 __field( ino_t, ino )
1339 __field( dev_t, dev )
1340 __field( int, ret )
1341 ),
1342
1343 TP_fast_assign(
1344 __entry->ino = dentry->d_inode->i_ino;
1345 __entry->dev = dentry->d_inode->i_sb->s_dev;
1346 __entry->ret = ret;
1347 ),
1348
Lukas Czernera9c667f2011-06-06 09:51:52 -04001349 TP_printk("dev %d,%d ino %lu ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001350 MAJOR(__entry->dev), MINOR(__entry->dev),
1351 (unsigned long) __entry->ino,
1352 __entry->ret)
1353);
1354
1355DECLARE_EVENT_CLASS(ext4__truncate,
1356 TP_PROTO(struct inode *inode),
1357
1358 TP_ARGS(inode),
1359
1360 TP_STRUCT__entry(
1361 __field( ino_t, ino )
1362 __field( dev_t, dev )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001363 __field( __u64, blocks )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001364 ),
1365
1366 TP_fast_assign(
1367 __entry->ino = inode->i_ino;
1368 __entry->dev = inode->i_sb->s_dev;
1369 __entry->blocks = inode->i_blocks;
1370 ),
1371
Lukas Czernera9c667f2011-06-06 09:51:52 -04001372 TP_printk("dev %d,%d ino %lu blocks %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001373 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -04001374 (unsigned long) __entry->ino, __entry->blocks)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001375);
1376
1377DEFINE_EVENT(ext4__truncate, ext4_truncate_enter,
1378
1379 TP_PROTO(struct inode *inode),
1380
1381 TP_ARGS(inode)
1382);
1383
1384DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
1385
1386 TP_PROTO(struct inode *inode),
1387
1388 TP_ARGS(inode)
1389);
1390
1391DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1392 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001393 unsigned int len, unsigned int flags),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001394
1395 TP_ARGS(inode, lblk, len, flags),
1396
1397 TP_STRUCT__entry(
1398 __field( ino_t, ino )
1399 __field( dev_t, dev )
1400 __field( ext4_lblk_t, lblk )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001401 __field( unsigned int, len )
1402 __field( unsigned int, flags )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001403 ),
1404
1405 TP_fast_assign(
1406 __entry->ino = inode->i_ino;
1407 __entry->dev = inode->i_sb->s_dev;
1408 __entry->lblk = lblk;
1409 __entry->len = len;
1410 __entry->flags = flags;
1411 ),
1412
1413 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %u",
1414 MAJOR(__entry->dev), MINOR(__entry->dev),
1415 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001416 __entry->lblk, __entry->len, __entry->flags)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001417);
1418
1419DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter,
1420 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1421 unsigned len, unsigned flags),
1422
1423 TP_ARGS(inode, lblk, len, flags)
1424);
1425
1426DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter,
1427 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1428 unsigned len, unsigned flags),
1429
1430 TP_ARGS(inode, lblk, len, flags)
1431);
1432
1433DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
1434 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001435 ext4_fsblk_t pblk, unsigned int len, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001436
1437 TP_ARGS(inode, lblk, pblk, len, ret),
1438
1439 TP_STRUCT__entry(
1440 __field( ino_t, ino )
1441 __field( dev_t, dev )
1442 __field( ext4_lblk_t, lblk )
1443 __field( ext4_fsblk_t, pblk )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001444 __field( unsigned int, len )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001445 __field( int, ret )
1446 ),
1447
1448 TP_fast_assign(
1449 __entry->ino = inode->i_ino;
1450 __entry->dev = inode->i_sb->s_dev;
1451 __entry->lblk = lblk;
1452 __entry->pblk = pblk;
1453 __entry->len = len;
1454 __entry->ret = ret;
1455 ),
1456
1457 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u ret %d",
1458 MAJOR(__entry->dev), MINOR(__entry->dev),
1459 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001460 __entry->lblk, __entry->pblk,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001461 __entry->len, __entry->ret)
1462);
1463
1464DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit,
1465 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1466 ext4_fsblk_t pblk, unsigned len, int ret),
1467
1468 TP_ARGS(inode, lblk, pblk, len, ret)
1469);
1470
1471DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit,
1472 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1473 ext4_fsblk_t pblk, unsigned len, int ret),
1474
1475 TP_ARGS(inode, lblk, pblk, len, ret)
1476);
1477
1478TRACE_EVENT(ext4_ext_load_extent,
1479 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk),
1480
1481 TP_ARGS(inode, lblk, pblk),
1482
1483 TP_STRUCT__entry(
1484 __field( ino_t, ino )
1485 __field( dev_t, dev )
1486 __field( ext4_lblk_t, lblk )
1487 __field( ext4_fsblk_t, pblk )
1488 ),
1489
1490 TP_fast_assign(
1491 __entry->ino = inode->i_ino;
1492 __entry->dev = inode->i_sb->s_dev;
1493 __entry->lblk = lblk;
1494 __entry->pblk = pblk;
1495 ),
1496
1497 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1498 MAJOR(__entry->dev), MINOR(__entry->dev),
1499 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001500 __entry->lblk, __entry->pblk)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001501);
1502
1503TRACE_EVENT(ext4_load_inode,
1504 TP_PROTO(struct inode *inode),
1505
1506 TP_ARGS(inode),
1507
1508 TP_STRUCT__entry(
1509 __field( ino_t, ino )
1510 __field( dev_t, dev )
1511 ),
1512
1513 TP_fast_assign(
1514 __entry->ino = inode->i_ino;
1515 __entry->dev = inode->i_sb->s_dev;
1516 ),
1517
1518 TP_printk("dev %d,%d ino %ld",
1519 MAJOR(__entry->dev), MINOR(__entry->dev),
1520 (unsigned long) __entry->ino)
1521);
1522
Theodore Ts'o12706392011-07-10 22:37:50 -04001523TRACE_EVENT(ext4_journal_start,
1524 TP_PROTO(struct super_block *sb, int nblocks, unsigned long IP),
1525
1526 TP_ARGS(sb, nblocks, IP),
1527
1528 TP_STRUCT__entry(
1529 __field( dev_t, dev )
1530 __field( int, nblocks )
1531 __field(unsigned long, ip )
1532 ),
1533
1534 TP_fast_assign(
1535 __entry->dev = sb->s_dev;
1536 __entry->nblocks = nblocks;
1537 __entry->ip = IP;
1538 ),
1539
1540 TP_printk("dev %d,%d nblocks %d caller %pF",
1541 MAJOR(__entry->dev), MINOR(__entry->dev),
1542 __entry->nblocks, (void *)__entry->ip)
1543);
1544
Tao Mab3d4c2b2011-07-11 00:01:52 -04001545DECLARE_EVENT_CLASS(ext4__trim,
1546 TP_PROTO(struct super_block *sb,
1547 ext4_group_t group,
1548 ext4_grpblk_t start,
1549 ext4_grpblk_t len),
1550
1551 TP_ARGS(sb, group, start, len),
1552
1553 TP_STRUCT__entry(
1554 __field( int, dev_major )
1555 __field( int, dev_minor )
1556 __field( __u32, group )
1557 __field( int, start )
1558 __field( int, len )
1559 ),
1560
1561 TP_fast_assign(
1562 __entry->dev_major = MAJOR(sb->s_dev);
1563 __entry->dev_minor = MINOR(sb->s_dev);
1564 __entry->group = group;
1565 __entry->start = start;
1566 __entry->len = len;
1567 ),
1568
1569 TP_printk("dev %d,%d group %u, start %d, len %d",
1570 __entry->dev_major, __entry->dev_minor,
1571 __entry->group, __entry->start, __entry->len)
1572);
1573
1574DEFINE_EVENT(ext4__trim, ext4_trim_extent,
1575
1576 TP_PROTO(struct super_block *sb,
1577 ext4_group_t group,
1578 ext4_grpblk_t start,
1579 ext4_grpblk_t len),
1580
1581 TP_ARGS(sb, group, start, len)
1582);
1583
1584DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
1585
1586 TP_PROTO(struct super_block *sb,
1587 ext4_group_t group,
1588 ext4_grpblk_t start,
1589 ext4_grpblk_t len),
1590
1591 TP_ARGS(sb, group, start, len)
1592);
1593
Theodore Ts'o9bffad12009-06-17 11:48:11 -04001594#endif /* _TRACE_EXT4_H */
1595
1596/* This part must be outside protection */
1597#include <trace/define_trace.h>