blob: d892b55d91ab84fd00539f54677dae9ce7a064cc [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;
Eric Gouriou6f91bc52011-10-27 11:43:23 -040012struct ext4_extent;
Theodore Ts'o3661d282009-09-14 22:59:50 -040013struct ext4_prealloc_space;
Theodore Ts'ofb40ba02009-09-16 19:30:40 -040014struct ext4_inode_info;
Josh Stone0ef12242009-09-30 00:51:22 -040015struct mpage_da_data;
Aditya Kalid8990242011-09-09 19:18:51 -040016struct ext4_map_blocks;
17struct ext4_extent;
Zheng Liu992e9fd2012-11-08 21:57:33 -050018struct extent_status;
Theodore Ts'ofb40ba02009-09-16 19:30:40 -040019
20#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
Theodore Ts'o3661d282009-09-14 22:59:50 -040021
Theodore Ts'o21ddd562013-07-01 08:12:40 -040022#define show_mballoc_flags(flags) __print_flags(flags, "|", \
23 { EXT4_MB_HINT_MERGE, "HINT_MERGE" }, \
24 { EXT4_MB_HINT_RESERVED, "HINT_RESV" }, \
25 { EXT4_MB_HINT_METADATA, "HINT_MDATA" }, \
26 { EXT4_MB_HINT_FIRST, "HINT_FIRST" }, \
27 { EXT4_MB_HINT_BEST, "HINT_BEST" }, \
28 { EXT4_MB_HINT_DATA, "HINT_DATA" }, \
29 { EXT4_MB_HINT_NOPREALLOC, "HINT_NOPREALLOC" }, \
30 { EXT4_MB_HINT_GROUP_ALLOC, "HINT_GRP_ALLOC" }, \
31 { EXT4_MB_HINT_GOAL_ONLY, "HINT_GOAL_ONLY" }, \
32 { EXT4_MB_HINT_TRY_GOAL, "HINT_TRY_GOAL" }, \
33 { EXT4_MB_DELALLOC_RESERVED, "DELALLOC_RESV" }, \
34 { EXT4_MB_STREAM_ALLOC, "STREAM_ALLOC" }, \
35 { EXT4_MB_USE_ROOT_BLOCKS, "USE_ROOT_BLKS" }, \
36 { EXT4_MB_USE_RESERVED, "USE_RESV" })
37
38#define show_map_flags(flags) __print_flags(flags, "|", \
39 { EXT4_GET_BLOCKS_CREATE, "CREATE" }, \
40 { EXT4_GET_BLOCKS_UNINIT_EXT, "UNINIT" }, \
41 { EXT4_GET_BLOCKS_DELALLOC_RESERVE, "DELALLOC" }, \
42 { EXT4_GET_BLOCKS_PRE_IO, "PRE_IO" }, \
43 { EXT4_GET_BLOCKS_CONVERT, "CONVERT" }, \
44 { EXT4_GET_BLOCKS_METADATA_NOFAIL, "METADATA_NOFAIL" }, \
45 { EXT4_GET_BLOCKS_NO_NORMALIZE, "NO_NORMALIZE" }, \
46 { EXT4_GET_BLOCKS_KEEP_SIZE, "KEEP_SIZE" }, \
47 { EXT4_GET_BLOCKS_NO_LOCK, "NO_LOCK" }, \
48 { EXT4_GET_BLOCKS_NO_PUT_HOLE, "NO_PUT_HOLE" })
49
50#define show_mflags(flags) __print_flags(flags, "", \
51 { EXT4_MAP_NEW, "N" }, \
52 { EXT4_MAP_MAPPED, "M" }, \
53 { EXT4_MAP_UNWRITTEN, "U" }, \
54 { EXT4_MAP_BOUNDARY, "B" }, \
55 { EXT4_MAP_UNINIT, "u" }, \
56 { EXT4_MAP_FROM_CLUSTER, "C" })
57
58#define show_free_flags(flags) __print_flags(flags, "|", \
59 { EXT4_FREE_BLOCKS_METADATA, "METADATA" }, \
60 { EXT4_FREE_BLOCKS_FORGET, "FORGET" }, \
61 { EXT4_FREE_BLOCKS_VALIDATED, "VALIDATED" }, \
62 { EXT4_FREE_BLOCKS_NO_QUOT_UPDATE, "NO_QUOTA" }, \
63 { EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER,"1ST_CLUSTER" },\
64 { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" })
65
66#define show_extent_status(status) __print_flags(status, "", \
Theodore Ts'o3be78c72013-08-16 21:22:41 -040067 { EXTENT_STATUS_WRITTEN, "W" }, \
68 { EXTENT_STATUS_UNWRITTEN, "U" }, \
69 { EXTENT_STATUS_DELAYED, "D" }, \
70 { EXTENT_STATUS_HOLE, "H" })
Theodore Ts'o21ddd562013-07-01 08:12:40 -040071
72
Theodore Ts'o9bffad12009-06-17 11:48:11 -040073TRACE_EVENT(ext4_free_inode,
74 TP_PROTO(struct inode *inode),
75
76 TP_ARGS(inode),
77
78 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040079 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040080 __field( ino_t, ino )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040081 __field( uid_t, uid )
82 __field( gid_t, gid )
Lukas Czernera9c667f2011-06-06 09:51:52 -040083 __field( __u64, blocks )
Anatol Pomozov210c0522012-08-17 09:50:17 -040084 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -040085 ),
86
87 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040088 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -040089 __entry->ino = inode->i_ino;
Eric W. Biederman08cefc72012-02-07 15:41:49 -080090 __entry->uid = i_uid_read(inode);
91 __entry->gid = i_gid_read(inode);
Theodore Ts'o9bffad12009-06-17 11:48:11 -040092 __entry->blocks = inode->i_blocks;
Anatol Pomozov210c0522012-08-17 09:50:17 -040093 __entry->mode = inode->i_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -040094 ),
95
Theodore Ts'oa2690292010-10-27 22:08:50 -040096 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -040097 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -040098 (unsigned long) __entry->ino, __entry->mode,
99 __entry->uid, __entry->gid, __entry->blocks)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400100);
101
102TRACE_EVENT(ext4_request_inode,
103 TP_PROTO(struct inode *dir, int mode),
104
105 TP_ARGS(dir, mode),
106
107 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400108 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400109 __field( ino_t, dir )
Theodore Ts'o59be8e72011-07-30 12:38:46 -0400110 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400111 ),
112
113 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400114 __entry->dev = dir->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400115 __entry->dir = dir->i_ino;
116 __entry->mode = mode;
117 ),
118
Theodore Ts'oa2690292010-10-27 22:08:50 -0400119 TP_printk("dev %d,%d dir %lu mode 0%o",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400120 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400121 (unsigned long) __entry->dir, __entry->mode)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400122);
123
124TRACE_EVENT(ext4_allocate_inode,
125 TP_PROTO(struct inode *inode, struct inode *dir, int mode),
126
127 TP_ARGS(inode, dir, mode),
128
129 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400130 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400131 __field( ino_t, ino )
132 __field( ino_t, dir )
Theodore Ts'o59be8e72011-07-30 12:38:46 -0400133 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400134 ),
135
136 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400137 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400138 __entry->ino = inode->i_ino;
139 __entry->dir = dir->i_ino;
140 __entry->mode = mode;
141 ),
142
Theodore Ts'oa2690292010-10-27 22:08:50 -0400143 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400144 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400145 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400146 (unsigned long) __entry->dir, __entry->mode)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400147);
148
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500149TRACE_EVENT(ext4_evict_inode,
150 TP_PROTO(struct inode *inode),
151
152 TP_ARGS(inode),
153
154 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400155 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500156 __field( ino_t, ino )
157 __field( int, nlink )
158 ),
159
160 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400161 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500162 __entry->ino = inode->i_ino;
163 __entry->nlink = inode->i_nlink;
164 ),
165
166 TP_printk("dev %d,%d ino %lu nlink %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400167 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500168 (unsigned long) __entry->ino, __entry->nlink)
169);
170
171TRACE_EVENT(ext4_drop_inode,
172 TP_PROTO(struct inode *inode, int drop),
173
174 TP_ARGS(inode, drop),
175
176 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400177 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500178 __field( ino_t, ino )
179 __field( int, drop )
180 ),
181
182 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400183 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500184 __entry->ino = inode->i_ino;
185 __entry->drop = drop;
186 ),
187
188 TP_printk("dev %d,%d ino %lu drop %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400189 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500190 (unsigned long) __entry->ino, __entry->drop)
191);
192
193TRACE_EVENT(ext4_mark_inode_dirty,
194 TP_PROTO(struct inode *inode, unsigned long IP),
195
196 TP_ARGS(inode, IP),
197
198 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400199 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500200 __field( ino_t, ino )
201 __field(unsigned long, ip )
202 ),
203
204 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400205 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500206 __entry->ino = inode->i_ino;
207 __entry->ip = IP;
208 ),
209
210 TP_printk("dev %d,%d ino %lu caller %pF",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400211 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500212 (unsigned long) __entry->ino, (void *)__entry->ip)
213);
214
215TRACE_EVENT(ext4_begin_ordered_truncate,
216 TP_PROTO(struct inode *inode, loff_t new_size),
217
218 TP_ARGS(inode, new_size),
219
220 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400221 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500222 __field( ino_t, ino )
223 __field( loff_t, new_size )
224 ),
225
226 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400227 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500228 __entry->ino = inode->i_ino;
229 __entry->new_size = new_size;
230 ),
231
232 TP_printk("dev %d,%d ino %lu new_size %lld",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400233 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500234 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400235 __entry->new_size)
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500236);
237
Li Zefanb5eb34c2009-11-26 15:07:36 +0800238DECLARE_EVENT_CLASS(ext4__write_begin,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400239
240 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
241 unsigned int flags),
242
243 TP_ARGS(inode, pos, len, flags),
244
245 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400246 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400247 __field( ino_t, ino )
248 __field( loff_t, pos )
249 __field( unsigned int, len )
250 __field( unsigned int, flags )
251 ),
252
253 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400254 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400255 __entry->ino = inode->i_ino;
256 __entry->pos = pos;
257 __entry->len = len;
258 __entry->flags = flags;
259 ),
260
Lukas Czernera9c667f2011-06-06 09:51:52 -0400261 TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400262 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400263 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400264 __entry->pos, __entry->len, __entry->flags)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400265);
266
Li Zefanb5eb34c2009-11-26 15:07:36 +0800267DEFINE_EVENT(ext4__write_begin, ext4_write_begin,
268
269 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
270 unsigned int flags),
271
272 TP_ARGS(inode, pos, len, flags)
273);
274
275DEFINE_EVENT(ext4__write_begin, ext4_da_write_begin,
276
277 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
278 unsigned int flags),
279
280 TP_ARGS(inode, pos, len, flags)
281);
282
283DECLARE_EVENT_CLASS(ext4__write_end,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400284 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
285 unsigned int copied),
286
287 TP_ARGS(inode, pos, len, copied),
288
289 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400290 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400291 __field( ino_t, ino )
292 __field( loff_t, pos )
293 __field( unsigned int, len )
294 __field( unsigned int, copied )
295 ),
296
297 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400298 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400299 __entry->ino = inode->i_ino;
300 __entry->pos = pos;
301 __entry->len = len;
302 __entry->copied = copied;
303 ),
304
Lukas Czernera9c667f2011-06-06 09:51:52 -0400305 TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400306 MAJOR(__entry->dev), MINOR(__entry->dev),
307 (unsigned long) __entry->ino,
308 __entry->pos, __entry->len, __entry->copied)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400309);
310
Theodore Ts'o74d553a2013-04-03 12:39:17 -0400311DEFINE_EVENT(ext4__write_end, ext4_write_end,
Li Zefanb5eb34c2009-11-26 15:07:36 +0800312
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400313 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
314 unsigned int copied),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400315
Li Zefanb5eb34c2009-11-26 15:07:36 +0800316 TP_ARGS(inode, pos, len, copied)
317);
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400318
Li Zefanb5eb34c2009-11-26 15:07:36 +0800319DEFINE_EVENT(ext4__write_end, ext4_journalled_write_end,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400320
Li Zefanb5eb34c2009-11-26 15:07:36 +0800321 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
322 unsigned int copied),
323
324 TP_ARGS(inode, pos, len, copied)
325);
326
327DEFINE_EVENT(ext4__write_end, ext4_da_write_end,
328
329 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
330 unsigned int copied),
331
332 TP_ARGS(inode, pos, len, copied)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400333);
334
Theodore Ts'o20970ba2013-06-06 14:00:46 -0400335TRACE_EVENT(ext4_writepages,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400336 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
337
338 TP_ARGS(inode, wbc),
339
340 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400341 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400342 __field( ino_t, ino )
343 __field( long, nr_to_write )
344 __field( long, pages_skipped )
345 __field( loff_t, range_start )
346 __field( loff_t, range_end )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400347 __field( pgoff_t, writeback_index )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400348 __field( int, sync_mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400349 __field( char, for_kupdate )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400350 __field( char, range_cyclic )
351 ),
352
353 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400354 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400355 __entry->ino = inode->i_ino;
356 __entry->nr_to_write = wbc->nr_to_write;
357 __entry->pages_skipped = wbc->pages_skipped;
358 __entry->range_start = wbc->range_start;
359 __entry->range_end = wbc->range_end;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400360 __entry->writeback_index = inode->i_mapping->writeback_index;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400361 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400362 __entry->for_kupdate = wbc->for_kupdate;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400363 __entry->range_cyclic = wbc->range_cyclic;
364 ),
365
Theodore Ts'oa107e5a2010-10-27 23:44:47 -0400366 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
Anatol Pomozov81370292012-08-17 09:52:17 -0400367 "range_start %lld range_end %lld sync_mode %d "
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400368 "for_kupdate %d range_cyclic %d writeback_index %lu",
369 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400370 (unsigned long) __entry->ino, __entry->nr_to_write,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400371 __entry->pages_skipped, __entry->range_start,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400372 __entry->range_end, __entry->sync_mode,
373 __entry->for_kupdate, __entry->range_cyclic,
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400374 (unsigned long) __entry->writeback_index)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400375);
376
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400377TRACE_EVENT(ext4_da_write_pages,
Jan Kara4e7ea812013-06-04 13:17:40 -0400378 TP_PROTO(struct inode *inode, pgoff_t first_page,
379 struct writeback_control *wbc),
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400380
Jan Kara4e7ea812013-06-04 13:17:40 -0400381 TP_ARGS(inode, first_page, wbc),
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400382
383 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400384 __field( dev_t, dev )
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400385 __field( ino_t, ino )
Jan Kara4e7ea812013-06-04 13:17:40 -0400386 __field( pgoff_t, first_page )
387 __field( long, nr_to_write )
388 __field( int, sync_mode )
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400389 ),
390
391 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400392 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400393 __entry->ino = inode->i_ino;
Jan Kara4e7ea812013-06-04 13:17:40 -0400394 __entry->first_page = first_page;
395 __entry->nr_to_write = wbc->nr_to_write;
396 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400397 ),
398
Jan Kara4e7ea812013-06-04 13:17:40 -0400399 TP_printk("dev %d,%d ino %lu first_page %lu nr_to_write %ld "
400 "sync_mode %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400401 MAJOR(__entry->dev), MINOR(__entry->dev),
Jan Kara4e7ea812013-06-04 13:17:40 -0400402 (unsigned long) __entry->ino, __entry->first_page,
403 __entry->nr_to_write, __entry->sync_mode)
404);
405
406TRACE_EVENT(ext4_da_write_pages_extent,
407 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map),
408
409 TP_ARGS(inode, map),
410
411 TP_STRUCT__entry(
412 __field( dev_t, dev )
413 __field( ino_t, ino )
414 __field( __u64, lblk )
415 __field( __u32, len )
416 __field( __u32, flags )
417 ),
418
419 TP_fast_assign(
420 __entry->dev = inode->i_sb->s_dev;
421 __entry->ino = inode->i_ino;
422 __entry->lblk = map->m_lblk;
423 __entry->len = map->m_len;
424 __entry->flags = map->m_flags;
425 ),
426
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400427 TP_printk("dev %d,%d ino %lu lblk %llu len %u flags %s",
Jan Kara4e7ea812013-06-04 13:17:40 -0400428 MAJOR(__entry->dev), MINOR(__entry->dev),
429 (unsigned long) __entry->ino, __entry->lblk, __entry->len,
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400430 show_mflags(__entry->flags))
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400431);
432
Theodore Ts'o20970ba2013-06-06 14:00:46 -0400433TRACE_EVENT(ext4_writepages_result,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400434 TP_PROTO(struct inode *inode, struct writeback_control *wbc,
435 int ret, int pages_written),
436
437 TP_ARGS(inode, wbc, ret, pages_written),
438
439 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400440 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400441 __field( ino_t, ino )
442 __field( int, ret )
443 __field( int, pages_written )
444 __field( long, pages_skipped )
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400445 __field( pgoff_t, writeback_index )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400446 __field( int, sync_mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400447 ),
448
449 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400450 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400451 __entry->ino = inode->i_ino;
452 __entry->ret = ret;
453 __entry->pages_written = pages_written;
454 __entry->pages_skipped = wbc->pages_skipped;
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400455 __entry->writeback_index = inode->i_mapping->writeback_index;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400456 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400457 ),
458
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400459 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
Wu Fengguangb7a24412010-07-21 22:19:51 -0600460 "sync_mode %d writeback_index %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400461 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400462 (unsigned long) __entry->ino, __entry->ret,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400463 __entry->pages_written, __entry->pages_skipped,
Wu Fengguangb7a24412010-07-21 22:19:51 -0600464 __entry->sync_mode,
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400465 (unsigned long) __entry->writeback_index)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400466);
467
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400468DECLARE_EVENT_CLASS(ext4__page_op,
469 TP_PROTO(struct page *page),
470
471 TP_ARGS(page),
472
473 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400474 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400475 __field( ino_t, ino )
476 __field( pgoff_t, index )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400477
478 ),
479
480 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400481 __entry->dev = page->mapping->host->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400482 __entry->ino = page->mapping->host->i_ino;
483 __entry->index = page->index;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400484 ),
485
486 TP_printk("dev %d,%d ino %lu page_index %lu",
487 MAJOR(__entry->dev), MINOR(__entry->dev),
488 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400489 (unsigned long) __entry->index)
490);
491
492DEFINE_EVENT(ext4__page_op, ext4_writepage,
493
494 TP_PROTO(struct page *page),
495
496 TP_ARGS(page)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400497);
498
499DEFINE_EVENT(ext4__page_op, ext4_readpage,
500
501 TP_PROTO(struct page *page),
502
503 TP_ARGS(page)
504);
505
506DEFINE_EVENT(ext4__page_op, ext4_releasepage,
507
508 TP_PROTO(struct page *page),
509
510 TP_ARGS(page)
511);
512
Jan Kara4520fb32012-12-25 13:28:54 -0500513DECLARE_EVENT_CLASS(ext4_invalidatepage_op,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400514 TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400515
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400516 TP_ARGS(page, offset, length),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400517
518 TP_STRUCT__entry(
Anatol Pomozov210c0522012-08-17 09:50:17 -0400519 __field( dev_t, dev )
520 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400521 __field( pgoff_t, index )
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400522 __field( unsigned int, offset )
523 __field( unsigned int, length )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400524 ),
525
526 TP_fast_assign(
Anatol Pomozov210c0522012-08-17 09:50:17 -0400527 __entry->dev = page->mapping->host->i_sb->s_dev;
528 __entry->ino = page->mapping->host->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400529 __entry->index = page->index;
530 __entry->offset = offset;
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400531 __entry->length = length;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400532 ),
533
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400534 TP_printk("dev %d,%d ino %lu page_index %lu offset %u length %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400535 MAJOR(__entry->dev), MINOR(__entry->dev),
536 (unsigned long) __entry->ino,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400537 (unsigned long) __entry->index,
538 __entry->offset, __entry->length)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400539);
540
Jan Kara4520fb32012-12-25 13:28:54 -0500541DEFINE_EVENT(ext4_invalidatepage_op, ext4_invalidatepage,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400542 TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
Jan Kara4520fb32012-12-25 13:28:54 -0500543
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400544 TP_ARGS(page, offset, length)
Jan Kara4520fb32012-12-25 13:28:54 -0500545);
546
547DEFINE_EVENT(ext4_invalidatepage_op, ext4_journalled_invalidatepage,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400548 TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
Jan Kara4520fb32012-12-25 13:28:54 -0500549
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400550 TP_ARGS(page, offset, length)
Jan Kara4520fb32012-12-25 13:28:54 -0500551);
552
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400553TRACE_EVENT(ext4_discard_blocks,
554 TP_PROTO(struct super_block *sb, unsigned long long blk,
555 unsigned long long count),
556
557 TP_ARGS(sb, blk, count),
558
559 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400560 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400561 __field( __u64, blk )
562 __field( __u64, count )
563
564 ),
565
566 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400567 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400568 __entry->blk = blk;
569 __entry->count = count;
570 ),
571
Theodore Ts'oa2690292010-10-27 22:08:50 -0400572 TP_printk("dev %d,%d blk %llu count %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400573 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400574 __entry->blk, __entry->count)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400575);
576
Li Zefanf084db92010-05-17 04:00:00 -0400577DECLARE_EVENT_CLASS(ext4__mb_new_pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400578 TP_PROTO(struct ext4_allocation_context *ac,
579 struct ext4_prealloc_space *pa),
580
581 TP_ARGS(ac, pa),
582
583 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400584 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400585 __field( ino_t, ino )
586 __field( __u64, pa_pstart )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400587 __field( __u64, pa_lstart )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400588 __field( __u32, pa_len )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400589
590 ),
591
592 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400593 __entry->dev = ac->ac_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400594 __entry->ino = ac->ac_inode->i_ino;
595 __entry->pa_pstart = pa->pa_pstart;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400596 __entry->pa_lstart = pa->pa_lstart;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400597 __entry->pa_len = pa->pa_len;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400598 ),
599
Theodore Ts'oa2690292010-10-27 22:08:50 -0400600 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400601 MAJOR(__entry->dev), MINOR(__entry->dev),
602 (unsigned long) __entry->ino,
603 __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400604);
605
Li Zefanf084db92010-05-17 04:00:00 -0400606DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa,
607
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400608 TP_PROTO(struct ext4_allocation_context *ac,
609 struct ext4_prealloc_space *pa),
610
Li Zefanf084db92010-05-17 04:00:00 -0400611 TP_ARGS(ac, pa)
612);
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400613
Li Zefanf084db92010-05-17 04:00:00 -0400614DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400615
Li Zefanf084db92010-05-17 04:00:00 -0400616 TP_PROTO(struct ext4_allocation_context *ac,
617 struct ext4_prealloc_space *pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400618
Li Zefanf084db92010-05-17 04:00:00 -0400619 TP_ARGS(ac, pa)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400620);
621
622TRACE_EVENT(ext4_mb_release_inode_pa,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400623 TP_PROTO(struct ext4_prealloc_space *pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400624 unsigned long long block, unsigned int count),
625
Lukas Czernera9c667f2011-06-06 09:51:52 -0400626 TP_ARGS(pa, block, count),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400627
628 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400629 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400630 __field( ino_t, ino )
631 __field( __u64, block )
632 __field( __u32, count )
633
634 ),
635
636 TP_fast_assign(
Lukas Czernera9c667f2011-06-06 09:51:52 -0400637 __entry->dev = pa->pa_inode->i_sb->s_dev;
638 __entry->ino = pa->pa_inode->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400639 __entry->block = block;
640 __entry->count = count;
641 ),
642
Theodore Ts'oa2690292010-10-27 22:08:50 -0400643 TP_printk("dev %d,%d ino %lu block %llu count %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400644 MAJOR(__entry->dev), MINOR(__entry->dev),
645 (unsigned long) __entry->ino,
646 __entry->block, __entry->count)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400647);
648
649TRACE_EVENT(ext4_mb_release_group_pa,
Yongqiang Yang60e07cf2011-12-18 15:49:54 -0500650 TP_PROTO(struct super_block *sb, struct ext4_prealloc_space *pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400651
Yongqiang Yang60e07cf2011-12-18 15:49:54 -0500652 TP_ARGS(sb, pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400653
654 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400655 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400656 __field( __u64, pa_pstart )
657 __field( __u32, pa_len )
658
659 ),
660
661 TP_fast_assign(
Yongqiang Yang60e07cf2011-12-18 15:49:54 -0500662 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400663 __entry->pa_pstart = pa->pa_pstart;
664 __entry->pa_len = pa->pa_len;
665 ),
666
Theodore Ts'oa2690292010-10-27 22:08:50 -0400667 TP_printk("dev %d,%d pstart %llu len %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400668 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400669 __entry->pa_pstart, __entry->pa_len)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400670);
671
672TRACE_EVENT(ext4_discard_preallocations,
673 TP_PROTO(struct inode *inode),
674
675 TP_ARGS(inode),
676
677 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400678 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400679 __field( ino_t, ino )
680
681 ),
682
683 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400684 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400685 __entry->ino = inode->i_ino;
686 ),
687
Theodore Ts'oa2690292010-10-27 22:08:50 -0400688 TP_printk("dev %d,%d ino %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400689 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400690 (unsigned long) __entry->ino)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400691);
692
693TRACE_EVENT(ext4_mb_discard_preallocations,
694 TP_PROTO(struct super_block *sb, int needed),
695
696 TP_ARGS(sb, needed),
697
698 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400699 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400700 __field( int, needed )
701
702 ),
703
704 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400705 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400706 __entry->needed = needed;
707 ),
708
Theodore Ts'oa2690292010-10-27 22:08:50 -0400709 TP_printk("dev %d,%d needed %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400710 MAJOR(__entry->dev), MINOR(__entry->dev),
711 __entry->needed)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400712);
713
714TRACE_EVENT(ext4_request_blocks,
715 TP_PROTO(struct ext4_allocation_request *ar),
716
717 TP_ARGS(ar),
718
719 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400720 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400721 __field( ino_t, ino )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400722 __field( unsigned int, len )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400723 __field( __u32, logical )
724 __field( __u32, lleft )
725 __field( __u32, lright )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400726 __field( __u64, goal )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400727 __field( __u64, pleft )
728 __field( __u64, pright )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400729 __field( unsigned int, flags )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400730 ),
731
732 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400733 __entry->dev = ar->inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400734 __entry->ino = ar->inode->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400735 __entry->len = ar->len;
736 __entry->logical = ar->logical;
737 __entry->goal = ar->goal;
738 __entry->lleft = ar->lleft;
739 __entry->lright = ar->lright;
740 __entry->pleft = ar->pleft;
741 __entry->pright = ar->pright;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400742 __entry->flags = ar->flags;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400743 ),
744
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400745 TP_printk("dev %d,%d ino %lu flags %s len %u lblk %u goal %llu "
Lukas Czernera9c667f2011-06-06 09:51:52 -0400746 "lleft %u lright %u pleft %llu pright %llu ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400747 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400748 (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags),
Lukas Czernera9c667f2011-06-06 09:51:52 -0400749 __entry->len, __entry->logical, __entry->goal,
750 __entry->lleft, __entry->lright, __entry->pleft,
751 __entry->pright)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400752);
753
754TRACE_EVENT(ext4_allocate_blocks,
755 TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block),
756
757 TP_ARGS(ar, block),
758
759 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400760 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400761 __field( ino_t, ino )
762 __field( __u64, block )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400763 __field( unsigned int, len )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400764 __field( __u32, logical )
765 __field( __u32, lleft )
766 __field( __u32, lright )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400767 __field( __u64, goal )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400768 __field( __u64, pleft )
769 __field( __u64, pright )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400770 __field( unsigned int, flags )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400771 ),
772
773 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400774 __entry->dev = ar->inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400775 __entry->ino = ar->inode->i_ino;
776 __entry->block = block;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400777 __entry->len = ar->len;
778 __entry->logical = ar->logical;
779 __entry->goal = ar->goal;
780 __entry->lleft = ar->lleft;
781 __entry->lright = ar->lright;
782 __entry->pleft = ar->pleft;
783 __entry->pright = ar->pright;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400784 __entry->flags = ar->flags;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400785 ),
786
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400787 TP_printk("dev %d,%d ino %lu flags %s len %u block %llu lblk %u "
Lukas Czernera9c667f2011-06-06 09:51:52 -0400788 "goal %llu lleft %u lright %u pleft %llu pright %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400789 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400790 (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags),
Lukas Czernera9c667f2011-06-06 09:51:52 -0400791 __entry->len, __entry->block, __entry->logical,
792 __entry->goal, __entry->lleft, __entry->lright,
793 __entry->pleft, __entry->pright)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400794);
795
796TRACE_EVENT(ext4_free_blocks,
797 TP_PROTO(struct inode *inode, __u64 block, unsigned long count,
Theodore Ts'oe6362602009-11-23 07:17:05 -0500798 int flags),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400799
Theodore Ts'oe6362602009-11-23 07:17:05 -0500800 TP_ARGS(inode, block, count, flags),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400801
802 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400803 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400804 __field( ino_t, ino )
805 __field( __u64, block )
806 __field( unsigned long, count )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400807 __field( int, flags )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400808 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400809 ),
810
811 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400812 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400813 __entry->ino = inode->i_ino;
814 __entry->block = block;
815 __entry->count = count;
Theodore Ts'oe6362602009-11-23 07:17:05 -0500816 __entry->flags = flags;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400817 __entry->mode = inode->i_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400818 ),
819
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400820 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %s",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400821 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400822 (unsigned long) __entry->ino,
Theodore Ts'oe6362602009-11-23 07:17:05 -0500823 __entry->mode, __entry->block, __entry->count,
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400824 show_free_flags(__entry->flags))
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400825);
826
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400827TRACE_EVENT(ext4_sync_file_enter,
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200828 TP_PROTO(struct file *file, int datasync),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400829
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200830 TP_ARGS(file, datasync),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400831
832 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400833 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400834 __field( ino_t, ino )
835 __field( ino_t, parent )
836 __field( int, datasync )
837 ),
838
839 TP_fast_assign(
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200840 struct dentry *dentry = file->f_path.dentry;
841
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400842 __entry->dev = dentry->d_inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400843 __entry->ino = dentry->d_inode->i_ino;
844 __entry->datasync = datasync;
845 __entry->parent = dentry->d_parent->d_inode->i_ino;
846 ),
847
Lukas Czernera9c667f2011-06-06 09:51:52 -0400848 TP_printk("dev %d,%d ino %lu parent %lu datasync %d ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400849 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400850 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400851 (unsigned long) __entry->parent, __entry->datasync)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400852);
853
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400854TRACE_EVENT(ext4_sync_file_exit,
855 TP_PROTO(struct inode *inode, int ret),
856
857 TP_ARGS(inode, ret),
858
859 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400860 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400861 __field( ino_t, ino )
862 __field( int, ret )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400863 ),
864
865 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400866 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400867 __entry->ino = inode->i_ino;
868 __entry->ret = ret;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400869 ),
870
Lukas Czernera9c667f2011-06-06 09:51:52 -0400871 TP_printk("dev %d,%d ino %lu ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400872 MAJOR(__entry->dev), MINOR(__entry->dev),
873 (unsigned long) __entry->ino,
874 __entry->ret)
875);
876
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400877TRACE_EVENT(ext4_sync_fs,
878 TP_PROTO(struct super_block *sb, int wait),
879
880 TP_ARGS(sb, wait),
881
882 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400883 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400884 __field( int, wait )
885
886 ),
887
888 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400889 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400890 __entry->wait = wait;
891 ),
892
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400893 TP_printk("dev %d,%d wait %d",
894 MAJOR(__entry->dev), MINOR(__entry->dev),
895 __entry->wait)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400896);
897
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400898TRACE_EVENT(ext4_alloc_da_blocks,
899 TP_PROTO(struct inode *inode),
900
901 TP_ARGS(inode),
902
903 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400904 __field( dev_t, dev )
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400905 __field( ino_t, ino )
906 __field( unsigned int, data_blocks )
907 __field( unsigned int, meta_blocks )
908 ),
909
910 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400911 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400912 __entry->ino = inode->i_ino;
913 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
914 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
915 ),
916
Theodore Ts'oa2690292010-10-27 22:08:50 -0400917 TP_printk("dev %d,%d ino %lu data_blocks %u meta_blocks %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400918 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400919 (unsigned long) __entry->ino,
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400920 __entry->data_blocks, __entry->meta_blocks)
921);
922
Theodore Ts'o296c3552009-09-30 00:32:42 -0400923TRACE_EVENT(ext4_mballoc_alloc,
924 TP_PROTO(struct ext4_allocation_context *ac),
925
926 TP_ARGS(ac),
927
928 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400929 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -0400930 __field( ino_t, ino )
Theodore Ts'o296c3552009-09-30 00:32:42 -0400931 __field( __u32, orig_logical )
932 __field( int, orig_start )
933 __field( __u32, orig_group )
934 __field( int, orig_len )
935 __field( __u32, goal_logical )
936 __field( int, goal_start )
937 __field( __u32, goal_group )
938 __field( int, goal_len )
939 __field( __u32, result_logical )
940 __field( int, result_start )
941 __field( __u32, result_group )
942 __field( int, result_len )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400943 __field( __u16, found )
944 __field( __u16, groups )
945 __field( __u16, buddy )
946 __field( __u16, flags )
947 __field( __u16, tail )
948 __field( __u8, cr )
Theodore Ts'o296c3552009-09-30 00:32:42 -0400949 ),
950
951 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400952 __entry->dev = ac->ac_inode->i_sb->s_dev;
Theodore Ts'o296c3552009-09-30 00:32:42 -0400953 __entry->ino = ac->ac_inode->i_ino;
Theodore Ts'o296c3552009-09-30 00:32:42 -0400954 __entry->orig_logical = ac->ac_o_ex.fe_logical;
955 __entry->orig_start = ac->ac_o_ex.fe_start;
956 __entry->orig_group = ac->ac_o_ex.fe_group;
957 __entry->orig_len = ac->ac_o_ex.fe_len;
958 __entry->goal_logical = ac->ac_g_ex.fe_logical;
959 __entry->goal_start = ac->ac_g_ex.fe_start;
960 __entry->goal_group = ac->ac_g_ex.fe_group;
961 __entry->goal_len = ac->ac_g_ex.fe_len;
962 __entry->result_logical = ac->ac_f_ex.fe_logical;
963 __entry->result_start = ac->ac_f_ex.fe_start;
964 __entry->result_group = ac->ac_f_ex.fe_group;
965 __entry->result_len = ac->ac_f_ex.fe_len;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400966 __entry->found = ac->ac_found;
967 __entry->flags = ac->ac_flags;
968 __entry->groups = ac->ac_groups_scanned;
969 __entry->buddy = ac->ac_buddy;
970 __entry->tail = ac->ac_tail;
971 __entry->cr = ac->ac_criteria;
Theodore Ts'o296c3552009-09-30 00:32:42 -0400972 ),
973
Theodore Ts'oa2690292010-10-27 22:08:50 -0400974 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400975 "result %u/%d/%u@%u blks %u grps %u cr %u flags %s "
Theodore Ts'o296c3552009-09-30 00:32:42 -0400976 "tail %u broken %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400977 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400978 (unsigned long) __entry->ino,
Theodore Ts'o296c3552009-09-30 00:32:42 -0400979 __entry->orig_group, __entry->orig_start,
980 __entry->orig_len, __entry->orig_logical,
981 __entry->goal_group, __entry->goal_start,
982 __entry->goal_len, __entry->goal_logical,
983 __entry->result_group, __entry->result_start,
984 __entry->result_len, __entry->result_logical,
985 __entry->found, __entry->groups, __entry->cr,
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400986 show_mballoc_flags(__entry->flags), __entry->tail,
Theodore Ts'o296c3552009-09-30 00:32:42 -0400987 __entry->buddy ? 1 << __entry->buddy : 0)
988);
989
990TRACE_EVENT(ext4_mballoc_prealloc,
991 TP_PROTO(struct ext4_allocation_context *ac),
992
993 TP_ARGS(ac),
994
995 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400996 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -0400997 __field( ino_t, ino )
998 __field( __u32, orig_logical )
999 __field( int, orig_start )
1000 __field( __u32, orig_group )
1001 __field( int, orig_len )
1002 __field( __u32, result_logical )
1003 __field( int, result_start )
1004 __field( __u32, result_group )
1005 __field( int, result_len )
1006 ),
1007
1008 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001009 __entry->dev = ac->ac_inode->i_sb->s_dev;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001010 __entry->ino = ac->ac_inode->i_ino;
1011 __entry->orig_logical = ac->ac_o_ex.fe_logical;
1012 __entry->orig_start = ac->ac_o_ex.fe_start;
1013 __entry->orig_group = ac->ac_o_ex.fe_group;
1014 __entry->orig_len = ac->ac_o_ex.fe_len;
1015 __entry->result_logical = ac->ac_b_ex.fe_logical;
1016 __entry->result_start = ac->ac_b_ex.fe_start;
1017 __entry->result_group = ac->ac_b_ex.fe_group;
1018 __entry->result_len = ac->ac_b_ex.fe_len;
1019 ),
1020
Theodore Ts'oa2690292010-10-27 22:08:50 -04001021 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001022 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001023 (unsigned long) __entry->ino,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001024 __entry->orig_group, __entry->orig_start,
1025 __entry->orig_len, __entry->orig_logical,
1026 __entry->result_group, __entry->result_start,
1027 __entry->result_len, __entry->result_logical)
1028);
1029
Li Zefanf084db92010-05-17 04:00:00 -04001030DECLARE_EVENT_CLASS(ext4__mballoc,
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001031 TP_PROTO(struct super_block *sb,
1032 struct inode *inode,
1033 ext4_group_t group,
1034 ext4_grpblk_t start,
1035 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001036
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001037 TP_ARGS(sb, inode, group, start, len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001038
1039 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001040 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001041 __field( ino_t, ino )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001042 __field( int, result_start )
1043 __field( __u32, result_group )
1044 __field( int, result_len )
1045 ),
1046
1047 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001048 __entry->dev = sb->s_dev;
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001049 __entry->ino = inode ? inode->i_ino : 0;
1050 __entry->result_start = start;
1051 __entry->result_group = group;
1052 __entry->result_len = len;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001053 ),
1054
Lukas Czernera9c667f2011-06-06 09:51:52 -04001055 TP_printk("dev %d,%d inode %lu extent %u/%d/%d ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001056 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001057 (unsigned long) __entry->ino,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001058 __entry->result_group, __entry->result_start,
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001059 __entry->result_len)
Theodore Ts'o296c3552009-09-30 00:32:42 -04001060);
1061
Li Zefanf084db92010-05-17 04:00:00 -04001062DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard,
1063
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001064 TP_PROTO(struct super_block *sb,
1065 struct inode *inode,
1066 ext4_group_t group,
1067 ext4_grpblk_t start,
1068 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001069
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001070 TP_ARGS(sb, inode, group, start, len)
Li Zefanf084db92010-05-17 04:00:00 -04001071);
Theodore Ts'o296c3552009-09-30 00:32:42 -04001072
Li Zefanf084db92010-05-17 04:00:00 -04001073DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001074
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001075 TP_PROTO(struct super_block *sb,
1076 struct inode *inode,
1077 ext4_group_t group,
1078 ext4_grpblk_t start,
1079 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001080
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001081 TP_ARGS(sb, inode, group, start, len)
Theodore Ts'o296c3552009-09-30 00:32:42 -04001082);
1083
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001084TRACE_EVENT(ext4_forget,
1085 TP_PROTO(struct inode *inode, int is_metadata, __u64 block),
1086
1087 TP_ARGS(inode, is_metadata, block),
1088
1089 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001090 __field( dev_t, dev )
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001091 __field( ino_t, ino )
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001092 __field( __u64, block )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001093 __field( int, is_metadata )
1094 __field( __u16, mode )
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001095 ),
1096
1097 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001098 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001099 __entry->ino = inode->i_ino;
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001100 __entry->block = block;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001101 __entry->is_metadata = is_metadata;
1102 __entry->mode = inode->i_mode;
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001103 ),
1104
Theodore Ts'oa2690292010-10-27 22:08:50 -04001105 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001106 MAJOR(__entry->dev), MINOR(__entry->dev),
1107 (unsigned long) __entry->ino,
1108 __entry->mode, __entry->is_metadata, __entry->block)
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001109);
1110
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001111TRACE_EVENT(ext4_da_update_reserve_space,
Aditya Kalid8990242011-09-09 19:18:51 -04001112 TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001113
Aditya Kalid8990242011-09-09 19:18:51 -04001114 TP_ARGS(inode, used_blocks, quota_claim),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001115
1116 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001117 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001118 __field( ino_t, ino )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001119 __field( __u64, i_blocks )
1120 __field( int, used_blocks )
1121 __field( int, reserved_data_blocks )
1122 __field( int, reserved_meta_blocks )
1123 __field( int, allocated_meta_blocks )
Aditya Kalid8990242011-09-09 19:18:51 -04001124 __field( int, quota_claim )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001125 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001126 ),
1127
1128 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001129 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001130 __entry->ino = inode->i_ino;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001131 __entry->i_blocks = inode->i_blocks;
1132 __entry->used_blocks = used_blocks;
Aditya Kalid8990242011-09-09 19:18:51 -04001133 __entry->reserved_data_blocks =
1134 EXT4_I(inode)->i_reserved_data_blocks;
1135 __entry->reserved_meta_blocks =
1136 EXT4_I(inode)->i_reserved_meta_blocks;
1137 __entry->allocated_meta_blocks =
1138 EXT4_I(inode)->i_allocated_meta_blocks;
1139 __entry->quota_claim = quota_claim;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001140 __entry->mode = inode->i_mode;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001141 ),
1142
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001143 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
1144 "reserved_data_blocks %d reserved_meta_blocks %d "
Aditya Kalid8990242011-09-09 19:18:51 -04001145 "allocated_meta_blocks %d quota_claim %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001146 MAJOR(__entry->dev), MINOR(__entry->dev),
1147 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001148 __entry->mode, __entry->i_blocks,
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001149 __entry->used_blocks, __entry->reserved_data_blocks,
Aditya Kalid8990242011-09-09 19:18:51 -04001150 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks,
1151 __entry->quota_claim)
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001152);
1153
1154TRACE_EVENT(ext4_da_reserve_space,
1155 TP_PROTO(struct inode *inode, int md_needed),
1156
1157 TP_ARGS(inode, md_needed),
1158
1159 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001160 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001161 __field( ino_t, ino )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001162 __field( __u64, i_blocks )
1163 __field( int, md_needed )
1164 __field( int, reserved_data_blocks )
1165 __field( int, reserved_meta_blocks )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001166 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001167 ),
1168
1169 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001170 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001171 __entry->ino = inode->i_ino;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001172 __entry->i_blocks = inode->i_blocks;
1173 __entry->md_needed = md_needed;
1174 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1175 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001176 __entry->mode = inode->i_mode;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001177 ),
1178
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001179 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu md_needed %d "
1180 "reserved_data_blocks %d reserved_meta_blocks %d",
1181 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001182 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001183 __entry->mode, __entry->i_blocks,
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001184 __entry->md_needed, __entry->reserved_data_blocks,
1185 __entry->reserved_meta_blocks)
1186);
1187
1188TRACE_EVENT(ext4_da_release_space,
1189 TP_PROTO(struct inode *inode, int freed_blocks),
1190
1191 TP_ARGS(inode, freed_blocks),
1192
1193 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001194 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001195 __field( ino_t, ino )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001196 __field( __u64, i_blocks )
1197 __field( int, freed_blocks )
1198 __field( int, reserved_data_blocks )
1199 __field( int, reserved_meta_blocks )
1200 __field( int, allocated_meta_blocks )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001201 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001202 ),
1203
1204 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001205 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001206 __entry->ino = inode->i_ino;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001207 __entry->i_blocks = inode->i_blocks;
1208 __entry->freed_blocks = freed_blocks;
1209 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1210 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
1211 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001212 __entry->mode = inode->i_mode;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001213 ),
1214
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001215 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
1216 "reserved_data_blocks %d reserved_meta_blocks %d "
1217 "allocated_meta_blocks %d",
1218 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001219 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001220 __entry->mode, __entry->i_blocks,
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001221 __entry->freed_blocks, __entry->reserved_data_blocks,
1222 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
1223);
1224
Theodore Ts'of3073332010-05-17 03:00:00 -04001225DECLARE_EVENT_CLASS(ext4__bitmap_load,
1226 TP_PROTO(struct super_block *sb, unsigned long group),
1227
1228 TP_ARGS(sb, group),
1229
1230 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001231 __field( dev_t, dev )
Theodore Ts'of3073332010-05-17 03:00:00 -04001232 __field( __u32, group )
1233
1234 ),
1235
1236 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001237 __entry->dev = sb->s_dev;
Theodore Ts'of3073332010-05-17 03:00:00 -04001238 __entry->group = group;
1239 ),
1240
Theodore Ts'oa2690292010-10-27 22:08:50 -04001241 TP_printk("dev %d,%d group %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001242 MAJOR(__entry->dev), MINOR(__entry->dev),
1243 __entry->group)
Theodore Ts'of3073332010-05-17 03:00:00 -04001244);
1245
1246DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
1247
1248 TP_PROTO(struct super_block *sb, unsigned long group),
1249
1250 TP_ARGS(sb, group)
1251);
1252
1253DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
1254
1255 TP_PROTO(struct super_block *sb, unsigned long group),
1256
1257 TP_ARGS(sb, group)
1258);
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001259
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001260DEFINE_EVENT(ext4__bitmap_load, ext4_read_block_bitmap_load,
1261
1262 TP_PROTO(struct super_block *sb, unsigned long group),
1263
1264 TP_ARGS(sb, group)
1265);
1266
1267DEFINE_EVENT(ext4__bitmap_load, ext4_load_inode_bitmap,
1268
1269 TP_PROTO(struct super_block *sb, unsigned long group),
1270
1271 TP_ARGS(sb, group)
1272);
1273
1274TRACE_EVENT(ext4_direct_IO_enter,
1275 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
1276
1277 TP_ARGS(inode, offset, len, rw),
1278
1279 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001280 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001281 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001282 __field( loff_t, pos )
1283 __field( unsigned long, len )
1284 __field( int, rw )
1285 ),
1286
1287 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001288 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001289 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001290 __entry->pos = offset;
1291 __entry->len = len;
1292 __entry->rw = rw;
1293 ),
1294
Lukas Czernera9c667f2011-06-06 09:51:52 -04001295 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001296 MAJOR(__entry->dev), MINOR(__entry->dev),
1297 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001298 __entry->pos, __entry->len, __entry->rw)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001299);
1300
1301TRACE_EVENT(ext4_direct_IO_exit,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001302 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
1303 int rw, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001304
1305 TP_ARGS(inode, offset, len, rw, ret),
1306
1307 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001308 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001309 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001310 __field( loff_t, pos )
1311 __field( unsigned long, len )
1312 __field( int, rw )
1313 __field( int, ret )
1314 ),
1315
1316 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001317 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001318 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001319 __entry->pos = offset;
1320 __entry->len = len;
1321 __entry->rw = rw;
1322 __entry->ret = ret;
1323 ),
1324
Lukas Czernera9c667f2011-06-06 09:51:52 -04001325 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001326 MAJOR(__entry->dev), MINOR(__entry->dev),
1327 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001328 __entry->pos, __entry->len,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001329 __entry->rw, __entry->ret)
1330);
1331
1332TRACE_EVENT(ext4_fallocate_enter,
1333 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1334
1335 TP_ARGS(inode, offset, len, mode),
1336
1337 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001338 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001339 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001340 __field( loff_t, pos )
1341 __field( loff_t, len )
1342 __field( int, mode )
1343 ),
1344
1345 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001346 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001347 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001348 __entry->pos = offset;
1349 __entry->len = len;
1350 __entry->mode = mode;
1351 ),
1352
Lukas Czernera9c667f2011-06-06 09:51:52 -04001353 TP_printk("dev %d,%d ino %lu pos %lld len %lld mode %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001354 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -04001355 (unsigned long) __entry->ino, __entry->pos,
1356 __entry->len, __entry->mode)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001357);
1358
1359TRACE_EVENT(ext4_fallocate_exit,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001360 TP_PROTO(struct inode *inode, loff_t offset,
1361 unsigned int max_blocks, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001362
1363 TP_ARGS(inode, offset, max_blocks, ret),
1364
1365 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001366 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001367 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001368 __field( loff_t, pos )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001369 __field( unsigned int, blocks )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001370 __field( int, ret )
1371 ),
1372
1373 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001374 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001375 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001376 __entry->pos = offset;
1377 __entry->blocks = max_blocks;
1378 __entry->ret = ret;
1379 ),
1380
Lukas Czernera9c667f2011-06-06 09:51:52 -04001381 TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001382 MAJOR(__entry->dev), MINOR(__entry->dev),
1383 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001384 __entry->pos, __entry->blocks,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001385 __entry->ret)
1386);
1387
Zheng Liuaaddea82013-01-16 20:21:26 -05001388TRACE_EVENT(ext4_punch_hole,
1389 TP_PROTO(struct inode *inode, loff_t offset, loff_t len),
1390
1391 TP_ARGS(inode, offset, len),
1392
1393 TP_STRUCT__entry(
1394 __field( dev_t, dev )
1395 __field( ino_t, ino )
1396 __field( loff_t, offset )
1397 __field( loff_t, len )
1398 ),
1399
1400 TP_fast_assign(
1401 __entry->dev = inode->i_sb->s_dev;
1402 __entry->ino = inode->i_ino;
1403 __entry->offset = offset;
1404 __entry->len = len;
1405 ),
1406
1407 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
1408 MAJOR(__entry->dev), MINOR(__entry->dev),
1409 (unsigned long) __entry->ino,
1410 __entry->offset, __entry->len)
1411);
1412
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001413TRACE_EVENT(ext4_unlink_enter,
1414 TP_PROTO(struct inode *parent, struct dentry *dentry),
1415
1416 TP_ARGS(parent, dentry),
1417
1418 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001419 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001420 __field( ino_t, ino )
1421 __field( ino_t, parent )
1422 __field( loff_t, size )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001423 ),
1424
1425 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001426 __entry->dev = dentry->d_inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001427 __entry->ino = dentry->d_inode->i_ino;
1428 __entry->parent = parent->i_ino;
1429 __entry->size = dentry->d_inode->i_size;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001430 ),
1431
Lukas Czernera9c667f2011-06-06 09:51:52 -04001432 TP_printk("dev %d,%d ino %lu size %lld parent %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001433 MAJOR(__entry->dev), MINOR(__entry->dev),
1434 (unsigned long) __entry->ino, __entry->size,
1435 (unsigned long) __entry->parent)
1436);
1437
1438TRACE_EVENT(ext4_unlink_exit,
1439 TP_PROTO(struct dentry *dentry, int ret),
1440
1441 TP_ARGS(dentry, ret),
1442
1443 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001444 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001445 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001446 __field( int, ret )
1447 ),
1448
1449 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001450 __entry->dev = dentry->d_inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001451 __entry->ino = dentry->d_inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001452 __entry->ret = ret;
1453 ),
1454
Lukas Czernera9c667f2011-06-06 09:51:52 -04001455 TP_printk("dev %d,%d ino %lu ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001456 MAJOR(__entry->dev), MINOR(__entry->dev),
1457 (unsigned long) __entry->ino,
1458 __entry->ret)
1459);
1460
1461DECLARE_EVENT_CLASS(ext4__truncate,
1462 TP_PROTO(struct inode *inode),
1463
1464 TP_ARGS(inode),
1465
1466 TP_STRUCT__entry(
Anatol Pomozov210c0522012-08-17 09:50:17 -04001467 __field( dev_t, dev )
1468 __field( ino_t, ino )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001469 __field( __u64, blocks )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001470 ),
1471
1472 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001473 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001474 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001475 __entry->blocks = inode->i_blocks;
1476 ),
1477
Lukas Czernera9c667f2011-06-06 09:51:52 -04001478 TP_printk("dev %d,%d ino %lu blocks %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001479 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -04001480 (unsigned long) __entry->ino, __entry->blocks)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001481);
1482
1483DEFINE_EVENT(ext4__truncate, ext4_truncate_enter,
1484
1485 TP_PROTO(struct inode *inode),
1486
1487 TP_ARGS(inode)
1488);
1489
1490DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
1491
1492 TP_PROTO(struct inode *inode),
1493
1494 TP_ARGS(inode)
1495);
1496
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001497/* 'ux' is the uninitialized extent. */
1498TRACE_EVENT(ext4_ext_convert_to_initialized_enter,
1499 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1500 struct ext4_extent *ux),
1501
1502 TP_ARGS(inode, map, ux),
1503
1504 TP_STRUCT__entry(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001505 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001506 __field( ino_t, ino )
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001507 __field( ext4_lblk_t, m_lblk )
1508 __field( unsigned, m_len )
1509 __field( ext4_lblk_t, u_lblk )
1510 __field( unsigned, u_len )
1511 __field( ext4_fsblk_t, u_pblk )
1512 ),
1513
1514 TP_fast_assign(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001515 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001516 __entry->ino = inode->i_ino;
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001517 __entry->m_lblk = map->m_lblk;
1518 __entry->m_len = map->m_len;
1519 __entry->u_lblk = le32_to_cpu(ux->ee_block);
1520 __entry->u_len = ext4_ext_get_actual_len(ux);
1521 __entry->u_pblk = ext4_ext_pblock(ux);
1522 ),
1523
1524 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u u_lblk %u u_len %u "
1525 "u_pblk %llu",
1526 MAJOR(__entry->dev), MINOR(__entry->dev),
1527 (unsigned long) __entry->ino,
1528 __entry->m_lblk, __entry->m_len,
1529 __entry->u_lblk, __entry->u_len, __entry->u_pblk)
1530);
1531
1532/*
1533 * 'ux' is the uninitialized extent.
1534 * 'ix' is the initialized extent to which blocks are transferred.
1535 */
1536TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath,
1537 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1538 struct ext4_extent *ux, struct ext4_extent *ix),
1539
1540 TP_ARGS(inode, map, ux, ix),
1541
1542 TP_STRUCT__entry(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001543 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001544 __field( ino_t, ino )
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001545 __field( ext4_lblk_t, m_lblk )
1546 __field( unsigned, m_len )
1547 __field( ext4_lblk_t, u_lblk )
1548 __field( unsigned, u_len )
1549 __field( ext4_fsblk_t, u_pblk )
1550 __field( ext4_lblk_t, i_lblk )
1551 __field( unsigned, i_len )
1552 __field( ext4_fsblk_t, i_pblk )
1553 ),
1554
1555 TP_fast_assign(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001556 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001557 __entry->ino = inode->i_ino;
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001558 __entry->m_lblk = map->m_lblk;
1559 __entry->m_len = map->m_len;
1560 __entry->u_lblk = le32_to_cpu(ux->ee_block);
1561 __entry->u_len = ext4_ext_get_actual_len(ux);
1562 __entry->u_pblk = ext4_ext_pblock(ux);
1563 __entry->i_lblk = le32_to_cpu(ix->ee_block);
1564 __entry->i_len = ext4_ext_get_actual_len(ix);
1565 __entry->i_pblk = ext4_ext_pblock(ix);
1566 ),
1567
1568 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u "
1569 "u_lblk %u u_len %u u_pblk %llu "
1570 "i_lblk %u i_len %u i_pblk %llu ",
1571 MAJOR(__entry->dev), MINOR(__entry->dev),
1572 (unsigned long) __entry->ino,
1573 __entry->m_lblk, __entry->m_len,
1574 __entry->u_lblk, __entry->u_len, __entry->u_pblk,
1575 __entry->i_lblk, __entry->i_len, __entry->i_pblk)
1576);
1577
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001578DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1579 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001580 unsigned int len, unsigned int flags),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001581
1582 TP_ARGS(inode, lblk, len, flags),
1583
1584 TP_STRUCT__entry(
Anatol Pomozov210c0522012-08-17 09:50:17 -04001585 __field( dev_t, dev )
1586 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001587 __field( ext4_lblk_t, lblk )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001588 __field( unsigned int, len )
1589 __field( unsigned int, flags )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001590 ),
1591
1592 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001593 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001594 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001595 __entry->lblk = lblk;
1596 __entry->len = len;
1597 __entry->flags = flags;
1598 ),
1599
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001600 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %s",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001601 MAJOR(__entry->dev), MINOR(__entry->dev),
1602 (unsigned long) __entry->ino,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001603 __entry->lblk, __entry->len, show_map_flags(__entry->flags))
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001604);
1605
1606DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter,
1607 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1608 unsigned len, unsigned flags),
1609
1610 TP_ARGS(inode, lblk, len, flags)
1611);
1612
1613DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter,
1614 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1615 unsigned len, unsigned flags),
1616
1617 TP_ARGS(inode, lblk, len, flags)
1618);
1619
1620DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001621 TP_PROTO(struct inode *inode, unsigned flags, struct ext4_map_blocks *map,
1622 int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001623
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001624 TP_ARGS(inode, flags, map, ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001625
1626 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001627 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001628 __field( ino_t, ino )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001629 __field( unsigned int, flags )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001630 __field( ext4_fsblk_t, pblk )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001631 __field( ext4_lblk_t, lblk )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001632 __field( unsigned int, len )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001633 __field( unsigned int, mflags )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001634 __field( int, ret )
1635 ),
1636
1637 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001638 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001639 __entry->ino = inode->i_ino;
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001640 __entry->flags = flags;
Zheng Liu19b303d2012-11-08 14:34:04 -05001641 __entry->pblk = map->m_pblk;
1642 __entry->lblk = map->m_lblk;
1643 __entry->len = map->m_len;
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001644 __entry->mflags = map->m_flags;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001645 __entry->ret = ret;
1646 ),
1647
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001648 TP_printk("dev %d,%d ino %lu flags %s lblk %u pblk %llu len %u "
1649 "mflags %s ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001650 MAJOR(__entry->dev), MINOR(__entry->dev),
1651 (unsigned long) __entry->ino,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001652 show_map_flags(__entry->flags), __entry->lblk, __entry->pblk,
1653 __entry->len, show_mflags(__entry->mflags), __entry->ret)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001654);
1655
1656DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001657 TP_PROTO(struct inode *inode, unsigned flags,
1658 struct ext4_map_blocks *map, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001659
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001660 TP_ARGS(inode, flags, map, ret)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001661);
1662
1663DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001664 TP_PROTO(struct inode *inode, unsigned flags,
1665 struct ext4_map_blocks *map, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001666
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001667 TP_ARGS(inode, flags, map, ret)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001668);
1669
1670TRACE_EVENT(ext4_ext_load_extent,
1671 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk),
1672
1673 TP_ARGS(inode, lblk, pblk),
1674
1675 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001676 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001677 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001678 __field( ext4_fsblk_t, pblk )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001679 __field( ext4_lblk_t, lblk )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001680 ),
1681
1682 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001683 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001684 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001685 __entry->pblk = pblk;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001686 __entry->lblk = lblk;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001687 ),
1688
1689 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1690 MAJOR(__entry->dev), MINOR(__entry->dev),
1691 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001692 __entry->lblk, __entry->pblk)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001693);
1694
1695TRACE_EVENT(ext4_load_inode,
1696 TP_PROTO(struct inode *inode),
1697
1698 TP_ARGS(inode),
1699
1700 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001701 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001702 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001703 ),
1704
1705 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001706 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001707 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001708 ),
1709
1710 TP_printk("dev %d,%d ino %ld",
1711 MAJOR(__entry->dev), MINOR(__entry->dev),
1712 (unsigned long) __entry->ino)
1713);
1714
Theodore Ts'o12706392011-07-10 22:37:50 -04001715TRACE_EVENT(ext4_journal_start,
Jan Kara5fe2fe82013-06-04 12:37:50 -04001716 TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks,
1717 unsigned long IP),
Theodore Ts'o12706392011-07-10 22:37:50 -04001718
Jan Kara5fe2fe82013-06-04 12:37:50 -04001719 TP_ARGS(sb, blocks, rsv_blocks, IP),
Theodore Ts'o12706392011-07-10 22:37:50 -04001720
1721 TP_STRUCT__entry(
1722 __field( dev_t, dev )
Theodore Ts'o12706392011-07-10 22:37:50 -04001723 __field(unsigned long, ip )
Jan Kara5fe2fe82013-06-04 12:37:50 -04001724 __field( int, blocks )
1725 __field( int, rsv_blocks )
Theodore Ts'o12706392011-07-10 22:37:50 -04001726 ),
1727
1728 TP_fast_assign(
Jan Kara5fe2fe82013-06-04 12:37:50 -04001729 __entry->dev = sb->s_dev;
1730 __entry->ip = IP;
1731 __entry->blocks = blocks;
1732 __entry->rsv_blocks = rsv_blocks;
Theodore Ts'o12706392011-07-10 22:37:50 -04001733 ),
1734
Jan Kara5fe2fe82013-06-04 12:37:50 -04001735 TP_printk("dev %d,%d blocks, %d rsv_blocks, %d caller %pF",
Theodore Ts'o12706392011-07-10 22:37:50 -04001736 MAJOR(__entry->dev), MINOR(__entry->dev),
Jan Kara5fe2fe82013-06-04 12:37:50 -04001737 __entry->blocks, __entry->rsv_blocks, (void *)__entry->ip)
1738);
1739
1740TRACE_EVENT(ext4_journal_start_reserved,
1741 TP_PROTO(struct super_block *sb, int blocks, unsigned long IP),
1742
1743 TP_ARGS(sb, blocks, IP),
1744
1745 TP_STRUCT__entry(
1746 __field( dev_t, dev )
1747 __field(unsigned long, ip )
1748 __field( int, blocks )
1749 ),
1750
1751 TP_fast_assign(
1752 __entry->dev = sb->s_dev;
1753 __entry->ip = IP;
1754 __entry->blocks = blocks;
1755 ),
1756
1757 TP_printk("dev %d,%d blocks, %d caller %pF",
1758 MAJOR(__entry->dev), MINOR(__entry->dev),
1759 __entry->blocks, (void *)__entry->ip)
Theodore Ts'o12706392011-07-10 22:37:50 -04001760);
1761
Tao Mab3d4c2b2011-07-11 00:01:52 -04001762DECLARE_EVENT_CLASS(ext4__trim,
1763 TP_PROTO(struct super_block *sb,
1764 ext4_group_t group,
1765 ext4_grpblk_t start,
1766 ext4_grpblk_t len),
1767
1768 TP_ARGS(sb, group, start, len),
1769
1770 TP_STRUCT__entry(
1771 __field( int, dev_major )
1772 __field( int, dev_minor )
1773 __field( __u32, group )
1774 __field( int, start )
1775 __field( int, len )
1776 ),
1777
1778 TP_fast_assign(
1779 __entry->dev_major = MAJOR(sb->s_dev);
1780 __entry->dev_minor = MINOR(sb->s_dev);
1781 __entry->group = group;
1782 __entry->start = start;
1783 __entry->len = len;
1784 ),
1785
1786 TP_printk("dev %d,%d group %u, start %d, len %d",
1787 __entry->dev_major, __entry->dev_minor,
1788 __entry->group, __entry->start, __entry->len)
1789);
1790
1791DEFINE_EVENT(ext4__trim, ext4_trim_extent,
1792
1793 TP_PROTO(struct super_block *sb,
1794 ext4_group_t group,
1795 ext4_grpblk_t start,
1796 ext4_grpblk_t len),
1797
1798 TP_ARGS(sb, group, start, len)
1799);
1800
1801DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
1802
1803 TP_PROTO(struct super_block *sb,
1804 ext4_group_t group,
1805 ext4_grpblk_t start,
1806 ext4_grpblk_t len),
1807
1808 TP_ARGS(sb, group, start, len)
1809);
1810
Aditya Kalid8990242011-09-09 19:18:51 -04001811TRACE_EVENT(ext4_ext_handle_uninitialized_extents,
Zheng Liub5645532012-11-08 14:33:43 -05001812 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int flags,
Aditya Kalid8990242011-09-09 19:18:51 -04001813 unsigned int allocated, ext4_fsblk_t newblock),
1814
Zheng Liub5645532012-11-08 14:33:43 -05001815 TP_ARGS(inode, map, flags, allocated, newblock),
Aditya Kalid8990242011-09-09 19:18:51 -04001816
1817 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001818 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001819 __field( ino_t, ino )
1820 __field( int, flags )
Aditya Kalid8990242011-09-09 19:18:51 -04001821 __field( ext4_lblk_t, lblk )
1822 __field( ext4_fsblk_t, pblk )
1823 __field( unsigned int, len )
Aditya Kalid8990242011-09-09 19:18:51 -04001824 __field( unsigned int, allocated )
1825 __field( ext4_fsblk_t, newblk )
1826 ),
1827
1828 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001829 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001830 __entry->ino = inode->i_ino;
Zheng Liub5645532012-11-08 14:33:43 -05001831 __entry->flags = flags;
Aditya Kalid8990242011-09-09 19:18:51 -04001832 __entry->lblk = map->m_lblk;
1833 __entry->pblk = map->m_pblk;
1834 __entry->len = map->m_len;
Aditya Kalid8990242011-09-09 19:18:51 -04001835 __entry->allocated = allocated;
1836 __entry->newblk = newblock;
1837 ),
1838
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001839 TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %s "
Aditya Kalid8990242011-09-09 19:18:51 -04001840 "allocated %d newblock %llu",
1841 MAJOR(__entry->dev), MINOR(__entry->dev),
1842 (unsigned long) __entry->ino,
1843 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001844 __entry->len, show_map_flags(__entry->flags),
Aditya Kalid8990242011-09-09 19:18:51 -04001845 (unsigned int) __entry->allocated,
1846 (unsigned long long) __entry->newblk)
1847);
1848
1849TRACE_EVENT(ext4_get_implied_cluster_alloc_exit,
1850 TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret),
1851
1852 TP_ARGS(sb, map, ret),
1853
1854 TP_STRUCT__entry(
1855 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001856 __field( unsigned int, flags )
Aditya Kalid8990242011-09-09 19:18:51 -04001857 __field( ext4_lblk_t, lblk )
1858 __field( ext4_fsblk_t, pblk )
1859 __field( unsigned int, len )
Aditya Kalid8990242011-09-09 19:18:51 -04001860 __field( int, ret )
1861 ),
1862
1863 TP_fast_assign(
1864 __entry->dev = sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001865 __entry->flags = map->m_flags;
Aditya Kalid8990242011-09-09 19:18:51 -04001866 __entry->lblk = map->m_lblk;
1867 __entry->pblk = map->m_pblk;
1868 __entry->len = map->m_len;
Aditya Kalid8990242011-09-09 19:18:51 -04001869 __entry->ret = ret;
1870 ),
1871
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001872 TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %s ret %d",
Aditya Kalid8990242011-09-09 19:18:51 -04001873 MAJOR(__entry->dev), MINOR(__entry->dev),
1874 __entry->lblk, (unsigned long long) __entry->pblk,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001875 __entry->len, show_mflags(__entry->flags), __entry->ret)
Aditya Kalid8990242011-09-09 19:18:51 -04001876);
1877
1878TRACE_EVENT(ext4_ext_put_in_cache,
1879 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len,
1880 ext4_fsblk_t start),
1881
1882 TP_ARGS(inode, lblk, len, start),
1883
1884 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001885 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001886 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04001887 __field( ext4_lblk_t, lblk )
1888 __field( unsigned int, len )
1889 __field( ext4_fsblk_t, start )
1890 ),
1891
1892 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001893 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001894 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04001895 __entry->lblk = lblk;
1896 __entry->len = len;
1897 __entry->start = start;
1898 ),
1899
1900 TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu",
1901 MAJOR(__entry->dev), MINOR(__entry->dev),
1902 (unsigned long) __entry->ino,
1903 (unsigned) __entry->lblk,
1904 __entry->len,
1905 (unsigned long long) __entry->start)
1906);
1907
1908TRACE_EVENT(ext4_ext_in_cache,
1909 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret),
1910
1911 TP_ARGS(inode, lblk, ret),
1912
1913 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001914 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001915 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04001916 __field( ext4_lblk_t, lblk )
1917 __field( int, ret )
1918 ),
1919
1920 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001921 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001922 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04001923 __entry->lblk = lblk;
1924 __entry->ret = ret;
1925 ),
1926
1927 TP_printk("dev %d,%d ino %lu lblk %u ret %d",
1928 MAJOR(__entry->dev), MINOR(__entry->dev),
1929 (unsigned long) __entry->ino,
1930 (unsigned) __entry->lblk,
1931 __entry->ret)
1932
1933);
1934
1935TRACE_EVENT(ext4_find_delalloc_range,
1936 TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to,
1937 int reverse, int found, ext4_lblk_t found_blk),
1938
1939 TP_ARGS(inode, from, to, reverse, found, found_blk),
1940
1941 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001942 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001943 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04001944 __field( ext4_lblk_t, from )
1945 __field( ext4_lblk_t, to )
1946 __field( int, reverse )
1947 __field( int, found )
1948 __field( ext4_lblk_t, found_blk )
1949 ),
1950
1951 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001952 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001953 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04001954 __entry->from = from;
1955 __entry->to = to;
1956 __entry->reverse = reverse;
1957 __entry->found = found;
1958 __entry->found_blk = found_blk;
1959 ),
1960
1961 TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d "
1962 "(blk = %u)",
1963 MAJOR(__entry->dev), MINOR(__entry->dev),
1964 (unsigned long) __entry->ino,
1965 (unsigned) __entry->from, (unsigned) __entry->to,
1966 __entry->reverse, __entry->found,
1967 (unsigned) __entry->found_blk)
1968);
1969
1970TRACE_EVENT(ext4_get_reserved_cluster_alloc,
1971 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len),
1972
1973 TP_ARGS(inode, lblk, len),
1974
1975 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001976 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001977 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04001978 __field( ext4_lblk_t, lblk )
1979 __field( unsigned int, len )
1980 ),
1981
1982 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001983 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001984 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04001985 __entry->lblk = lblk;
1986 __entry->len = len;
1987 ),
1988
1989 TP_printk("dev %d,%d ino %lu lblk %u len %u",
1990 MAJOR(__entry->dev), MINOR(__entry->dev),
1991 (unsigned long) __entry->ino,
1992 (unsigned) __entry->lblk,
1993 __entry->len)
1994);
1995
1996TRACE_EVENT(ext4_ext_show_extent,
1997 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk,
1998 unsigned short len),
1999
2000 TP_ARGS(inode, lblk, pblk, len),
2001
2002 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002003 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002004 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002005 __field( ext4_fsblk_t, pblk )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002006 __field( ext4_lblk_t, lblk )
Aditya Kalid8990242011-09-09 19:18:51 -04002007 __field( unsigned short, len )
2008 ),
2009
2010 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002011 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002012 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002013 __entry->pblk = pblk;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002014 __entry->lblk = lblk;
Aditya Kalid8990242011-09-09 19:18:51 -04002015 __entry->len = len;
2016 ),
2017
2018 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u",
2019 MAJOR(__entry->dev), MINOR(__entry->dev),
2020 (unsigned long) __entry->ino,
2021 (unsigned) __entry->lblk,
2022 (unsigned long long) __entry->pblk,
2023 (unsigned short) __entry->len)
2024);
2025
2026TRACE_EVENT(ext4_remove_blocks,
2027 TP_PROTO(struct inode *inode, struct ext4_extent *ex,
2028 ext4_lblk_t from, ext4_fsblk_t to,
Lukas Czernerd23142c2013-05-27 23:33:35 -04002029 long long partial_cluster),
Aditya Kalid8990242011-09-09 19:18:51 -04002030
2031 TP_ARGS(inode, ex, from, to, partial_cluster),
2032
2033 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002034 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002035 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002036 __field( ext4_lblk_t, from )
2037 __field( ext4_lblk_t, to )
Lukas Czernerd23142c2013-05-27 23:33:35 -04002038 __field( long long, partial )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002039 __field( ext4_fsblk_t, ee_pblk )
2040 __field( ext4_lblk_t, ee_lblk )
2041 __field( unsigned short, ee_len )
Aditya Kalid8990242011-09-09 19:18:51 -04002042 ),
2043
2044 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002045 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002046 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002047 __entry->from = from;
2048 __entry->to = to;
2049 __entry->partial = partial_cluster;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002050 __entry->ee_pblk = ext4_ext_pblock(ex);
Theodore Ts'od6a77102013-04-09 23:59:55 -04002051 __entry->ee_lblk = le32_to_cpu(ex->ee_block);
Anatol Pomozov210c0522012-08-17 09:50:17 -04002052 __entry->ee_len = ext4_ext_get_actual_len(ex);
Aditya Kalid8990242011-09-09 19:18:51 -04002053 ),
2054
2055 TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
Lukas Czernerd23142c2013-05-27 23:33:35 -04002056 "from %u to %u partial_cluster %lld",
Aditya Kalid8990242011-09-09 19:18:51 -04002057 MAJOR(__entry->dev), MINOR(__entry->dev),
2058 (unsigned long) __entry->ino,
2059 (unsigned) __entry->ee_lblk,
2060 (unsigned long long) __entry->ee_pblk,
2061 (unsigned short) __entry->ee_len,
2062 (unsigned) __entry->from,
2063 (unsigned) __entry->to,
Lukas Czernerd23142c2013-05-27 23:33:35 -04002064 (long long) __entry->partial)
Aditya Kalid8990242011-09-09 19:18:51 -04002065);
2066
2067TRACE_EVENT(ext4_ext_rm_leaf,
2068 TP_PROTO(struct inode *inode, ext4_lblk_t start,
Lukas Czernerd23142c2013-05-27 23:33:35 -04002069 struct ext4_extent *ex,
2070 long long partial_cluster),
Aditya Kalid8990242011-09-09 19:18:51 -04002071
2072 TP_ARGS(inode, start, ex, partial_cluster),
2073
2074 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002075 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002076 __field( ino_t, ino )
Lukas Czernerd23142c2013-05-27 23:33:35 -04002077 __field( long long, partial )
Aditya Kalid8990242011-09-09 19:18:51 -04002078 __field( ext4_lblk_t, start )
2079 __field( ext4_lblk_t, ee_lblk )
2080 __field( ext4_fsblk_t, ee_pblk )
2081 __field( short, ee_len )
Aditya Kalid8990242011-09-09 19:18:51 -04002082 ),
2083
2084 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002085 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002086 __entry->ino = inode->i_ino;
2087 __entry->partial = partial_cluster;
Aditya Kalid8990242011-09-09 19:18:51 -04002088 __entry->start = start;
2089 __entry->ee_lblk = le32_to_cpu(ex->ee_block);
2090 __entry->ee_pblk = ext4_ext_pblock(ex);
2091 __entry->ee_len = ext4_ext_get_actual_len(ex);
Aditya Kalid8990242011-09-09 19:18:51 -04002092 ),
2093
2094 TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
Lukas Czernerd23142c2013-05-27 23:33:35 -04002095 "partial_cluster %lld",
Aditya Kalid8990242011-09-09 19:18:51 -04002096 MAJOR(__entry->dev), MINOR(__entry->dev),
2097 (unsigned long) __entry->ino,
2098 (unsigned) __entry->start,
2099 (unsigned) __entry->ee_lblk,
2100 (unsigned long long) __entry->ee_pblk,
2101 (unsigned short) __entry->ee_len,
Lukas Czernerd23142c2013-05-27 23:33:35 -04002102 (long long) __entry->partial)
Aditya Kalid8990242011-09-09 19:18:51 -04002103);
2104
2105TRACE_EVENT(ext4_ext_rm_idx,
2106 TP_PROTO(struct inode *inode, ext4_fsblk_t pblk),
2107
2108 TP_ARGS(inode, pblk),
2109
2110 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002111 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002112 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002113 __field( ext4_fsblk_t, pblk )
2114 ),
2115
2116 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002117 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002118 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002119 __entry->pblk = pblk;
2120 ),
2121
2122 TP_printk("dev %d,%d ino %lu index_pblk %llu",
2123 MAJOR(__entry->dev), MINOR(__entry->dev),
2124 (unsigned long) __entry->ino,
2125 (unsigned long long) __entry->pblk)
2126);
2127
2128TRACE_EVENT(ext4_ext_remove_space,
Lukas Czerner61801322013-05-27 23:32:35 -04002129 TP_PROTO(struct inode *inode, ext4_lblk_t start,
2130 ext4_lblk_t end, int depth),
Aditya Kalid8990242011-09-09 19:18:51 -04002131
Lukas Czerner61801322013-05-27 23:32:35 -04002132 TP_ARGS(inode, start, end, depth),
Aditya Kalid8990242011-09-09 19:18:51 -04002133
2134 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002135 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002136 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002137 __field( ext4_lblk_t, start )
Lukas Czerner61801322013-05-27 23:32:35 -04002138 __field( ext4_lblk_t, end )
Aditya Kalid8990242011-09-09 19:18:51 -04002139 __field( int, depth )
2140 ),
2141
2142 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002143 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002144 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002145 __entry->start = start;
Lukas Czerner61801322013-05-27 23:32:35 -04002146 __entry->end = end;
Aditya Kalid8990242011-09-09 19:18:51 -04002147 __entry->depth = depth;
2148 ),
2149
Lukas Czerner61801322013-05-27 23:32:35 -04002150 TP_printk("dev %d,%d ino %lu since %u end %u depth %d",
Aditya Kalid8990242011-09-09 19:18:51 -04002151 MAJOR(__entry->dev), MINOR(__entry->dev),
2152 (unsigned long) __entry->ino,
2153 (unsigned) __entry->start,
Lukas Czerner61801322013-05-27 23:32:35 -04002154 (unsigned) __entry->end,
Aditya Kalid8990242011-09-09 19:18:51 -04002155 __entry->depth)
2156);
2157
2158TRACE_EVENT(ext4_ext_remove_space_done,
Lukas Czerner61801322013-05-27 23:32:35 -04002159 TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end,
Lukas Czernerd23142c2013-05-27 23:33:35 -04002160 int depth, long long partial, __le16 eh_entries),
Aditya Kalid8990242011-09-09 19:18:51 -04002161
Lukas Czerner61801322013-05-27 23:32:35 -04002162 TP_ARGS(inode, start, end, depth, partial, eh_entries),
Aditya Kalid8990242011-09-09 19:18:51 -04002163
2164 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002165 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002166 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002167 __field( ext4_lblk_t, start )
Lukas Czerner61801322013-05-27 23:32:35 -04002168 __field( ext4_lblk_t, end )
Aditya Kalid8990242011-09-09 19:18:51 -04002169 __field( int, depth )
Lukas Czernerd23142c2013-05-27 23:33:35 -04002170 __field( long long, partial )
Aditya Kalid8990242011-09-09 19:18:51 -04002171 __field( unsigned short, eh_entries )
2172 ),
2173
2174 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002175 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002176 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002177 __entry->start = start;
Lukas Czerner61801322013-05-27 23:32:35 -04002178 __entry->end = end;
Aditya Kalid8990242011-09-09 19:18:51 -04002179 __entry->depth = depth;
2180 __entry->partial = partial;
Theodore Ts'od6a77102013-04-09 23:59:55 -04002181 __entry->eh_entries = le16_to_cpu(eh_entries);
Aditya Kalid8990242011-09-09 19:18:51 -04002182 ),
2183
Lukas Czernerd23142c2013-05-27 23:33:35 -04002184 TP_printk("dev %d,%d ino %lu since %u end %u depth %d partial %lld "
Aditya Kalid8990242011-09-09 19:18:51 -04002185 "remaining_entries %u",
2186 MAJOR(__entry->dev), MINOR(__entry->dev),
2187 (unsigned long) __entry->ino,
2188 (unsigned) __entry->start,
Lukas Czerner61801322013-05-27 23:32:35 -04002189 (unsigned) __entry->end,
Aditya Kalid8990242011-09-09 19:18:51 -04002190 __entry->depth,
Lukas Czernerd23142c2013-05-27 23:33:35 -04002191 (long long) __entry->partial,
Aditya Kalid8990242011-09-09 19:18:51 -04002192 (unsigned short) __entry->eh_entries)
2193);
2194
Theodore Ts'o107a7bd2013-08-16 21:23:41 -04002195DECLARE_EVENT_CLASS(ext4__es_extent,
Zheng Liufdc02122013-02-18 00:26:51 -05002196 TP_PROTO(struct inode *inode, struct extent_status *es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002197
Zheng Liufdc02122013-02-18 00:26:51 -05002198 TP_ARGS(inode, es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002199
2200 TP_STRUCT__entry(
Zheng Liufdc02122013-02-18 00:26:51 -05002201 __field( dev_t, dev )
2202 __field( ino_t, ino )
2203 __field( ext4_lblk_t, lblk )
2204 __field( ext4_lblk_t, len )
2205 __field( ext4_fsblk_t, pblk )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002206 __field( char, status )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002207 ),
2208
2209 TP_fast_assign(
2210 __entry->dev = inode->i_sb->s_dev;
2211 __entry->ino = inode->i_ino;
Zheng Liufdc02122013-02-18 00:26:51 -05002212 __entry->lblk = es->es_lblk;
2213 __entry->len = es->es_len;
2214 __entry->pblk = ext4_es_pblock(es);
Theodore Ts'o3be78c72013-08-16 21:22:41 -04002215 __entry->status = ext4_es_status(es);
Zheng Liu992e9fd2012-11-08 21:57:33 -05002216 ),
2217
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002218 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
Zheng Liu992e9fd2012-11-08 21:57:33 -05002219 MAJOR(__entry->dev), MINOR(__entry->dev),
2220 (unsigned long) __entry->ino,
Zheng Liufdc02122013-02-18 00:26:51 -05002221 __entry->lblk, __entry->len,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002222 __entry->pblk, show_extent_status(__entry->status))
Zheng Liu992e9fd2012-11-08 21:57:33 -05002223);
2224
Theodore Ts'o107a7bd2013-08-16 21:23:41 -04002225DEFINE_EVENT(ext4__es_extent, ext4_es_insert_extent,
2226 TP_PROTO(struct inode *inode, struct extent_status *es),
2227
2228 TP_ARGS(inode, es)
2229);
2230
2231DEFINE_EVENT(ext4__es_extent, ext4_es_cache_extent,
2232 TP_PROTO(struct inode *inode, struct extent_status *es),
2233
2234 TP_ARGS(inode, es)
2235);
2236
Zheng Liu992e9fd2012-11-08 21:57:33 -05002237TRACE_EVENT(ext4_es_remove_extent,
Zheng Liu06b0c882013-02-18 00:26:51 -05002238 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002239
Zheng Liu06b0c882013-02-18 00:26:51 -05002240 TP_ARGS(inode, lblk, len),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002241
2242 TP_STRUCT__entry(
2243 __field( dev_t, dev )
2244 __field( ino_t, ino )
Zheng Liu06b0c882013-02-18 00:26:51 -05002245 __field( loff_t, lblk )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002246 __field( loff_t, len )
2247 ),
2248
2249 TP_fast_assign(
2250 __entry->dev = inode->i_sb->s_dev;
2251 __entry->ino = inode->i_ino;
Zheng Liu06b0c882013-02-18 00:26:51 -05002252 __entry->lblk = lblk;
Zheng Liu992e9fd2012-11-08 21:57:33 -05002253 __entry->len = len;
2254 ),
2255
2256 TP_printk("dev %d,%d ino %lu es [%lld/%lld)",
2257 MAJOR(__entry->dev), MINOR(__entry->dev),
2258 (unsigned long) __entry->ino,
Zheng Liu06b0c882013-02-18 00:26:51 -05002259 __entry->lblk, __entry->len)
Zheng Liu992e9fd2012-11-08 21:57:33 -05002260);
2261
Yan, Zhenge30b5dc2013-05-03 02:15:52 -04002262TRACE_EVENT(ext4_es_find_delayed_extent_range_enter,
Zheng Liu06b0c882013-02-18 00:26:51 -05002263 TP_PROTO(struct inode *inode, ext4_lblk_t lblk),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002264
Zheng Liu06b0c882013-02-18 00:26:51 -05002265 TP_ARGS(inode, lblk),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002266
2267 TP_STRUCT__entry(
2268 __field( dev_t, dev )
2269 __field( ino_t, ino )
Zheng Liu06b0c882013-02-18 00:26:51 -05002270 __field( ext4_lblk_t, lblk )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002271 ),
2272
2273 TP_fast_assign(
2274 __entry->dev = inode->i_sb->s_dev;
2275 __entry->ino = inode->i_ino;
Zheng Liu06b0c882013-02-18 00:26:51 -05002276 __entry->lblk = lblk;
Zheng Liu992e9fd2012-11-08 21:57:33 -05002277 ),
2278
Zheng Liu06b0c882013-02-18 00:26:51 -05002279 TP_printk("dev %d,%d ino %lu lblk %u",
Zheng Liu992e9fd2012-11-08 21:57:33 -05002280 MAJOR(__entry->dev), MINOR(__entry->dev),
Zheng Liu06b0c882013-02-18 00:26:51 -05002281 (unsigned long) __entry->ino, __entry->lblk)
Zheng Liu992e9fd2012-11-08 21:57:33 -05002282);
2283
Yan, Zhenge30b5dc2013-05-03 02:15:52 -04002284TRACE_EVENT(ext4_es_find_delayed_extent_range_exit,
Zheng Liube401362013-02-18 00:27:26 -05002285 TP_PROTO(struct inode *inode, struct extent_status *es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002286
Zheng Liube401362013-02-18 00:27:26 -05002287 TP_ARGS(inode, es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002288
2289 TP_STRUCT__entry(
2290 __field( dev_t, dev )
2291 __field( ino_t, ino )
Zheng Liu06b0c882013-02-18 00:26:51 -05002292 __field( ext4_lblk_t, lblk )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002293 __field( ext4_lblk_t, len )
Zheng Liufdc02122013-02-18 00:26:51 -05002294 __field( ext4_fsblk_t, pblk )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002295 __field( char, status )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002296 ),
2297
2298 TP_fast_assign(
2299 __entry->dev = inode->i_sb->s_dev;
2300 __entry->ino = inode->i_ino;
Zheng Liu06b0c882013-02-18 00:26:51 -05002301 __entry->lblk = es->es_lblk;
2302 __entry->len = es->es_len;
Zheng Liufdc02122013-02-18 00:26:51 -05002303 __entry->pblk = ext4_es_pblock(es);
Theodore Ts'o3be78c72013-08-16 21:22:41 -04002304 __entry->status = ext4_es_status(es);
Zheng Liu992e9fd2012-11-08 21:57:33 -05002305 ),
2306
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002307 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
Zheng Liu992e9fd2012-11-08 21:57:33 -05002308 MAJOR(__entry->dev), MINOR(__entry->dev),
2309 (unsigned long) __entry->ino,
Zheng Liufdc02122013-02-18 00:26:51 -05002310 __entry->lblk, __entry->len,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002311 __entry->pblk, show_extent_status(__entry->status))
Zheng Liu992e9fd2012-11-08 21:57:33 -05002312);
2313
Zheng Liud100eef2013-02-18 00:29:59 -05002314TRACE_EVENT(ext4_es_lookup_extent_enter,
2315 TP_PROTO(struct inode *inode, ext4_lblk_t lblk),
2316
2317 TP_ARGS(inode, lblk),
2318
2319 TP_STRUCT__entry(
2320 __field( dev_t, dev )
2321 __field( ino_t, ino )
2322 __field( ext4_lblk_t, lblk )
2323 ),
2324
2325 TP_fast_assign(
2326 __entry->dev = inode->i_sb->s_dev;
2327 __entry->ino = inode->i_ino;
2328 __entry->lblk = lblk;
2329 ),
2330
2331 TP_printk("dev %d,%d ino %lu lblk %u",
2332 MAJOR(__entry->dev), MINOR(__entry->dev),
2333 (unsigned long) __entry->ino, __entry->lblk)
2334);
2335
2336TRACE_EVENT(ext4_es_lookup_extent_exit,
2337 TP_PROTO(struct inode *inode, struct extent_status *es,
2338 int found),
2339
2340 TP_ARGS(inode, es, found),
2341
2342 TP_STRUCT__entry(
2343 __field( dev_t, dev )
2344 __field( ino_t, ino )
2345 __field( ext4_lblk_t, lblk )
2346 __field( ext4_lblk_t, len )
2347 __field( ext4_fsblk_t, pblk )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002348 __field( char, status )
Zheng Liud100eef2013-02-18 00:29:59 -05002349 __field( int, found )
2350 ),
2351
2352 TP_fast_assign(
2353 __entry->dev = inode->i_sb->s_dev;
2354 __entry->ino = inode->i_ino;
2355 __entry->lblk = es->es_lblk;
2356 __entry->len = es->es_len;
2357 __entry->pblk = ext4_es_pblock(es);
Theodore Ts'o3be78c72013-08-16 21:22:41 -04002358 __entry->status = ext4_es_status(es);
Zheng Liud100eef2013-02-18 00:29:59 -05002359 __entry->found = found;
2360 ),
2361
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002362 TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %s",
Zheng Liud100eef2013-02-18 00:29:59 -05002363 MAJOR(__entry->dev), MINOR(__entry->dev),
2364 (unsigned long) __entry->ino, __entry->found,
2365 __entry->lblk, __entry->len,
2366 __entry->found ? __entry->pblk : 0,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002367 show_extent_status(__entry->found ? __entry->status : 0))
Zheng Liud100eef2013-02-18 00:29:59 -05002368);
2369
Zheng Liu74cd15c2013-02-18 00:32:55 -05002370TRACE_EVENT(ext4_es_shrink_enter,
Theodore Ts'o24630772013-02-28 23:58:56 -05002371 TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002372
Theodore Ts'o24630772013-02-28 23:58:56 -05002373 TP_ARGS(sb, nr_to_scan, cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002374
2375 TP_STRUCT__entry(
2376 __field( dev_t, dev )
2377 __field( int, nr_to_scan )
Theodore Ts'o24630772013-02-28 23:58:56 -05002378 __field( int, cache_cnt )
Zheng Liu74cd15c2013-02-18 00:32:55 -05002379 ),
2380
2381 TP_fast_assign(
2382 __entry->dev = sb->s_dev;
2383 __entry->nr_to_scan = nr_to_scan;
Theodore Ts'o24630772013-02-28 23:58:56 -05002384 __entry->cache_cnt = cache_cnt;
Zheng Liu74cd15c2013-02-18 00:32:55 -05002385 ),
2386
Theodore Ts'o24630772013-02-28 23:58:56 -05002387 TP_printk("dev %d,%d nr_to_scan %d cache_cnt %d",
Zheng Liu74cd15c2013-02-18 00:32:55 -05002388 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o24630772013-02-28 23:58:56 -05002389 __entry->nr_to_scan, __entry->cache_cnt)
Zheng Liu74cd15c2013-02-18 00:32:55 -05002390);
2391
2392TRACE_EVENT(ext4_es_shrink_exit,
Theodore Ts'o24630772013-02-28 23:58:56 -05002393 TP_PROTO(struct super_block *sb, int shrunk_nr, int cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002394
Theodore Ts'o24630772013-02-28 23:58:56 -05002395 TP_ARGS(sb, shrunk_nr, cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002396
2397 TP_STRUCT__entry(
2398 __field( dev_t, dev )
2399 __field( int, shrunk_nr )
Theodore Ts'o24630772013-02-28 23:58:56 -05002400 __field( int, cache_cnt )
Zheng Liu74cd15c2013-02-18 00:32:55 -05002401 ),
2402
2403 TP_fast_assign(
2404 __entry->dev = sb->s_dev;
2405 __entry->shrunk_nr = shrunk_nr;
Theodore Ts'o24630772013-02-28 23:58:56 -05002406 __entry->cache_cnt = cache_cnt;
Zheng Liu74cd15c2013-02-18 00:32:55 -05002407 ),
2408
Theodore Ts'o24630772013-02-28 23:58:56 -05002409 TP_printk("dev %d,%d shrunk_nr %d cache_cnt %d",
Zheng Liu74cd15c2013-02-18 00:32:55 -05002410 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o24630772013-02-28 23:58:56 -05002411 __entry->shrunk_nr, __entry->cache_cnt)
Zheng Liu74cd15c2013-02-18 00:32:55 -05002412);
2413
Theodore Ts'o9bffad12009-06-17 11:48:11 -04002414#endif /* _TRACE_EXT4_H */
2415
2416/* This part must be outside protection */
2417#include <trace/define_trace.h>