blob: c9a341e385a38779b3621e36e37bd1f19ec1ea71 [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;
Aditya Kalid8990242011-09-09 19:18:51 -040015struct ext4_map_blocks;
16struct ext4_extent;
Theodore Ts'ofb40ba02009-09-16 19:30:40 -040017
18#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
Theodore Ts'o3661d282009-09-14 22:59:50 -040019
Theodore Ts'o9bffad12009-06-17 11:48:11 -040020TRACE_EVENT(ext4_free_inode,
21 TP_PROTO(struct inode *inode),
22
23 TP_ARGS(inode),
24
25 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040026 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040027 __field( ino_t, ino )
Theodore Ts'o59be8e72011-07-30 12:38:46 -040028 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040029 __field( uid_t, uid )
30 __field( gid_t, gid )
Lukas Czernera9c667f2011-06-06 09:51:52 -040031 __field( __u64, blocks )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040032 ),
33
34 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040035 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -040036 __entry->ino = inode->i_ino;
37 __entry->mode = inode->i_mode;
38 __entry->uid = inode->i_uid;
39 __entry->gid = inode->i_gid;
40 __entry->blocks = inode->i_blocks;
41 ),
42
Theodore Ts'oa2690292010-10-27 22:08:50 -040043 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040044 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -040045 (unsigned long) __entry->ino, __entry->mode,
46 __entry->uid, __entry->gid, __entry->blocks)
Theodore Ts'o9bffad12009-06-17 11:48:11 -040047);
48
49TRACE_EVENT(ext4_request_inode,
50 TP_PROTO(struct inode *dir, int mode),
51
52 TP_ARGS(dir, mode),
53
54 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040055 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040056 __field( ino_t, dir )
Theodore Ts'o59be8e72011-07-30 12:38:46 -040057 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040058 ),
59
60 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040061 __entry->dev = dir->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -040062 __entry->dir = dir->i_ino;
63 __entry->mode = mode;
64 ),
65
Theodore Ts'oa2690292010-10-27 22:08:50 -040066 TP_printk("dev %d,%d dir %lu mode 0%o",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040067 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -040068 (unsigned long) __entry->dir, __entry->mode)
Theodore Ts'o9bffad12009-06-17 11:48:11 -040069);
70
71TRACE_EVENT(ext4_allocate_inode,
72 TP_PROTO(struct inode *inode, struct inode *dir, int mode),
73
74 TP_ARGS(inode, dir, mode),
75
76 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040077 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040078 __field( ino_t, ino )
79 __field( ino_t, dir )
Theodore Ts'o59be8e72011-07-30 12:38:46 -040080 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040081 ),
82
83 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040084 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -040085 __entry->ino = inode->i_ino;
86 __entry->dir = dir->i_ino;
87 __entry->mode = mode;
88 ),
89
Theodore Ts'oa2690292010-10-27 22:08:50 -040090 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040091 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -040092 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -040093 (unsigned long) __entry->dir, __entry->mode)
Theodore Ts'o9bffad12009-06-17 11:48:11 -040094);
95
Theodore Ts'o7ff9c072010-11-08 13:51:33 -050096TRACE_EVENT(ext4_evict_inode,
97 TP_PROTO(struct inode *inode),
98
99 TP_ARGS(inode),
100
101 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400102 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500103 __field( ino_t, ino )
104 __field( int, nlink )
105 ),
106
107 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400108 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500109 __entry->ino = inode->i_ino;
110 __entry->nlink = inode->i_nlink;
111 ),
112
113 TP_printk("dev %d,%d ino %lu nlink %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400114 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500115 (unsigned long) __entry->ino, __entry->nlink)
116);
117
118TRACE_EVENT(ext4_drop_inode,
119 TP_PROTO(struct inode *inode, int drop),
120
121 TP_ARGS(inode, drop),
122
123 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400124 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500125 __field( ino_t, ino )
126 __field( int, drop )
127 ),
128
129 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400130 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500131 __entry->ino = inode->i_ino;
132 __entry->drop = drop;
133 ),
134
135 TP_printk("dev %d,%d ino %lu drop %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400136 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500137 (unsigned long) __entry->ino, __entry->drop)
138);
139
140TRACE_EVENT(ext4_mark_inode_dirty,
141 TP_PROTO(struct inode *inode, unsigned long IP),
142
143 TP_ARGS(inode, IP),
144
145 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400146 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500147 __field( ino_t, ino )
148 __field(unsigned long, ip )
149 ),
150
151 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400152 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500153 __entry->ino = inode->i_ino;
154 __entry->ip = IP;
155 ),
156
157 TP_printk("dev %d,%d ino %lu caller %pF",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400158 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500159 (unsigned long) __entry->ino, (void *)__entry->ip)
160);
161
162TRACE_EVENT(ext4_begin_ordered_truncate,
163 TP_PROTO(struct inode *inode, loff_t new_size),
164
165 TP_ARGS(inode, new_size),
166
167 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400168 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500169 __field( ino_t, ino )
170 __field( loff_t, new_size )
171 ),
172
173 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400174 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500175 __entry->ino = inode->i_ino;
176 __entry->new_size = new_size;
177 ),
178
179 TP_printk("dev %d,%d ino %lu new_size %lld",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400180 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500181 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400182 __entry->new_size)
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500183);
184
Li Zefanb5eb34c2009-11-26 15:07:36 +0800185DECLARE_EVENT_CLASS(ext4__write_begin,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400186
187 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
188 unsigned int flags),
189
190 TP_ARGS(inode, pos, len, flags),
191
192 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400193 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400194 __field( ino_t, ino )
195 __field( loff_t, pos )
196 __field( unsigned int, len )
197 __field( unsigned int, flags )
198 ),
199
200 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400201 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400202 __entry->ino = inode->i_ino;
203 __entry->pos = pos;
204 __entry->len = len;
205 __entry->flags = flags;
206 ),
207
Lukas Czernera9c667f2011-06-06 09:51:52 -0400208 TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400209 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400210 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400211 __entry->pos, __entry->len, __entry->flags)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400212);
213
Li Zefanb5eb34c2009-11-26 15:07:36 +0800214DEFINE_EVENT(ext4__write_begin, ext4_write_begin,
215
216 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
217 unsigned int flags),
218
219 TP_ARGS(inode, pos, len, flags)
220);
221
222DEFINE_EVENT(ext4__write_begin, ext4_da_write_begin,
223
224 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
225 unsigned int flags),
226
227 TP_ARGS(inode, pos, len, flags)
228);
229
230DECLARE_EVENT_CLASS(ext4__write_end,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400231 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
232 unsigned int copied),
233
234 TP_ARGS(inode, pos, len, copied),
235
236 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400237 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400238 __field( ino_t, ino )
239 __field( loff_t, pos )
240 __field( unsigned int, len )
241 __field( unsigned int, copied )
242 ),
243
244 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400245 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400246 __entry->ino = inode->i_ino;
247 __entry->pos = pos;
248 __entry->len = len;
249 __entry->copied = copied;
250 ),
251
Lukas Czernera9c667f2011-06-06 09:51:52 -0400252 TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400253 MAJOR(__entry->dev), MINOR(__entry->dev),
254 (unsigned long) __entry->ino,
255 __entry->pos, __entry->len, __entry->copied)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400256);
257
Li Zefanb5eb34c2009-11-26 15:07:36 +0800258DEFINE_EVENT(ext4__write_end, ext4_ordered_write_end,
259
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400260 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
261 unsigned int copied),
262
Li Zefanb5eb34c2009-11-26 15:07:36 +0800263 TP_ARGS(inode, pos, len, copied)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400264);
265
Li Zefanb5eb34c2009-11-26 15:07:36 +0800266DEFINE_EVENT(ext4__write_end, ext4_writeback_write_end,
267
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400268 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
269 unsigned int copied),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400270
Li Zefanb5eb34c2009-11-26 15:07:36 +0800271 TP_ARGS(inode, pos, len, copied)
272);
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400273
Li Zefanb5eb34c2009-11-26 15:07:36 +0800274DEFINE_EVENT(ext4__write_end, ext4_journalled_write_end,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400275
Li Zefanb5eb34c2009-11-26 15:07:36 +0800276 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
277 unsigned int copied),
278
279 TP_ARGS(inode, pos, len, copied)
280);
281
282DEFINE_EVENT(ext4__write_end, ext4_da_write_end,
283
284 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
285 unsigned int copied),
286
287 TP_ARGS(inode, pos, len, copied)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400288);
289
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400290TRACE_EVENT(ext4_da_writepages,
291 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
292
293 TP_ARGS(inode, wbc),
294
295 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400296 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400297 __field( ino_t, ino )
298 __field( long, nr_to_write )
299 __field( long, pages_skipped )
300 __field( loff_t, range_start )
301 __field( loff_t, range_end )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400302 __field( int, sync_mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400303 __field( char, for_kupdate )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400304 __field( char, range_cyclic )
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400305 __field( pgoff_t, writeback_index )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400306 ),
307
308 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400309 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400310 __entry->ino = inode->i_ino;
311 __entry->nr_to_write = wbc->nr_to_write;
312 __entry->pages_skipped = wbc->pages_skipped;
313 __entry->range_start = wbc->range_start;
314 __entry->range_end = wbc->range_end;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400315 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400316 __entry->for_kupdate = wbc->for_kupdate;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400317 __entry->range_cyclic = wbc->range_cyclic;
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400318 __entry->writeback_index = inode->i_mapping->writeback_index;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400319 ),
320
Theodore Ts'oa107e5a2010-10-27 23:44:47 -0400321 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
Lukas Czernera9c667f2011-06-06 09:51:52 -0400322 "range_start %lld range_end %lld sync_mode %d"
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400323 "for_kupdate %d range_cyclic %d writeback_index %lu",
324 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400325 (unsigned long) __entry->ino, __entry->nr_to_write,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400326 __entry->pages_skipped, __entry->range_start,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400327 __entry->range_end, __entry->sync_mode,
328 __entry->for_kupdate, __entry->range_cyclic,
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400329 (unsigned long) __entry->writeback_index)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400330);
331
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400332TRACE_EVENT(ext4_da_write_pages,
333 TP_PROTO(struct inode *inode, struct mpage_da_data *mpd),
334
335 TP_ARGS(inode, mpd),
336
337 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400338 __field( dev_t, dev )
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400339 __field( ino_t, ino )
340 __field( __u64, b_blocknr )
341 __field( __u32, b_size )
342 __field( __u32, b_state )
343 __field( unsigned long, first_page )
344 __field( int, io_done )
345 __field( int, pages_written )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400346 __field( int, sync_mode )
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400347 ),
348
349 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400350 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400351 __entry->ino = inode->i_ino;
352 __entry->b_blocknr = mpd->b_blocknr;
353 __entry->b_size = mpd->b_size;
354 __entry->b_state = mpd->b_state;
355 __entry->first_page = mpd->first_page;
356 __entry->io_done = mpd->io_done;
357 __entry->pages_written = mpd->pages_written;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400358 __entry->sync_mode = mpd->wbc->sync_mode;
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400359 ),
360
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400361 TP_printk("dev %d,%d ino %lu b_blocknr %llu b_size %u b_state 0x%04x "
362 "first_page %lu io_done %d pages_written %d sync_mode %d",
363 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400364 (unsigned long) __entry->ino,
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400365 __entry->b_blocknr, __entry->b_size,
366 __entry->b_state, __entry->first_page,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400367 __entry->io_done, __entry->pages_written,
368 __entry->sync_mode
369 )
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400370);
371
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400372TRACE_EVENT(ext4_da_writepages_result,
373 TP_PROTO(struct inode *inode, struct writeback_control *wbc,
374 int ret, int pages_written),
375
376 TP_ARGS(inode, wbc, ret, pages_written),
377
378 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400379 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400380 __field( ino_t, ino )
381 __field( int, ret )
382 __field( int, pages_written )
383 __field( long, pages_skipped )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400384 __field( int, sync_mode )
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400385 __field( pgoff_t, writeback_index )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400386 ),
387
388 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400389 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400390 __entry->ino = inode->i_ino;
391 __entry->ret = ret;
392 __entry->pages_written = pages_written;
393 __entry->pages_skipped = wbc->pages_skipped;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400394 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'o55138e0b2009-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 "
Wu Fengguangb7a24412010-07-21 22:19:51 -0600399 "sync_mode %d writeback_index %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400400 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,
Wu Fengguangb7a24412010-07-21 22:19:51 -0600403 __entry->sync_mode,
Theodore Ts'o55138e0b2009-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,
Aditya Kalid8990242011-09-09 19:18:51 -04001037 TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001038
Aditya Kalid8990242011-09-09 19:18:51 -04001039 TP_ARGS(inode, used_blocks, quota_claim),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001040
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 )
Aditya Kalid8990242011-09-09 19:18:51 -04001050 __field( int, quota_claim )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001051 ),
1052
1053 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001054 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001055 __entry->ino = inode->i_ino;
1056 __entry->mode = inode->i_mode;
1057 __entry->i_blocks = inode->i_blocks;
1058 __entry->used_blocks = used_blocks;
Aditya Kalid8990242011-09-09 19:18:51 -04001059 __entry->reserved_data_blocks =
1060 EXT4_I(inode)->i_reserved_data_blocks;
1061 __entry->reserved_meta_blocks =
1062 EXT4_I(inode)->i_reserved_meta_blocks;
1063 __entry->allocated_meta_blocks =
1064 EXT4_I(inode)->i_allocated_meta_blocks;
1065 __entry->quota_claim = quota_claim;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001066 ),
1067
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001068 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
1069 "reserved_data_blocks %d reserved_meta_blocks %d "
Aditya Kalid8990242011-09-09 19:18:51 -04001070 "allocated_meta_blocks %d quota_claim %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001071 MAJOR(__entry->dev), MINOR(__entry->dev),
1072 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001073 __entry->mode, __entry->i_blocks,
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001074 __entry->used_blocks, __entry->reserved_data_blocks,
Aditya Kalid8990242011-09-09 19:18:51 -04001075 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks,
1076 __entry->quota_claim)
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001077);
1078
1079TRACE_EVENT(ext4_da_reserve_space,
1080 TP_PROTO(struct inode *inode, int md_needed),
1081
1082 TP_ARGS(inode, md_needed),
1083
1084 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001085 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001086 __field( ino_t, ino )
Theodore Ts'o59be8e72011-07-30 12:38:46 -04001087 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001088 __field( __u64, i_blocks )
1089 __field( int, md_needed )
1090 __field( int, reserved_data_blocks )
1091 __field( int, reserved_meta_blocks )
1092 ),
1093
1094 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001095 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001096 __entry->ino = inode->i_ino;
1097 __entry->mode = inode->i_mode;
1098 __entry->i_blocks = inode->i_blocks;
1099 __entry->md_needed = md_needed;
1100 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1101 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
1102 ),
1103
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001104 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu md_needed %d "
1105 "reserved_data_blocks %d reserved_meta_blocks %d",
1106 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001107 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001108 __entry->mode, __entry->i_blocks,
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001109 __entry->md_needed, __entry->reserved_data_blocks,
1110 __entry->reserved_meta_blocks)
1111);
1112
1113TRACE_EVENT(ext4_da_release_space,
1114 TP_PROTO(struct inode *inode, int freed_blocks),
1115
1116 TP_ARGS(inode, freed_blocks),
1117
1118 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001119 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001120 __field( ino_t, ino )
Theodore Ts'o59be8e72011-07-30 12:38:46 -04001121 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001122 __field( __u64, i_blocks )
1123 __field( int, freed_blocks )
1124 __field( int, reserved_data_blocks )
1125 __field( int, reserved_meta_blocks )
1126 __field( int, allocated_meta_blocks )
1127 ),
1128
1129 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001130 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001131 __entry->ino = inode->i_ino;
1132 __entry->mode = inode->i_mode;
1133 __entry->i_blocks = inode->i_blocks;
1134 __entry->freed_blocks = freed_blocks;
1135 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1136 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
1137 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
1138 ),
1139
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001140 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
1141 "reserved_data_blocks %d reserved_meta_blocks %d "
1142 "allocated_meta_blocks %d",
1143 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001144 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001145 __entry->mode, __entry->i_blocks,
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001146 __entry->freed_blocks, __entry->reserved_data_blocks,
1147 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
1148);
1149
Theodore Ts'of3073332010-05-17 03:00:00 -04001150DECLARE_EVENT_CLASS(ext4__bitmap_load,
1151 TP_PROTO(struct super_block *sb, unsigned long group),
1152
1153 TP_ARGS(sb, group),
1154
1155 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001156 __field( dev_t, dev )
Theodore Ts'of3073332010-05-17 03:00:00 -04001157 __field( __u32, group )
1158
1159 ),
1160
1161 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001162 __entry->dev = sb->s_dev;
Theodore Ts'of3073332010-05-17 03:00:00 -04001163 __entry->group = group;
1164 ),
1165
Theodore Ts'oa2690292010-10-27 22:08:50 -04001166 TP_printk("dev %d,%d group %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001167 MAJOR(__entry->dev), MINOR(__entry->dev),
1168 __entry->group)
Theodore Ts'of3073332010-05-17 03:00:00 -04001169);
1170
1171DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
1172
1173 TP_PROTO(struct super_block *sb, unsigned long group),
1174
1175 TP_ARGS(sb, group)
1176);
1177
1178DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
1179
1180 TP_PROTO(struct super_block *sb, unsigned long group),
1181
1182 TP_ARGS(sb, group)
1183);
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001184
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001185DEFINE_EVENT(ext4__bitmap_load, ext4_read_block_bitmap_load,
1186
1187 TP_PROTO(struct super_block *sb, unsigned long group),
1188
1189 TP_ARGS(sb, group)
1190);
1191
1192DEFINE_EVENT(ext4__bitmap_load, ext4_load_inode_bitmap,
1193
1194 TP_PROTO(struct super_block *sb, unsigned long group),
1195
1196 TP_ARGS(sb, group)
1197);
1198
1199TRACE_EVENT(ext4_direct_IO_enter,
1200 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
1201
1202 TP_ARGS(inode, offset, len, rw),
1203
1204 TP_STRUCT__entry(
1205 __field( ino_t, ino )
1206 __field( dev_t, dev )
1207 __field( loff_t, pos )
1208 __field( unsigned long, len )
1209 __field( int, rw )
1210 ),
1211
1212 TP_fast_assign(
1213 __entry->ino = inode->i_ino;
1214 __entry->dev = inode->i_sb->s_dev;
1215 __entry->pos = offset;
1216 __entry->len = len;
1217 __entry->rw = rw;
1218 ),
1219
Lukas Czernera9c667f2011-06-06 09:51:52 -04001220 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001221 MAJOR(__entry->dev), MINOR(__entry->dev),
1222 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001223 __entry->pos, __entry->len, __entry->rw)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001224);
1225
1226TRACE_EVENT(ext4_direct_IO_exit,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001227 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
1228 int rw, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001229
1230 TP_ARGS(inode, offset, len, rw, ret),
1231
1232 TP_STRUCT__entry(
1233 __field( ino_t, ino )
1234 __field( dev_t, dev )
1235 __field( loff_t, pos )
1236 __field( unsigned long, len )
1237 __field( int, rw )
1238 __field( int, ret )
1239 ),
1240
1241 TP_fast_assign(
1242 __entry->ino = inode->i_ino;
1243 __entry->dev = inode->i_sb->s_dev;
1244 __entry->pos = offset;
1245 __entry->len = len;
1246 __entry->rw = rw;
1247 __entry->ret = ret;
1248 ),
1249
Lukas Czernera9c667f2011-06-06 09:51:52 -04001250 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001251 MAJOR(__entry->dev), MINOR(__entry->dev),
1252 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001253 __entry->pos, __entry->len,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001254 __entry->rw, __entry->ret)
1255);
1256
1257TRACE_EVENT(ext4_fallocate_enter,
1258 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1259
1260 TP_ARGS(inode, offset, len, mode),
1261
1262 TP_STRUCT__entry(
1263 __field( ino_t, ino )
1264 __field( dev_t, dev )
1265 __field( loff_t, pos )
1266 __field( loff_t, len )
1267 __field( int, mode )
1268 ),
1269
1270 TP_fast_assign(
1271 __entry->ino = inode->i_ino;
1272 __entry->dev = inode->i_sb->s_dev;
1273 __entry->pos = offset;
1274 __entry->len = len;
1275 __entry->mode = mode;
1276 ),
1277
Lukas Czernera9c667f2011-06-06 09:51:52 -04001278 TP_printk("dev %d,%d ino %lu pos %lld len %lld mode %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001279 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -04001280 (unsigned long) __entry->ino, __entry->pos,
1281 __entry->len, __entry->mode)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001282);
1283
1284TRACE_EVENT(ext4_fallocate_exit,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001285 TP_PROTO(struct inode *inode, loff_t offset,
1286 unsigned int max_blocks, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001287
1288 TP_ARGS(inode, offset, max_blocks, ret),
1289
1290 TP_STRUCT__entry(
1291 __field( ino_t, ino )
1292 __field( dev_t, dev )
1293 __field( loff_t, pos )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001294 __field( unsigned int, blocks )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001295 __field( int, ret )
1296 ),
1297
1298 TP_fast_assign(
1299 __entry->ino = inode->i_ino;
1300 __entry->dev = inode->i_sb->s_dev;
1301 __entry->pos = offset;
1302 __entry->blocks = max_blocks;
1303 __entry->ret = ret;
1304 ),
1305
Lukas Czernera9c667f2011-06-06 09:51:52 -04001306 TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001307 MAJOR(__entry->dev), MINOR(__entry->dev),
1308 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001309 __entry->pos, __entry->blocks,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001310 __entry->ret)
1311);
1312
1313TRACE_EVENT(ext4_unlink_enter,
1314 TP_PROTO(struct inode *parent, struct dentry *dentry),
1315
1316 TP_ARGS(parent, dentry),
1317
1318 TP_STRUCT__entry(
1319 __field( ino_t, parent )
1320 __field( ino_t, ino )
1321 __field( loff_t, size )
1322 __field( dev_t, dev )
1323 ),
1324
1325 TP_fast_assign(
1326 __entry->parent = parent->i_ino;
1327 __entry->ino = dentry->d_inode->i_ino;
1328 __entry->size = dentry->d_inode->i_size;
1329 __entry->dev = dentry->d_inode->i_sb->s_dev;
1330 ),
1331
Lukas Czernera9c667f2011-06-06 09:51:52 -04001332 TP_printk("dev %d,%d ino %lu size %lld parent %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001333 MAJOR(__entry->dev), MINOR(__entry->dev),
1334 (unsigned long) __entry->ino, __entry->size,
1335 (unsigned long) __entry->parent)
1336);
1337
1338TRACE_EVENT(ext4_unlink_exit,
1339 TP_PROTO(struct dentry *dentry, int ret),
1340
1341 TP_ARGS(dentry, ret),
1342
1343 TP_STRUCT__entry(
1344 __field( ino_t, ino )
1345 __field( dev_t, dev )
1346 __field( int, ret )
1347 ),
1348
1349 TP_fast_assign(
1350 __entry->ino = dentry->d_inode->i_ino;
1351 __entry->dev = dentry->d_inode->i_sb->s_dev;
1352 __entry->ret = ret;
1353 ),
1354
Lukas Czernera9c667f2011-06-06 09:51:52 -04001355 TP_printk("dev %d,%d ino %lu ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001356 MAJOR(__entry->dev), MINOR(__entry->dev),
1357 (unsigned long) __entry->ino,
1358 __entry->ret)
1359);
1360
1361DECLARE_EVENT_CLASS(ext4__truncate,
1362 TP_PROTO(struct inode *inode),
1363
1364 TP_ARGS(inode),
1365
1366 TP_STRUCT__entry(
1367 __field( ino_t, ino )
1368 __field( dev_t, dev )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001369 __field( __u64, blocks )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001370 ),
1371
1372 TP_fast_assign(
1373 __entry->ino = inode->i_ino;
1374 __entry->dev = inode->i_sb->s_dev;
1375 __entry->blocks = inode->i_blocks;
1376 ),
1377
Lukas Czernera9c667f2011-06-06 09:51:52 -04001378 TP_printk("dev %d,%d ino %lu blocks %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001379 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -04001380 (unsigned long) __entry->ino, __entry->blocks)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001381);
1382
1383DEFINE_EVENT(ext4__truncate, ext4_truncate_enter,
1384
1385 TP_PROTO(struct inode *inode),
1386
1387 TP_ARGS(inode)
1388);
1389
1390DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
1391
1392 TP_PROTO(struct inode *inode),
1393
1394 TP_ARGS(inode)
1395);
1396
1397DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1398 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001399 unsigned int len, unsigned int flags),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001400
1401 TP_ARGS(inode, lblk, len, flags),
1402
1403 TP_STRUCT__entry(
1404 __field( ino_t, ino )
1405 __field( dev_t, dev )
1406 __field( ext4_lblk_t, lblk )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001407 __field( unsigned int, len )
1408 __field( unsigned int, flags )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001409 ),
1410
1411 TP_fast_assign(
1412 __entry->ino = inode->i_ino;
1413 __entry->dev = inode->i_sb->s_dev;
1414 __entry->lblk = lblk;
1415 __entry->len = len;
1416 __entry->flags = flags;
1417 ),
1418
1419 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %u",
1420 MAJOR(__entry->dev), MINOR(__entry->dev),
1421 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001422 __entry->lblk, __entry->len, __entry->flags)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001423);
1424
1425DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter,
1426 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1427 unsigned len, unsigned flags),
1428
1429 TP_ARGS(inode, lblk, len, flags)
1430);
1431
1432DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter,
1433 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1434 unsigned len, unsigned flags),
1435
1436 TP_ARGS(inode, lblk, len, flags)
1437);
1438
1439DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
1440 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001441 ext4_fsblk_t pblk, unsigned int len, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001442
1443 TP_ARGS(inode, lblk, pblk, len, ret),
1444
1445 TP_STRUCT__entry(
1446 __field( ino_t, ino )
1447 __field( dev_t, dev )
1448 __field( ext4_lblk_t, lblk )
1449 __field( ext4_fsblk_t, pblk )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001450 __field( unsigned int, len )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001451 __field( int, ret )
1452 ),
1453
1454 TP_fast_assign(
1455 __entry->ino = inode->i_ino;
1456 __entry->dev = inode->i_sb->s_dev;
1457 __entry->lblk = lblk;
1458 __entry->pblk = pblk;
1459 __entry->len = len;
1460 __entry->ret = ret;
1461 ),
1462
1463 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u ret %d",
1464 MAJOR(__entry->dev), MINOR(__entry->dev),
1465 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001466 __entry->lblk, __entry->pblk,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001467 __entry->len, __entry->ret)
1468);
1469
1470DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit,
1471 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1472 ext4_fsblk_t pblk, unsigned len, int ret),
1473
1474 TP_ARGS(inode, lblk, pblk, len, ret)
1475);
1476
1477DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit,
1478 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1479 ext4_fsblk_t pblk, unsigned len, int ret),
1480
1481 TP_ARGS(inode, lblk, pblk, len, ret)
1482);
1483
1484TRACE_EVENT(ext4_ext_load_extent,
1485 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk),
1486
1487 TP_ARGS(inode, lblk, pblk),
1488
1489 TP_STRUCT__entry(
1490 __field( ino_t, ino )
1491 __field( dev_t, dev )
1492 __field( ext4_lblk_t, lblk )
1493 __field( ext4_fsblk_t, pblk )
1494 ),
1495
1496 TP_fast_assign(
1497 __entry->ino = inode->i_ino;
1498 __entry->dev = inode->i_sb->s_dev;
1499 __entry->lblk = lblk;
1500 __entry->pblk = pblk;
1501 ),
1502
1503 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1504 MAJOR(__entry->dev), MINOR(__entry->dev),
1505 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001506 __entry->lblk, __entry->pblk)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001507);
1508
1509TRACE_EVENT(ext4_load_inode,
1510 TP_PROTO(struct inode *inode),
1511
1512 TP_ARGS(inode),
1513
1514 TP_STRUCT__entry(
1515 __field( ino_t, ino )
1516 __field( dev_t, dev )
1517 ),
1518
1519 TP_fast_assign(
1520 __entry->ino = inode->i_ino;
1521 __entry->dev = inode->i_sb->s_dev;
1522 ),
1523
1524 TP_printk("dev %d,%d ino %ld",
1525 MAJOR(__entry->dev), MINOR(__entry->dev),
1526 (unsigned long) __entry->ino)
1527);
1528
Theodore Ts'o12706392011-07-10 22:37:50 -04001529TRACE_EVENT(ext4_journal_start,
1530 TP_PROTO(struct super_block *sb, int nblocks, unsigned long IP),
1531
1532 TP_ARGS(sb, nblocks, IP),
1533
1534 TP_STRUCT__entry(
1535 __field( dev_t, dev )
1536 __field( int, nblocks )
1537 __field(unsigned long, ip )
1538 ),
1539
1540 TP_fast_assign(
1541 __entry->dev = sb->s_dev;
1542 __entry->nblocks = nblocks;
1543 __entry->ip = IP;
1544 ),
1545
1546 TP_printk("dev %d,%d nblocks %d caller %pF",
1547 MAJOR(__entry->dev), MINOR(__entry->dev),
1548 __entry->nblocks, (void *)__entry->ip)
1549);
1550
Tao Mab3d4c2b2011-07-11 00:01:52 -04001551DECLARE_EVENT_CLASS(ext4__trim,
1552 TP_PROTO(struct super_block *sb,
1553 ext4_group_t group,
1554 ext4_grpblk_t start,
1555 ext4_grpblk_t len),
1556
1557 TP_ARGS(sb, group, start, len),
1558
1559 TP_STRUCT__entry(
1560 __field( int, dev_major )
1561 __field( int, dev_minor )
1562 __field( __u32, group )
1563 __field( int, start )
1564 __field( int, len )
1565 ),
1566
1567 TP_fast_assign(
1568 __entry->dev_major = MAJOR(sb->s_dev);
1569 __entry->dev_minor = MINOR(sb->s_dev);
1570 __entry->group = group;
1571 __entry->start = start;
1572 __entry->len = len;
1573 ),
1574
1575 TP_printk("dev %d,%d group %u, start %d, len %d",
1576 __entry->dev_major, __entry->dev_minor,
1577 __entry->group, __entry->start, __entry->len)
1578);
1579
1580DEFINE_EVENT(ext4__trim, ext4_trim_extent,
1581
1582 TP_PROTO(struct super_block *sb,
1583 ext4_group_t group,
1584 ext4_grpblk_t start,
1585 ext4_grpblk_t len),
1586
1587 TP_ARGS(sb, group, start, len)
1588);
1589
1590DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
1591
1592 TP_PROTO(struct super_block *sb,
1593 ext4_group_t group,
1594 ext4_grpblk_t start,
1595 ext4_grpblk_t len),
1596
1597 TP_ARGS(sb, group, start, len)
1598);
1599
Aditya Kalid8990242011-09-09 19:18:51 -04001600TRACE_EVENT(ext4_ext_handle_uninitialized_extents,
1601 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1602 unsigned int allocated, ext4_fsblk_t newblock),
1603
1604 TP_ARGS(inode, map, allocated, newblock),
1605
1606 TP_STRUCT__entry(
1607 __field( ino_t, ino )
1608 __field( dev_t, dev )
1609 __field( ext4_lblk_t, lblk )
1610 __field( ext4_fsblk_t, pblk )
1611 __field( unsigned int, len )
1612 __field( int, flags )
1613 __field( unsigned int, allocated )
1614 __field( ext4_fsblk_t, newblk )
1615 ),
1616
1617 TP_fast_assign(
1618 __entry->ino = inode->i_ino;
1619 __entry->dev = inode->i_sb->s_dev;
1620 __entry->lblk = map->m_lblk;
1621 __entry->pblk = map->m_pblk;
1622 __entry->len = map->m_len;
1623 __entry->flags = map->m_flags;
1624 __entry->allocated = allocated;
1625 __entry->newblk = newblock;
1626 ),
1627
1628 TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %d"
1629 "allocated %d newblock %llu",
1630 MAJOR(__entry->dev), MINOR(__entry->dev),
1631 (unsigned long) __entry->ino,
1632 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk,
1633 __entry->len, __entry->flags,
1634 (unsigned int) __entry->allocated,
1635 (unsigned long long) __entry->newblk)
1636);
1637
1638TRACE_EVENT(ext4_get_implied_cluster_alloc_exit,
1639 TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret),
1640
1641 TP_ARGS(sb, map, ret),
1642
1643 TP_STRUCT__entry(
1644 __field( dev_t, dev )
1645 __field( ext4_lblk_t, lblk )
1646 __field( ext4_fsblk_t, pblk )
1647 __field( unsigned int, len )
1648 __field( unsigned int, flags )
1649 __field( int, ret )
1650 ),
1651
1652 TP_fast_assign(
1653 __entry->dev = sb->s_dev;
1654 __entry->lblk = map->m_lblk;
1655 __entry->pblk = map->m_pblk;
1656 __entry->len = map->m_len;
1657 __entry->flags = map->m_flags;
1658 __entry->ret = ret;
1659 ),
1660
1661 TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %u ret %d",
1662 MAJOR(__entry->dev), MINOR(__entry->dev),
1663 __entry->lblk, (unsigned long long) __entry->pblk,
1664 __entry->len, __entry->flags, __entry->ret)
1665);
1666
1667TRACE_EVENT(ext4_ext_put_in_cache,
1668 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len,
1669 ext4_fsblk_t start),
1670
1671 TP_ARGS(inode, lblk, len, start),
1672
1673 TP_STRUCT__entry(
1674 __field( ino_t, ino )
1675 __field( dev_t, dev )
1676 __field( ext4_lblk_t, lblk )
1677 __field( unsigned int, len )
1678 __field( ext4_fsblk_t, start )
1679 ),
1680
1681 TP_fast_assign(
1682 __entry->ino = inode->i_ino;
1683 __entry->dev = inode->i_sb->s_dev;
1684 __entry->lblk = lblk;
1685 __entry->len = len;
1686 __entry->start = start;
1687 ),
1688
1689 TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu",
1690 MAJOR(__entry->dev), MINOR(__entry->dev),
1691 (unsigned long) __entry->ino,
1692 (unsigned) __entry->lblk,
1693 __entry->len,
1694 (unsigned long long) __entry->start)
1695);
1696
1697TRACE_EVENT(ext4_ext_in_cache,
1698 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret),
1699
1700 TP_ARGS(inode, lblk, ret),
1701
1702 TP_STRUCT__entry(
1703 __field( ino_t, ino )
1704 __field( dev_t, dev )
1705 __field( ext4_lblk_t, lblk )
1706 __field( int, ret )
1707 ),
1708
1709 TP_fast_assign(
1710 __entry->ino = inode->i_ino;
1711 __entry->dev = inode->i_sb->s_dev;
1712 __entry->lblk = lblk;
1713 __entry->ret = ret;
1714 ),
1715
1716 TP_printk("dev %d,%d ino %lu lblk %u ret %d",
1717 MAJOR(__entry->dev), MINOR(__entry->dev),
1718 (unsigned long) __entry->ino,
1719 (unsigned) __entry->lblk,
1720 __entry->ret)
1721
1722);
1723
1724TRACE_EVENT(ext4_find_delalloc_range,
1725 TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to,
1726 int reverse, int found, ext4_lblk_t found_blk),
1727
1728 TP_ARGS(inode, from, to, reverse, found, found_blk),
1729
1730 TP_STRUCT__entry(
1731 __field( ino_t, ino )
1732 __field( dev_t, dev )
1733 __field( ext4_lblk_t, from )
1734 __field( ext4_lblk_t, to )
1735 __field( int, reverse )
1736 __field( int, found )
1737 __field( ext4_lblk_t, found_blk )
1738 ),
1739
1740 TP_fast_assign(
1741 __entry->ino = inode->i_ino;
1742 __entry->dev = inode->i_sb->s_dev;
1743 __entry->from = from;
1744 __entry->to = to;
1745 __entry->reverse = reverse;
1746 __entry->found = found;
1747 __entry->found_blk = found_blk;
1748 ),
1749
1750 TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d "
1751 "(blk = %u)",
1752 MAJOR(__entry->dev), MINOR(__entry->dev),
1753 (unsigned long) __entry->ino,
1754 (unsigned) __entry->from, (unsigned) __entry->to,
1755 __entry->reverse, __entry->found,
1756 (unsigned) __entry->found_blk)
1757);
1758
1759TRACE_EVENT(ext4_get_reserved_cluster_alloc,
1760 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len),
1761
1762 TP_ARGS(inode, lblk, len),
1763
1764 TP_STRUCT__entry(
1765 __field( ino_t, ino )
1766 __field( dev_t, dev )
1767 __field( ext4_lblk_t, lblk )
1768 __field( unsigned int, len )
1769 ),
1770
1771 TP_fast_assign(
1772 __entry->ino = inode->i_ino;
1773 __entry->dev = inode->i_sb->s_dev;
1774 __entry->lblk = lblk;
1775 __entry->len = len;
1776 ),
1777
1778 TP_printk("dev %d,%d ino %lu lblk %u len %u",
1779 MAJOR(__entry->dev), MINOR(__entry->dev),
1780 (unsigned long) __entry->ino,
1781 (unsigned) __entry->lblk,
1782 __entry->len)
1783);
1784
1785TRACE_EVENT(ext4_ext_show_extent,
1786 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk,
1787 unsigned short len),
1788
1789 TP_ARGS(inode, lblk, pblk, len),
1790
1791 TP_STRUCT__entry(
1792 __field( ino_t, ino )
1793 __field( dev_t, dev )
1794 __field( ext4_lblk_t, lblk )
1795 __field( ext4_fsblk_t, pblk )
1796 __field( unsigned short, len )
1797 ),
1798
1799 TP_fast_assign(
1800 __entry->ino = inode->i_ino;
1801 __entry->dev = inode->i_sb->s_dev;
1802 __entry->lblk = lblk;
1803 __entry->pblk = pblk;
1804 __entry->len = len;
1805 ),
1806
1807 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u",
1808 MAJOR(__entry->dev), MINOR(__entry->dev),
1809 (unsigned long) __entry->ino,
1810 (unsigned) __entry->lblk,
1811 (unsigned long long) __entry->pblk,
1812 (unsigned short) __entry->len)
1813);
1814
1815TRACE_EVENT(ext4_remove_blocks,
1816 TP_PROTO(struct inode *inode, struct ext4_extent *ex,
1817 ext4_lblk_t from, ext4_fsblk_t to,
1818 ext4_fsblk_t partial_cluster),
1819
1820 TP_ARGS(inode, ex, from, to, partial_cluster),
1821
1822 TP_STRUCT__entry(
1823 __field( ino_t, ino )
1824 __field( dev_t, dev )
1825 __field( ext4_lblk_t, ee_lblk )
1826 __field( ext4_fsblk_t, ee_pblk )
1827 __field( unsigned short, ee_len )
1828 __field( ext4_lblk_t, from )
1829 __field( ext4_lblk_t, to )
1830 __field( ext4_fsblk_t, partial )
1831 ),
1832
1833 TP_fast_assign(
1834 __entry->ino = inode->i_ino;
1835 __entry->dev = inode->i_sb->s_dev;
1836 __entry->ee_lblk = cpu_to_le32(ex->ee_block);
1837 __entry->ee_pblk = ext4_ext_pblock(ex);
1838 __entry->ee_len = ext4_ext_get_actual_len(ex);
1839 __entry->from = from;
1840 __entry->to = to;
1841 __entry->partial = partial_cluster;
1842 ),
1843
1844 TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
1845 "from %u to %u partial_cluster %u",
1846 MAJOR(__entry->dev), MINOR(__entry->dev),
1847 (unsigned long) __entry->ino,
1848 (unsigned) __entry->ee_lblk,
1849 (unsigned long long) __entry->ee_pblk,
1850 (unsigned short) __entry->ee_len,
1851 (unsigned) __entry->from,
1852 (unsigned) __entry->to,
1853 (unsigned) __entry->partial)
1854);
1855
1856TRACE_EVENT(ext4_ext_rm_leaf,
1857 TP_PROTO(struct inode *inode, ext4_lblk_t start,
1858 struct ext4_extent *ex, ext4_fsblk_t partial_cluster),
1859
1860 TP_ARGS(inode, start, ex, partial_cluster),
1861
1862 TP_STRUCT__entry(
1863 __field( ino_t, ino )
1864 __field( dev_t, dev )
1865 __field( ext4_lblk_t, start )
1866 __field( ext4_lblk_t, ee_lblk )
1867 __field( ext4_fsblk_t, ee_pblk )
1868 __field( short, ee_len )
1869 __field( ext4_fsblk_t, partial )
1870 ),
1871
1872 TP_fast_assign(
1873 __entry->ino = inode->i_ino;
1874 __entry->dev = inode->i_sb->s_dev;
1875 __entry->start = start;
1876 __entry->ee_lblk = le32_to_cpu(ex->ee_block);
1877 __entry->ee_pblk = ext4_ext_pblock(ex);
1878 __entry->ee_len = ext4_ext_get_actual_len(ex);
1879 __entry->partial = partial_cluster;
1880 ),
1881
1882 TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
1883 "partial_cluster %u",
1884 MAJOR(__entry->dev), MINOR(__entry->dev),
1885 (unsigned long) __entry->ino,
1886 (unsigned) __entry->start,
1887 (unsigned) __entry->ee_lblk,
1888 (unsigned long long) __entry->ee_pblk,
1889 (unsigned short) __entry->ee_len,
1890 (unsigned) __entry->partial)
1891);
1892
1893TRACE_EVENT(ext4_ext_rm_idx,
1894 TP_PROTO(struct inode *inode, ext4_fsblk_t pblk),
1895
1896 TP_ARGS(inode, pblk),
1897
1898 TP_STRUCT__entry(
1899 __field( ino_t, ino )
1900 __field( dev_t, dev )
1901 __field( ext4_fsblk_t, pblk )
1902 ),
1903
1904 TP_fast_assign(
1905 __entry->ino = inode->i_ino;
1906 __entry->dev = inode->i_sb->s_dev;
1907 __entry->pblk = pblk;
1908 ),
1909
1910 TP_printk("dev %d,%d ino %lu index_pblk %llu",
1911 MAJOR(__entry->dev), MINOR(__entry->dev),
1912 (unsigned long) __entry->ino,
1913 (unsigned long long) __entry->pblk)
1914);
1915
1916TRACE_EVENT(ext4_ext_remove_space,
1917 TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth),
1918
1919 TP_ARGS(inode, start, depth),
1920
1921 TP_STRUCT__entry(
1922 __field( ino_t, ino )
1923 __field( dev_t, dev )
1924 __field( ext4_lblk_t, start )
1925 __field( int, depth )
1926 ),
1927
1928 TP_fast_assign(
1929 __entry->ino = inode->i_ino;
1930 __entry->dev = inode->i_sb->s_dev;
1931 __entry->start = start;
1932 __entry->depth = depth;
1933 ),
1934
1935 TP_printk("dev %d,%d ino %lu since %u depth %d",
1936 MAJOR(__entry->dev), MINOR(__entry->dev),
1937 (unsigned long) __entry->ino,
1938 (unsigned) __entry->start,
1939 __entry->depth)
1940);
1941
1942TRACE_EVENT(ext4_ext_remove_space_done,
1943 TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth,
1944 ext4_lblk_t partial, unsigned short eh_entries),
1945
1946 TP_ARGS(inode, start, depth, partial, eh_entries),
1947
1948 TP_STRUCT__entry(
1949 __field( ino_t, ino )
1950 __field( dev_t, dev )
1951 __field( ext4_lblk_t, start )
1952 __field( int, depth )
1953 __field( ext4_lblk_t, partial )
1954 __field( unsigned short, eh_entries )
1955 ),
1956
1957 TP_fast_assign(
1958 __entry->ino = inode->i_ino;
1959 __entry->dev = inode->i_sb->s_dev;
1960 __entry->start = start;
1961 __entry->depth = depth;
1962 __entry->partial = partial;
1963 __entry->eh_entries = eh_entries;
1964 ),
1965
1966 TP_printk("dev %d,%d ino %lu since %u depth %d partial %u "
1967 "remaining_entries %u",
1968 MAJOR(__entry->dev), MINOR(__entry->dev),
1969 (unsigned long) __entry->ino,
1970 (unsigned) __entry->start,
1971 __entry->depth,
1972 (unsigned) __entry->partial,
1973 (unsigned short) __entry->eh_entries)
1974);
1975
Theodore Ts'o9bffad12009-06-17 11:48:11 -04001976#endif /* _TRACE_EXT4_H */
1977
1978/* This part must be outside protection */
1979#include <trace/define_trace.h>