blob: dfae175ddebc2340c68e9145d588f57f2f45ebce [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;
Zheng Liu992e9fd2012-11-08 21:57:33 -050017struct extent_status;
Darrick J. Wong0c9ec4b2017-04-30 00:36:53 -040018struct ext4_fsmap;
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" }, \
Lukas Czerner556615d2014-04-20 23:45:47 -040040 { EXT4_GET_BLOCKS_UNWRIT_EXT, "UNWRIT" }, \
Theodore Ts'o21ddd562013-07-01 08:12:40 -040041 { 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" }, \
Jan Karac86d8db2015-12-07 15:10:26 -050046 { EXT4_GET_BLOCKS_KEEP_SIZE, "KEEP_SIZE" }, \
47 { EXT4_GET_BLOCKS_ZERO, "ZERO" })
Theodore Ts'o21ddd562013-07-01 08:12:40 -040048
49#define show_mflags(flags) __print_flags(flags, "", \
50 { EXT4_MAP_NEW, "N" }, \
51 { EXT4_MAP_MAPPED, "M" }, \
52 { EXT4_MAP_UNWRITTEN, "U" }, \
Jan Karacbd75842014-11-25 11:41:49 -050053 { EXT4_MAP_BOUNDARY, "B" })
Theodore Ts'o21ddd562013-07-01 08:12:40 -040054
55#define show_free_flags(flags) __print_flags(flags, "|", \
56 { EXT4_FREE_BLOCKS_METADATA, "METADATA" }, \
57 { EXT4_FREE_BLOCKS_FORGET, "FORGET" }, \
58 { EXT4_FREE_BLOCKS_VALIDATED, "VALIDATED" }, \
59 { EXT4_FREE_BLOCKS_NO_QUOT_UPDATE, "NO_QUOTA" }, \
60 { EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER,"1ST_CLUSTER" },\
61 { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" })
62
63#define show_extent_status(status) __print_flags(status, "", \
Theodore Ts'o3be78c72013-08-16 21:22:41 -040064 { EXTENT_STATUS_WRITTEN, "W" }, \
65 { EXTENT_STATUS_UNWRITTEN, "U" }, \
66 { EXTENT_STATUS_DELAYED, "D" }, \
67 { EXTENT_STATUS_HOLE, "H" })
Theodore Ts'o21ddd562013-07-01 08:12:40 -040068
Lukas Czernera633f5a2014-02-22 06:18:17 -050069#define show_falloc_mode(mode) __print_flags(mode, "|", \
70 { FALLOC_FL_KEEP_SIZE, "KEEP_SIZE"}, \
71 { FALLOC_FL_PUNCH_HOLE, "PUNCH_HOLE"}, \
Namjae Jeon9eb79482014-02-23 15:18:59 -050072 { FALLOC_FL_NO_HIDE_STALE, "NO_HIDE_STALE"}, \
Lukas Czernerb8a86842014-03-18 18:05:35 -040073 { FALLOC_FL_COLLAPSE_RANGE, "COLLAPSE_RANGE"}, \
74 { FALLOC_FL_ZERO_RANGE, "ZERO_RANGE"})
Lukas Czernera633f5a2014-02-22 06:18:17 -050075
Theodore Ts'o21ddd562013-07-01 08:12:40 -040076
Theodore Ts'oa26f4992015-02-02 00:37:02 -050077TRACE_EVENT(ext4_other_inode_update_time,
78 TP_PROTO(struct inode *inode, ino_t orig_ino),
79
80 TP_ARGS(inode, orig_ino),
81
82 TP_STRUCT__entry(
83 __field( dev_t, dev )
84 __field( ino_t, ino )
85 __field( ino_t, orig_ino )
86 __field( uid_t, uid )
87 __field( gid_t, gid )
88 __field( __u16, mode )
89 ),
90
91 TP_fast_assign(
92 __entry->orig_ino = orig_ino;
93 __entry->dev = inode->i_sb->s_dev;
94 __entry->ino = inode->i_ino;
95 __entry->uid = i_uid_read(inode);
96 __entry->gid = i_gid_read(inode);
97 __entry->mode = inode->i_mode;
98 ),
99
100 TP_printk("dev %d,%d orig_ino %lu ino %lu mode 0%o uid %u gid %u",
101 MAJOR(__entry->dev), MINOR(__entry->dev),
102 (unsigned long) __entry->orig_ino,
103 (unsigned long) __entry->ino, __entry->mode,
104 __entry->uid, __entry->gid)
105);
106
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400107TRACE_EVENT(ext4_free_inode,
108 TP_PROTO(struct inode *inode),
109
110 TP_ARGS(inode),
111
112 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400113 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400114 __field( ino_t, ino )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400115 __field( uid_t, uid )
116 __field( gid_t, gid )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400117 __field( __u64, blocks )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400118 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400119 ),
120
121 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400122 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400123 __entry->ino = inode->i_ino;
Eric W. Biederman08cefc72012-02-07 15:41:49 -0800124 __entry->uid = i_uid_read(inode);
125 __entry->gid = i_gid_read(inode);
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400126 __entry->blocks = inode->i_blocks;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400127 __entry->mode = inode->i_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400128 ),
129
Theodore Ts'oa2690292010-10-27 22:08:50 -0400130 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400131 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -0400132 (unsigned long) __entry->ino, __entry->mode,
133 __entry->uid, __entry->gid, __entry->blocks)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400134);
135
136TRACE_EVENT(ext4_request_inode,
137 TP_PROTO(struct inode *dir, int mode),
138
139 TP_ARGS(dir, mode),
140
141 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400142 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400143 __field( ino_t, dir )
Theodore Ts'o59be8e72011-07-30 12:38:46 -0400144 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400145 ),
146
147 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400148 __entry->dev = dir->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400149 __entry->dir = dir->i_ino;
150 __entry->mode = mode;
151 ),
152
Theodore Ts'oa2690292010-10-27 22:08:50 -0400153 TP_printk("dev %d,%d dir %lu mode 0%o",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400154 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400155 (unsigned long) __entry->dir, __entry->mode)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400156);
157
158TRACE_EVENT(ext4_allocate_inode,
159 TP_PROTO(struct inode *inode, struct inode *dir, int mode),
160
161 TP_ARGS(inode, dir, mode),
162
163 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400164 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400165 __field( ino_t, ino )
166 __field( ino_t, dir )
Theodore Ts'o59be8e72011-07-30 12:38:46 -0400167 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400168 ),
169
170 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400171 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400172 __entry->ino = inode->i_ino;
173 __entry->dir = dir->i_ino;
174 __entry->mode = mode;
175 ),
176
Theodore Ts'oa2690292010-10-27 22:08:50 -0400177 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400178 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400179 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400180 (unsigned long) __entry->dir, __entry->mode)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400181);
182
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500183TRACE_EVENT(ext4_evict_inode,
184 TP_PROTO(struct inode *inode),
185
186 TP_ARGS(inode),
187
188 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400189 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500190 __field( ino_t, ino )
191 __field( int, nlink )
192 ),
193
194 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400195 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500196 __entry->ino = inode->i_ino;
197 __entry->nlink = inode->i_nlink;
198 ),
199
200 TP_printk("dev %d,%d ino %lu nlink %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400201 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500202 (unsigned long) __entry->ino, __entry->nlink)
203);
204
205TRACE_EVENT(ext4_drop_inode,
206 TP_PROTO(struct inode *inode, int drop),
207
208 TP_ARGS(inode, drop),
209
210 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400211 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500212 __field( ino_t, ino )
213 __field( int, drop )
214 ),
215
216 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400217 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500218 __entry->ino = inode->i_ino;
219 __entry->drop = drop;
220 ),
221
222 TP_printk("dev %d,%d ino %lu drop %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400223 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500224 (unsigned long) __entry->ino, __entry->drop)
225);
226
227TRACE_EVENT(ext4_mark_inode_dirty,
228 TP_PROTO(struct inode *inode, unsigned long IP),
229
230 TP_ARGS(inode, IP),
231
232 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400233 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500234 __field( ino_t, ino )
235 __field(unsigned long, ip )
236 ),
237
238 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400239 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500240 __entry->ino = inode->i_ino;
241 __entry->ip = IP;
242 ),
243
Scott Woodbbedb172015-03-11 22:13:57 -0500244 TP_printk("dev %d,%d ino %lu caller %pS",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400245 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500246 (unsigned long) __entry->ino, (void *)__entry->ip)
247);
248
249TRACE_EVENT(ext4_begin_ordered_truncate,
250 TP_PROTO(struct inode *inode, loff_t new_size),
251
252 TP_ARGS(inode, new_size),
253
254 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400255 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500256 __field( ino_t, ino )
257 __field( loff_t, new_size )
258 ),
259
260 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400261 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500262 __entry->ino = inode->i_ino;
263 __entry->new_size = new_size;
264 ),
265
266 TP_printk("dev %d,%d ino %lu new_size %lld",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400267 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500268 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400269 __entry->new_size)
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500270);
271
Li Zefanb5eb34c2009-11-26 15:07:36 +0800272DECLARE_EVENT_CLASS(ext4__write_begin,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400273
274 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
275 unsigned int flags),
276
277 TP_ARGS(inode, pos, len, flags),
278
279 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400280 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400281 __field( ino_t, ino )
282 __field( loff_t, pos )
283 __field( unsigned int, len )
284 __field( unsigned int, flags )
285 ),
286
287 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400288 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400289 __entry->ino = inode->i_ino;
290 __entry->pos = pos;
291 __entry->len = len;
292 __entry->flags = flags;
293 ),
294
Lukas Czernera9c667f2011-06-06 09:51:52 -0400295 TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400296 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400297 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400298 __entry->pos, __entry->len, __entry->flags)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400299);
300
Li Zefanb5eb34c2009-11-26 15:07:36 +0800301DEFINE_EVENT(ext4__write_begin, ext4_write_begin,
302
303 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
304 unsigned int flags),
305
306 TP_ARGS(inode, pos, len, flags)
307);
308
309DEFINE_EVENT(ext4__write_begin, ext4_da_write_begin,
310
311 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
312 unsigned int flags),
313
314 TP_ARGS(inode, pos, len, flags)
315);
316
317DECLARE_EVENT_CLASS(ext4__write_end,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400318 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
319 unsigned int copied),
320
321 TP_ARGS(inode, pos, len, copied),
322
323 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400324 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400325 __field( ino_t, ino )
326 __field( loff_t, pos )
327 __field( unsigned int, len )
328 __field( unsigned int, copied )
329 ),
330
331 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400332 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400333 __entry->ino = inode->i_ino;
334 __entry->pos = pos;
335 __entry->len = len;
336 __entry->copied = copied;
337 ),
338
Lukas Czernera9c667f2011-06-06 09:51:52 -0400339 TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400340 MAJOR(__entry->dev), MINOR(__entry->dev),
341 (unsigned long) __entry->ino,
342 __entry->pos, __entry->len, __entry->copied)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400343);
344
Theodore Ts'o74d553a2013-04-03 12:39:17 -0400345DEFINE_EVENT(ext4__write_end, ext4_write_end,
Li Zefanb5eb34c2009-11-26 15:07:36 +0800346
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400347 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
348 unsigned int copied),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400349
Li Zefanb5eb34c2009-11-26 15:07:36 +0800350 TP_ARGS(inode, pos, len, copied)
351);
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400352
Li Zefanb5eb34c2009-11-26 15:07:36 +0800353DEFINE_EVENT(ext4__write_end, ext4_journalled_write_end,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400354
Li Zefanb5eb34c2009-11-26 15:07:36 +0800355 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
356 unsigned int copied),
357
358 TP_ARGS(inode, pos, len, copied)
359);
360
361DEFINE_EVENT(ext4__write_end, ext4_da_write_end,
362
363 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
364 unsigned int copied),
365
366 TP_ARGS(inode, pos, len, copied)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400367);
368
Theodore Ts'o20970ba2013-06-06 14:00:46 -0400369TRACE_EVENT(ext4_writepages,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400370 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
371
372 TP_ARGS(inode, wbc),
373
374 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400375 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400376 __field( ino_t, ino )
377 __field( long, nr_to_write )
378 __field( long, pages_skipped )
379 __field( loff_t, range_start )
380 __field( loff_t, range_end )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400381 __field( pgoff_t, writeback_index )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400382 __field( int, sync_mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400383 __field( char, for_kupdate )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400384 __field( char, range_cyclic )
385 ),
386
387 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400388 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400389 __entry->ino = inode->i_ino;
390 __entry->nr_to_write = wbc->nr_to_write;
391 __entry->pages_skipped = wbc->pages_skipped;
392 __entry->range_start = wbc->range_start;
393 __entry->range_end = wbc->range_end;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400394 __entry->writeback_index = inode->i_mapping->writeback_index;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400395 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400396 __entry->for_kupdate = wbc->for_kupdate;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400397 __entry->range_cyclic = wbc->range_cyclic;
398 ),
399
Theodore Ts'oa107e5a2010-10-27 23:44:47 -0400400 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
Anatol Pomozov81370292012-08-17 09:52:17 -0400401 "range_start %lld range_end %lld sync_mode %d "
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400402 "for_kupdate %d range_cyclic %d writeback_index %lu",
403 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400404 (unsigned long) __entry->ino, __entry->nr_to_write,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400405 __entry->pages_skipped, __entry->range_start,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400406 __entry->range_end, __entry->sync_mode,
407 __entry->for_kupdate, __entry->range_cyclic,
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400408 (unsigned long) __entry->writeback_index)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400409);
410
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400411TRACE_EVENT(ext4_da_write_pages,
Jan Kara4e7ea812013-06-04 13:17:40 -0400412 TP_PROTO(struct inode *inode, pgoff_t first_page,
413 struct writeback_control *wbc),
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400414
Jan Kara4e7ea812013-06-04 13:17:40 -0400415 TP_ARGS(inode, first_page, wbc),
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400416
417 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400418 __field( dev_t, dev )
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400419 __field( ino_t, ino )
Jan Kara4e7ea812013-06-04 13:17:40 -0400420 __field( pgoff_t, first_page )
421 __field( long, nr_to_write )
422 __field( int, sync_mode )
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400423 ),
424
425 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400426 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400427 __entry->ino = inode->i_ino;
Jan Kara4e7ea812013-06-04 13:17:40 -0400428 __entry->first_page = first_page;
429 __entry->nr_to_write = wbc->nr_to_write;
430 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400431 ),
432
Jan Kara4e7ea812013-06-04 13:17:40 -0400433 TP_printk("dev %d,%d ino %lu first_page %lu nr_to_write %ld "
434 "sync_mode %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400435 MAJOR(__entry->dev), MINOR(__entry->dev),
Jan Kara4e7ea812013-06-04 13:17:40 -0400436 (unsigned long) __entry->ino, __entry->first_page,
437 __entry->nr_to_write, __entry->sync_mode)
438);
439
440TRACE_EVENT(ext4_da_write_pages_extent,
441 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map),
442
443 TP_ARGS(inode, map),
444
445 TP_STRUCT__entry(
446 __field( dev_t, dev )
447 __field( ino_t, ino )
448 __field( __u64, lblk )
449 __field( __u32, len )
450 __field( __u32, flags )
451 ),
452
453 TP_fast_assign(
454 __entry->dev = inode->i_sb->s_dev;
455 __entry->ino = inode->i_ino;
456 __entry->lblk = map->m_lblk;
457 __entry->len = map->m_len;
458 __entry->flags = map->m_flags;
459 ),
460
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400461 TP_printk("dev %d,%d ino %lu lblk %llu len %u flags %s",
Jan Kara4e7ea812013-06-04 13:17:40 -0400462 MAJOR(__entry->dev), MINOR(__entry->dev),
463 (unsigned long) __entry->ino, __entry->lblk, __entry->len,
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400464 show_mflags(__entry->flags))
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400465);
466
Theodore Ts'o20970ba2013-06-06 14:00:46 -0400467TRACE_EVENT(ext4_writepages_result,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400468 TP_PROTO(struct inode *inode, struct writeback_control *wbc,
469 int ret, int pages_written),
470
471 TP_ARGS(inode, wbc, ret, pages_written),
472
473 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400474 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400475 __field( ino_t, ino )
476 __field( int, ret )
477 __field( int, pages_written )
478 __field( long, pages_skipped )
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400479 __field( pgoff_t, writeback_index )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400480 __field( int, sync_mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400481 ),
482
483 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400484 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400485 __entry->ino = inode->i_ino;
486 __entry->ret = ret;
487 __entry->pages_written = pages_written;
488 __entry->pages_skipped = wbc->pages_skipped;
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400489 __entry->writeback_index = inode->i_mapping->writeback_index;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400490 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400491 ),
492
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400493 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
Wu Fengguangb7a24412010-07-21 22:19:51 -0600494 "sync_mode %d writeback_index %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400495 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400496 (unsigned long) __entry->ino, __entry->ret,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400497 __entry->pages_written, __entry->pages_skipped,
Wu Fengguangb7a24412010-07-21 22:19:51 -0600498 __entry->sync_mode,
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400499 (unsigned long) __entry->writeback_index)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400500);
501
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400502DECLARE_EVENT_CLASS(ext4__page_op,
503 TP_PROTO(struct page *page),
504
505 TP_ARGS(page),
506
507 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400508 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400509 __field( ino_t, ino )
510 __field( pgoff_t, index )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400511
512 ),
513
514 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400515 __entry->dev = page->mapping->host->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400516 __entry->ino = page->mapping->host->i_ino;
517 __entry->index = page->index;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400518 ),
519
520 TP_printk("dev %d,%d ino %lu page_index %lu",
521 MAJOR(__entry->dev), MINOR(__entry->dev),
522 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400523 (unsigned long) __entry->index)
524);
525
526DEFINE_EVENT(ext4__page_op, ext4_writepage,
527
528 TP_PROTO(struct page *page),
529
530 TP_ARGS(page)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400531);
532
533DEFINE_EVENT(ext4__page_op, ext4_readpage,
534
535 TP_PROTO(struct page *page),
536
537 TP_ARGS(page)
538);
539
540DEFINE_EVENT(ext4__page_op, ext4_releasepage,
541
542 TP_PROTO(struct page *page),
543
544 TP_ARGS(page)
545);
546
Jan Kara4520fb32012-12-25 13:28:54 -0500547DECLARE_EVENT_CLASS(ext4_invalidatepage_op,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400548 TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400549
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400550 TP_ARGS(page, offset, length),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400551
552 TP_STRUCT__entry(
Anatol Pomozov210c0522012-08-17 09:50:17 -0400553 __field( dev_t, dev )
554 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400555 __field( pgoff_t, index )
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400556 __field( unsigned int, offset )
557 __field( unsigned int, length )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400558 ),
559
560 TP_fast_assign(
Anatol Pomozov210c0522012-08-17 09:50:17 -0400561 __entry->dev = page->mapping->host->i_sb->s_dev;
562 __entry->ino = page->mapping->host->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400563 __entry->index = page->index;
564 __entry->offset = offset;
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400565 __entry->length = length;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400566 ),
567
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400568 TP_printk("dev %d,%d ino %lu page_index %lu offset %u length %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400569 MAJOR(__entry->dev), MINOR(__entry->dev),
570 (unsigned long) __entry->ino,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400571 (unsigned long) __entry->index,
572 __entry->offset, __entry->length)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400573);
574
Jan Kara4520fb32012-12-25 13:28:54 -0500575DEFINE_EVENT(ext4_invalidatepage_op, ext4_invalidatepage,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400576 TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
Jan Kara4520fb32012-12-25 13:28:54 -0500577
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400578 TP_ARGS(page, offset, length)
Jan Kara4520fb32012-12-25 13:28:54 -0500579);
580
581DEFINE_EVENT(ext4_invalidatepage_op, ext4_journalled_invalidatepage,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400582 TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
Jan Kara4520fb32012-12-25 13:28:54 -0500583
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400584 TP_ARGS(page, offset, length)
Jan Kara4520fb32012-12-25 13:28:54 -0500585);
586
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400587TRACE_EVENT(ext4_discard_blocks,
588 TP_PROTO(struct super_block *sb, unsigned long long blk,
589 unsigned long long count),
590
591 TP_ARGS(sb, blk, count),
592
593 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400594 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400595 __field( __u64, blk )
596 __field( __u64, count )
597
598 ),
599
600 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400601 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400602 __entry->blk = blk;
603 __entry->count = count;
604 ),
605
Theodore Ts'oa2690292010-10-27 22:08:50 -0400606 TP_printk("dev %d,%d blk %llu count %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400607 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400608 __entry->blk, __entry->count)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400609);
610
Li Zefanf084db92010-05-17 04:00:00 -0400611DECLARE_EVENT_CLASS(ext4__mb_new_pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400612 TP_PROTO(struct ext4_allocation_context *ac,
613 struct ext4_prealloc_space *pa),
614
615 TP_ARGS(ac, pa),
616
617 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400618 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400619 __field( ino_t, ino )
620 __field( __u64, pa_pstart )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400621 __field( __u64, pa_lstart )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400622 __field( __u32, pa_len )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400623
624 ),
625
626 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400627 __entry->dev = ac->ac_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400628 __entry->ino = ac->ac_inode->i_ino;
629 __entry->pa_pstart = pa->pa_pstart;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400630 __entry->pa_lstart = pa->pa_lstart;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400631 __entry->pa_len = pa->pa_len;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400632 ),
633
Theodore Ts'oa2690292010-10-27 22:08:50 -0400634 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400635 MAJOR(__entry->dev), MINOR(__entry->dev),
636 (unsigned long) __entry->ino,
637 __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400638);
639
Li Zefanf084db92010-05-17 04:00:00 -0400640DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa,
641
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400642 TP_PROTO(struct ext4_allocation_context *ac,
643 struct ext4_prealloc_space *pa),
644
Li Zefanf084db92010-05-17 04:00:00 -0400645 TP_ARGS(ac, pa)
646);
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400647
Li Zefanf084db92010-05-17 04:00:00 -0400648DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400649
Li Zefanf084db92010-05-17 04:00:00 -0400650 TP_PROTO(struct ext4_allocation_context *ac,
651 struct ext4_prealloc_space *pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400652
Li Zefanf084db92010-05-17 04:00:00 -0400653 TP_ARGS(ac, pa)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400654);
655
656TRACE_EVENT(ext4_mb_release_inode_pa,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400657 TP_PROTO(struct ext4_prealloc_space *pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400658 unsigned long long block, unsigned int count),
659
Lukas Czernera9c667f2011-06-06 09:51:52 -0400660 TP_ARGS(pa, block, count),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400661
662 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400663 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400664 __field( ino_t, ino )
665 __field( __u64, block )
666 __field( __u32, count )
667
668 ),
669
670 TP_fast_assign(
Lukas Czernera9c667f2011-06-06 09:51:52 -0400671 __entry->dev = pa->pa_inode->i_sb->s_dev;
672 __entry->ino = pa->pa_inode->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400673 __entry->block = block;
674 __entry->count = count;
675 ),
676
Theodore Ts'oa2690292010-10-27 22:08:50 -0400677 TP_printk("dev %d,%d ino %lu block %llu count %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400678 MAJOR(__entry->dev), MINOR(__entry->dev),
679 (unsigned long) __entry->ino,
680 __entry->block, __entry->count)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400681);
682
683TRACE_EVENT(ext4_mb_release_group_pa,
Yongqiang Yang60e07cf2011-12-18 15:49:54 -0500684 TP_PROTO(struct super_block *sb, struct ext4_prealloc_space *pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400685
Yongqiang Yang60e07cf2011-12-18 15:49:54 -0500686 TP_ARGS(sb, pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400687
688 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400689 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400690 __field( __u64, pa_pstart )
691 __field( __u32, pa_len )
692
693 ),
694
695 TP_fast_assign(
Yongqiang Yang60e07cf2011-12-18 15:49:54 -0500696 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400697 __entry->pa_pstart = pa->pa_pstart;
698 __entry->pa_len = pa->pa_len;
699 ),
700
Theodore Ts'oa2690292010-10-27 22:08:50 -0400701 TP_printk("dev %d,%d pstart %llu len %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400702 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400703 __entry->pa_pstart, __entry->pa_len)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400704);
705
706TRACE_EVENT(ext4_discard_preallocations,
707 TP_PROTO(struct inode *inode),
708
709 TP_ARGS(inode),
710
711 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400712 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400713 __field( ino_t, ino )
714
715 ),
716
717 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400718 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400719 __entry->ino = inode->i_ino;
720 ),
721
Theodore Ts'oa2690292010-10-27 22:08:50 -0400722 TP_printk("dev %d,%d ino %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400723 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400724 (unsigned long) __entry->ino)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400725);
726
727TRACE_EVENT(ext4_mb_discard_preallocations,
728 TP_PROTO(struct super_block *sb, int needed),
729
730 TP_ARGS(sb, needed),
731
732 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400733 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400734 __field( int, needed )
735
736 ),
737
738 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400739 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400740 __entry->needed = needed;
741 ),
742
Theodore Ts'oa2690292010-10-27 22:08:50 -0400743 TP_printk("dev %d,%d needed %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400744 MAJOR(__entry->dev), MINOR(__entry->dev),
745 __entry->needed)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400746);
747
748TRACE_EVENT(ext4_request_blocks,
749 TP_PROTO(struct ext4_allocation_request *ar),
750
751 TP_ARGS(ar),
752
753 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400754 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400755 __field( ino_t, ino )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400756 __field( unsigned int, len )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400757 __field( __u32, logical )
758 __field( __u32, lleft )
759 __field( __u32, lright )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400760 __field( __u64, goal )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400761 __field( __u64, pleft )
762 __field( __u64, pright )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400763 __field( unsigned int, flags )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400764 ),
765
766 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400767 __entry->dev = ar->inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400768 __entry->ino = ar->inode->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400769 __entry->len = ar->len;
770 __entry->logical = ar->logical;
771 __entry->goal = ar->goal;
772 __entry->lleft = ar->lleft;
773 __entry->lright = ar->lright;
774 __entry->pleft = ar->pleft;
775 __entry->pright = ar->pright;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400776 __entry->flags = ar->flags;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400777 ),
778
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400779 TP_printk("dev %d,%d ino %lu flags %s len %u lblk %u goal %llu "
Lukas Czernera9c667f2011-06-06 09:51:52 -0400780 "lleft %u lright %u pleft %llu pright %llu ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400781 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400782 (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags),
Lukas Czernera9c667f2011-06-06 09:51:52 -0400783 __entry->len, __entry->logical, __entry->goal,
784 __entry->lleft, __entry->lright, __entry->pleft,
785 __entry->pright)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400786);
787
788TRACE_EVENT(ext4_allocate_blocks,
789 TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block),
790
791 TP_ARGS(ar, block),
792
793 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400794 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400795 __field( ino_t, ino )
796 __field( __u64, block )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400797 __field( unsigned int, len )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400798 __field( __u32, logical )
799 __field( __u32, lleft )
800 __field( __u32, lright )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400801 __field( __u64, goal )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400802 __field( __u64, pleft )
803 __field( __u64, pright )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400804 __field( unsigned int, flags )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400805 ),
806
807 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400808 __entry->dev = ar->inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400809 __entry->ino = ar->inode->i_ino;
810 __entry->block = block;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400811 __entry->len = ar->len;
812 __entry->logical = ar->logical;
813 __entry->goal = ar->goal;
814 __entry->lleft = ar->lleft;
815 __entry->lright = ar->lright;
816 __entry->pleft = ar->pleft;
817 __entry->pright = ar->pright;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400818 __entry->flags = ar->flags;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400819 ),
820
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400821 TP_printk("dev %d,%d ino %lu flags %s len %u block %llu lblk %u "
Lukas Czernera9c667f2011-06-06 09:51:52 -0400822 "goal %llu lleft %u lright %u pleft %llu pright %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400823 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400824 (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags),
Lukas Czernera9c667f2011-06-06 09:51:52 -0400825 __entry->len, __entry->block, __entry->logical,
826 __entry->goal, __entry->lleft, __entry->lright,
827 __entry->pleft, __entry->pright)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400828);
829
830TRACE_EVENT(ext4_free_blocks,
831 TP_PROTO(struct inode *inode, __u64 block, unsigned long count,
Theodore Ts'oe6362602009-11-23 07:17:05 -0500832 int flags),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400833
Theodore Ts'oe6362602009-11-23 07:17:05 -0500834 TP_ARGS(inode, block, count, flags),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400835
836 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400837 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400838 __field( ino_t, ino )
839 __field( __u64, block )
840 __field( unsigned long, count )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400841 __field( int, flags )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400842 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400843 ),
844
845 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400846 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400847 __entry->ino = inode->i_ino;
848 __entry->block = block;
849 __entry->count = count;
Theodore Ts'oe6362602009-11-23 07:17:05 -0500850 __entry->flags = flags;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400851 __entry->mode = inode->i_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400852 ),
853
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400854 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %s",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400855 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400856 (unsigned long) __entry->ino,
Theodore Ts'oe6362602009-11-23 07:17:05 -0500857 __entry->mode, __entry->block, __entry->count,
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400858 show_free_flags(__entry->flags))
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400859);
860
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400861TRACE_EVENT(ext4_sync_file_enter,
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200862 TP_PROTO(struct file *file, int datasync),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400863
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200864 TP_ARGS(file, datasync),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400865
866 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400867 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400868 __field( ino_t, ino )
869 __field( ino_t, parent )
870 __field( int, datasync )
871 ),
872
873 TP_fast_assign(
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200874 struct dentry *dentry = file->f_path.dentry;
875
Al Virofc640052016-04-10 01:33:30 -0400876 __entry->dev = dentry->d_sb->s_dev;
David Howells2b0143b2015-03-17 22:25:59 +0000877 __entry->ino = d_inode(dentry)->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400878 __entry->datasync = datasync;
David Howells2b0143b2015-03-17 22:25:59 +0000879 __entry->parent = d_inode(dentry->d_parent)->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400880 ),
881
Lukas Czernera9c667f2011-06-06 09:51:52 -0400882 TP_printk("dev %d,%d ino %lu parent %lu datasync %d ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400883 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400884 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400885 (unsigned long) __entry->parent, __entry->datasync)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400886);
887
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400888TRACE_EVENT(ext4_sync_file_exit,
889 TP_PROTO(struct inode *inode, int ret),
890
891 TP_ARGS(inode, ret),
892
893 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400894 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400895 __field( ino_t, ino )
896 __field( int, ret )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400897 ),
898
899 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400900 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400901 __entry->ino = inode->i_ino;
902 __entry->ret = ret;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400903 ),
904
Lukas Czernera9c667f2011-06-06 09:51:52 -0400905 TP_printk("dev %d,%d ino %lu ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400906 MAJOR(__entry->dev), MINOR(__entry->dev),
907 (unsigned long) __entry->ino,
908 __entry->ret)
909);
910
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400911TRACE_EVENT(ext4_sync_fs,
912 TP_PROTO(struct super_block *sb, int wait),
913
914 TP_ARGS(sb, wait),
915
916 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400917 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400918 __field( int, wait )
919
920 ),
921
922 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400923 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400924 __entry->wait = wait;
925 ),
926
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400927 TP_printk("dev %d,%d wait %d",
928 MAJOR(__entry->dev), MINOR(__entry->dev),
929 __entry->wait)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400930);
931
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400932TRACE_EVENT(ext4_alloc_da_blocks,
933 TP_PROTO(struct inode *inode),
934
935 TP_ARGS(inode),
936
937 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400938 __field( dev_t, dev )
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400939 __field( ino_t, ino )
940 __field( unsigned int, data_blocks )
941 __field( unsigned int, meta_blocks )
942 ),
943
944 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400945 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400946 __entry->ino = inode->i_ino;
947 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
948 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
949 ),
950
Theodore Ts'oa2690292010-10-27 22:08:50 -0400951 TP_printk("dev %d,%d ino %lu data_blocks %u meta_blocks %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400952 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400953 (unsigned long) __entry->ino,
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400954 __entry->data_blocks, __entry->meta_blocks)
955);
956
Theodore Ts'o296c3552009-09-30 00:32:42 -0400957TRACE_EVENT(ext4_mballoc_alloc,
958 TP_PROTO(struct ext4_allocation_context *ac),
959
960 TP_ARGS(ac),
961
962 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400963 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -0400964 __field( ino_t, ino )
Theodore Ts'o296c3552009-09-30 00:32:42 -0400965 __field( __u32, orig_logical )
966 __field( int, orig_start )
967 __field( __u32, orig_group )
968 __field( int, orig_len )
969 __field( __u32, goal_logical )
970 __field( int, goal_start )
971 __field( __u32, goal_group )
972 __field( int, goal_len )
973 __field( __u32, result_logical )
974 __field( int, result_start )
975 __field( __u32, result_group )
976 __field( int, result_len )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400977 __field( __u16, found )
978 __field( __u16, groups )
979 __field( __u16, buddy )
980 __field( __u16, flags )
981 __field( __u16, tail )
982 __field( __u8, cr )
Theodore Ts'o296c3552009-09-30 00:32:42 -0400983 ),
984
985 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400986 __entry->dev = ac->ac_inode->i_sb->s_dev;
Theodore Ts'o296c3552009-09-30 00:32:42 -0400987 __entry->ino = ac->ac_inode->i_ino;
Theodore Ts'o296c3552009-09-30 00:32:42 -0400988 __entry->orig_logical = ac->ac_o_ex.fe_logical;
989 __entry->orig_start = ac->ac_o_ex.fe_start;
990 __entry->orig_group = ac->ac_o_ex.fe_group;
991 __entry->orig_len = ac->ac_o_ex.fe_len;
992 __entry->goal_logical = ac->ac_g_ex.fe_logical;
993 __entry->goal_start = ac->ac_g_ex.fe_start;
994 __entry->goal_group = ac->ac_g_ex.fe_group;
995 __entry->goal_len = ac->ac_g_ex.fe_len;
996 __entry->result_logical = ac->ac_f_ex.fe_logical;
997 __entry->result_start = ac->ac_f_ex.fe_start;
998 __entry->result_group = ac->ac_f_ex.fe_group;
999 __entry->result_len = ac->ac_f_ex.fe_len;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001000 __entry->found = ac->ac_found;
1001 __entry->flags = ac->ac_flags;
1002 __entry->groups = ac->ac_groups_scanned;
1003 __entry->buddy = ac->ac_buddy;
1004 __entry->tail = ac->ac_tail;
1005 __entry->cr = ac->ac_criteria;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001006 ),
1007
Theodore Ts'oa2690292010-10-27 22:08:50 -04001008 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 -04001009 "result %u/%d/%u@%u blks %u grps %u cr %u flags %s "
Theodore Ts'o296c3552009-09-30 00:32:42 -04001010 "tail %u broken %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001011 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001012 (unsigned long) __entry->ino,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001013 __entry->orig_group, __entry->orig_start,
1014 __entry->orig_len, __entry->orig_logical,
1015 __entry->goal_group, __entry->goal_start,
1016 __entry->goal_len, __entry->goal_logical,
1017 __entry->result_group, __entry->result_start,
1018 __entry->result_len, __entry->result_logical,
1019 __entry->found, __entry->groups, __entry->cr,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001020 show_mballoc_flags(__entry->flags), __entry->tail,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001021 __entry->buddy ? 1 << __entry->buddy : 0)
1022);
1023
1024TRACE_EVENT(ext4_mballoc_prealloc,
1025 TP_PROTO(struct ext4_allocation_context *ac),
1026
1027 TP_ARGS(ac),
1028
1029 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001030 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001031 __field( ino_t, ino )
1032 __field( __u32, orig_logical )
1033 __field( int, orig_start )
1034 __field( __u32, orig_group )
1035 __field( int, orig_len )
1036 __field( __u32, result_logical )
1037 __field( int, result_start )
1038 __field( __u32, result_group )
1039 __field( int, result_len )
1040 ),
1041
1042 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001043 __entry->dev = ac->ac_inode->i_sb->s_dev;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001044 __entry->ino = ac->ac_inode->i_ino;
1045 __entry->orig_logical = ac->ac_o_ex.fe_logical;
1046 __entry->orig_start = ac->ac_o_ex.fe_start;
1047 __entry->orig_group = ac->ac_o_ex.fe_group;
1048 __entry->orig_len = ac->ac_o_ex.fe_len;
1049 __entry->result_logical = ac->ac_b_ex.fe_logical;
1050 __entry->result_start = ac->ac_b_ex.fe_start;
1051 __entry->result_group = ac->ac_b_ex.fe_group;
1052 __entry->result_len = ac->ac_b_ex.fe_len;
1053 ),
1054
Theodore Ts'oa2690292010-10-27 22:08:50 -04001055 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
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->orig_group, __entry->orig_start,
1059 __entry->orig_len, __entry->orig_logical,
1060 __entry->result_group, __entry->result_start,
1061 __entry->result_len, __entry->result_logical)
1062);
1063
Li Zefanf084db92010-05-17 04:00:00 -04001064DECLARE_EVENT_CLASS(ext4__mballoc,
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001065 TP_PROTO(struct super_block *sb,
1066 struct inode *inode,
1067 ext4_group_t group,
1068 ext4_grpblk_t start,
1069 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001070
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001071 TP_ARGS(sb, inode, group, start, len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001072
1073 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001074 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001075 __field( ino_t, ino )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001076 __field( int, result_start )
1077 __field( __u32, result_group )
1078 __field( int, result_len )
1079 ),
1080
1081 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001082 __entry->dev = sb->s_dev;
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001083 __entry->ino = inode ? inode->i_ino : 0;
1084 __entry->result_start = start;
1085 __entry->result_group = group;
1086 __entry->result_len = len;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001087 ),
1088
Lukas Czernera9c667f2011-06-06 09:51:52 -04001089 TP_printk("dev %d,%d inode %lu extent %u/%d/%d ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001090 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001091 (unsigned long) __entry->ino,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001092 __entry->result_group, __entry->result_start,
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001093 __entry->result_len)
Theodore Ts'o296c3552009-09-30 00:32:42 -04001094);
1095
Li Zefanf084db92010-05-17 04:00:00 -04001096DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard,
1097
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001098 TP_PROTO(struct super_block *sb,
1099 struct inode *inode,
1100 ext4_group_t group,
1101 ext4_grpblk_t start,
1102 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001103
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001104 TP_ARGS(sb, inode, group, start, len)
Li Zefanf084db92010-05-17 04:00:00 -04001105);
Theodore Ts'o296c3552009-09-30 00:32:42 -04001106
Li Zefanf084db92010-05-17 04:00:00 -04001107DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001108
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001109 TP_PROTO(struct super_block *sb,
1110 struct inode *inode,
1111 ext4_group_t group,
1112 ext4_grpblk_t start,
1113 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001114
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001115 TP_ARGS(sb, inode, group, start, len)
Theodore Ts'o296c3552009-09-30 00:32:42 -04001116);
1117
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001118TRACE_EVENT(ext4_forget,
1119 TP_PROTO(struct inode *inode, int is_metadata, __u64 block),
1120
1121 TP_ARGS(inode, is_metadata, block),
1122
1123 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001124 __field( dev_t, dev )
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001125 __field( ino_t, ino )
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001126 __field( __u64, block )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001127 __field( int, is_metadata )
1128 __field( __u16, mode )
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001129 ),
1130
1131 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001132 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001133 __entry->ino = inode->i_ino;
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001134 __entry->block = block;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001135 __entry->is_metadata = is_metadata;
1136 __entry->mode = inode->i_mode;
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001137 ),
1138
Theodore Ts'oa2690292010-10-27 22:08:50 -04001139 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001140 MAJOR(__entry->dev), MINOR(__entry->dev),
1141 (unsigned long) __entry->ino,
1142 __entry->mode, __entry->is_metadata, __entry->block)
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001143);
1144
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001145TRACE_EVENT(ext4_da_update_reserve_space,
Aditya Kalid8990242011-09-09 19:18:51 -04001146 TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001147
Aditya Kalid8990242011-09-09 19:18:51 -04001148 TP_ARGS(inode, used_blocks, quota_claim),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001149
1150 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001151 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001152 __field( ino_t, ino )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001153 __field( __u64, i_blocks )
1154 __field( int, used_blocks )
1155 __field( int, reserved_data_blocks )
1156 __field( int, reserved_meta_blocks )
1157 __field( int, allocated_meta_blocks )
Aditya Kalid8990242011-09-09 19:18:51 -04001158 __field( int, quota_claim )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001159 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001160 ),
1161
1162 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001163 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001164 __entry->ino = inode->i_ino;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001165 __entry->i_blocks = inode->i_blocks;
1166 __entry->used_blocks = used_blocks;
Aditya Kalid8990242011-09-09 19:18:51 -04001167 __entry->reserved_data_blocks =
1168 EXT4_I(inode)->i_reserved_data_blocks;
1169 __entry->reserved_meta_blocks =
1170 EXT4_I(inode)->i_reserved_meta_blocks;
1171 __entry->allocated_meta_blocks =
1172 EXT4_I(inode)->i_allocated_meta_blocks;
1173 __entry->quota_claim = quota_claim;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001174 __entry->mode = inode->i_mode;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001175 ),
1176
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001177 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
1178 "reserved_data_blocks %d reserved_meta_blocks %d "
Aditya Kalid8990242011-09-09 19:18:51 -04001179 "allocated_meta_blocks %d quota_claim %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001180 MAJOR(__entry->dev), MINOR(__entry->dev),
1181 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001182 __entry->mode, __entry->i_blocks,
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001183 __entry->used_blocks, __entry->reserved_data_blocks,
Aditya Kalid8990242011-09-09 19:18:51 -04001184 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks,
1185 __entry->quota_claim)
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001186);
1187
1188TRACE_EVENT(ext4_da_reserve_space,
Eric Whitneyc27e43a2015-06-21 21:37:05 -04001189 TP_PROTO(struct inode *inode),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001190
Eric Whitneyc27e43a2015-06-21 21:37:05 -04001191 TP_ARGS(inode),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001192
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 )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001197 __field( int, reserved_data_blocks )
1198 __field( int, reserved_meta_blocks )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001199 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001200 ),
1201
1202 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001203 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001204 __entry->ino = inode->i_ino;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001205 __entry->i_blocks = inode->i_blocks;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001206 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1207 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001208 __entry->mode = inode->i_mode;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001209 ),
1210
Eric Whitneyc27e43a2015-06-21 21:37:05 -04001211 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu "
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001212 "reserved_data_blocks %d reserved_meta_blocks %d",
1213 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001214 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001215 __entry->mode, __entry->i_blocks,
Eric Whitneyc27e43a2015-06-21 21:37:05 -04001216 __entry->reserved_data_blocks,
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001217 __entry->reserved_meta_blocks)
1218);
1219
1220TRACE_EVENT(ext4_da_release_space,
1221 TP_PROTO(struct inode *inode, int freed_blocks),
1222
1223 TP_ARGS(inode, freed_blocks),
1224
1225 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001226 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001227 __field( ino_t, ino )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001228 __field( __u64, i_blocks )
1229 __field( int, freed_blocks )
1230 __field( int, reserved_data_blocks )
1231 __field( int, reserved_meta_blocks )
1232 __field( int, allocated_meta_blocks )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001233 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001234 ),
1235
1236 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001237 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001238 __entry->ino = inode->i_ino;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001239 __entry->i_blocks = inode->i_blocks;
1240 __entry->freed_blocks = freed_blocks;
1241 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1242 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
1243 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001244 __entry->mode = inode->i_mode;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001245 ),
1246
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001247 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
1248 "reserved_data_blocks %d reserved_meta_blocks %d "
1249 "allocated_meta_blocks %d",
1250 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001251 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001252 __entry->mode, __entry->i_blocks,
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001253 __entry->freed_blocks, __entry->reserved_data_blocks,
1254 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
1255);
1256
Theodore Ts'of3073332010-05-17 03:00:00 -04001257DECLARE_EVENT_CLASS(ext4__bitmap_load,
1258 TP_PROTO(struct super_block *sb, unsigned long group),
1259
1260 TP_ARGS(sb, group),
1261
1262 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001263 __field( dev_t, dev )
Theodore Ts'of3073332010-05-17 03:00:00 -04001264 __field( __u32, group )
1265
1266 ),
1267
1268 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001269 __entry->dev = sb->s_dev;
Theodore Ts'of3073332010-05-17 03:00:00 -04001270 __entry->group = group;
1271 ),
1272
Theodore Ts'oa2690292010-10-27 22:08:50 -04001273 TP_printk("dev %d,%d group %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001274 MAJOR(__entry->dev), MINOR(__entry->dev),
1275 __entry->group)
Theodore Ts'of3073332010-05-17 03:00:00 -04001276);
1277
1278DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
1279
1280 TP_PROTO(struct super_block *sb, unsigned long group),
1281
1282 TP_ARGS(sb, group)
1283);
1284
1285DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
1286
1287 TP_PROTO(struct super_block *sb, unsigned long group),
1288
1289 TP_ARGS(sb, group)
1290);
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001291
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001292DEFINE_EVENT(ext4__bitmap_load, ext4_read_block_bitmap_load,
1293
1294 TP_PROTO(struct super_block *sb, unsigned long group),
1295
1296 TP_ARGS(sb, group)
1297);
1298
1299DEFINE_EVENT(ext4__bitmap_load, ext4_load_inode_bitmap,
1300
1301 TP_PROTO(struct super_block *sb, unsigned long group),
1302
1303 TP_ARGS(sb, group)
1304);
1305
1306TRACE_EVENT(ext4_direct_IO_enter,
1307 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
1308
1309 TP_ARGS(inode, offset, len, rw),
1310
1311 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001312 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001313 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001314 __field( loff_t, pos )
1315 __field( unsigned long, len )
1316 __field( int, rw )
1317 ),
1318
1319 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001320 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001321 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001322 __entry->pos = offset;
1323 __entry->len = len;
1324 __entry->rw = rw;
1325 ),
1326
Lukas Czernera9c667f2011-06-06 09:51:52 -04001327 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001328 MAJOR(__entry->dev), MINOR(__entry->dev),
1329 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001330 __entry->pos, __entry->len, __entry->rw)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001331);
1332
1333TRACE_EVENT(ext4_direct_IO_exit,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001334 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
1335 int rw, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001336
1337 TP_ARGS(inode, offset, len, rw, ret),
1338
1339 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001340 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001341 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001342 __field( loff_t, pos )
1343 __field( unsigned long, len )
1344 __field( int, rw )
1345 __field( int, ret )
1346 ),
1347
1348 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001349 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001350 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001351 __entry->pos = offset;
1352 __entry->len = len;
1353 __entry->rw = rw;
1354 __entry->ret = ret;
1355 ),
1356
Lukas Czernera9c667f2011-06-06 09:51:52 -04001357 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001358 MAJOR(__entry->dev), MINOR(__entry->dev),
1359 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001360 __entry->pos, __entry->len,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001361 __entry->rw, __entry->ret)
1362);
1363
Lukas Czernerb8a86842014-03-18 18:05:35 -04001364DECLARE_EVENT_CLASS(ext4__fallocate_mode,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001365 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1366
1367 TP_ARGS(inode, offset, len, mode),
1368
1369 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001370 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001371 __field( ino_t, ino )
Lukas Czernerb8a86842014-03-18 18:05:35 -04001372 __field( loff_t, offset )
1373 __field( loff_t, len )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001374 __field( int, mode )
1375 ),
1376
1377 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001378 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001379 __entry->ino = inode->i_ino;
Lukas Czernerb8a86842014-03-18 18:05:35 -04001380 __entry->offset = offset;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001381 __entry->len = len;
1382 __entry->mode = mode;
1383 ),
1384
Lukas Czernerb8a86842014-03-18 18:05:35 -04001385 TP_printk("dev %d,%d ino %lu offset %lld len %lld mode %s",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001386 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernerb8a86842014-03-18 18:05:35 -04001387 (unsigned long) __entry->ino,
1388 __entry->offset, __entry->len,
1389 show_falloc_mode(__entry->mode))
1390);
1391
1392DEFINE_EVENT(ext4__fallocate_mode, ext4_fallocate_enter,
1393
1394 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1395
1396 TP_ARGS(inode, offset, len, mode)
1397);
1398
1399DEFINE_EVENT(ext4__fallocate_mode, ext4_punch_hole,
1400
1401 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1402
1403 TP_ARGS(inode, offset, len, mode)
1404);
1405
1406DEFINE_EVENT(ext4__fallocate_mode, ext4_zero_range,
1407
1408 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1409
1410 TP_ARGS(inode, offset, len, mode)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001411);
1412
1413TRACE_EVENT(ext4_fallocate_exit,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001414 TP_PROTO(struct inode *inode, loff_t offset,
1415 unsigned int max_blocks, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001416
1417 TP_ARGS(inode, offset, max_blocks, ret),
1418
1419 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001420 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001421 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001422 __field( loff_t, pos )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001423 __field( unsigned int, blocks )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001424 __field( int, ret )
1425 ),
1426
1427 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001428 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001429 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001430 __entry->pos = offset;
1431 __entry->blocks = max_blocks;
1432 __entry->ret = ret;
1433 ),
1434
Lukas Czernera9c667f2011-06-06 09:51:52 -04001435 TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001436 MAJOR(__entry->dev), MINOR(__entry->dev),
1437 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001438 __entry->pos, __entry->blocks,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001439 __entry->ret)
1440);
1441
1442TRACE_EVENT(ext4_unlink_enter,
1443 TP_PROTO(struct inode *parent, struct dentry *dentry),
1444
1445 TP_ARGS(parent, dentry),
1446
1447 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001448 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001449 __field( ino_t, ino )
1450 __field( ino_t, parent )
1451 __field( loff_t, size )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001452 ),
1453
1454 TP_fast_assign(
Al Virofc640052016-04-10 01:33:30 -04001455 __entry->dev = dentry->d_sb->s_dev;
David Howells2b0143b2015-03-17 22:25:59 +00001456 __entry->ino = d_inode(dentry)->i_ino;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001457 __entry->parent = parent->i_ino;
David Howells2b0143b2015-03-17 22:25:59 +00001458 __entry->size = d_inode(dentry)->i_size;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001459 ),
1460
Lukas Czernera9c667f2011-06-06 09:51:52 -04001461 TP_printk("dev %d,%d ino %lu size %lld parent %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001462 MAJOR(__entry->dev), MINOR(__entry->dev),
1463 (unsigned long) __entry->ino, __entry->size,
1464 (unsigned long) __entry->parent)
1465);
1466
1467TRACE_EVENT(ext4_unlink_exit,
1468 TP_PROTO(struct dentry *dentry, int ret),
1469
1470 TP_ARGS(dentry, ret),
1471
1472 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001473 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001474 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001475 __field( int, ret )
1476 ),
1477
1478 TP_fast_assign(
Al Virofc640052016-04-10 01:33:30 -04001479 __entry->dev = dentry->d_sb->s_dev;
David Howells2b0143b2015-03-17 22:25:59 +00001480 __entry->ino = d_inode(dentry)->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001481 __entry->ret = ret;
1482 ),
1483
Lukas Czernera9c667f2011-06-06 09:51:52 -04001484 TP_printk("dev %d,%d ino %lu ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001485 MAJOR(__entry->dev), MINOR(__entry->dev),
1486 (unsigned long) __entry->ino,
1487 __entry->ret)
1488);
1489
1490DECLARE_EVENT_CLASS(ext4__truncate,
1491 TP_PROTO(struct inode *inode),
1492
1493 TP_ARGS(inode),
1494
1495 TP_STRUCT__entry(
Anatol Pomozov210c0522012-08-17 09:50:17 -04001496 __field( dev_t, dev )
1497 __field( ino_t, ino )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001498 __field( __u64, blocks )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001499 ),
1500
1501 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001502 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001503 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001504 __entry->blocks = inode->i_blocks;
1505 ),
1506
Lukas Czernera9c667f2011-06-06 09:51:52 -04001507 TP_printk("dev %d,%d ino %lu blocks %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001508 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -04001509 (unsigned long) __entry->ino, __entry->blocks)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001510);
1511
1512DEFINE_EVENT(ext4__truncate, ext4_truncate_enter,
1513
1514 TP_PROTO(struct inode *inode),
1515
1516 TP_ARGS(inode)
1517);
1518
1519DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
1520
1521 TP_PROTO(struct inode *inode),
1522
1523 TP_ARGS(inode)
1524);
1525
Lukas Czerner556615d2014-04-20 23:45:47 -04001526/* 'ux' is the unwritten extent. */
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001527TRACE_EVENT(ext4_ext_convert_to_initialized_enter,
1528 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1529 struct ext4_extent *ux),
1530
1531 TP_ARGS(inode, map, ux),
1532
1533 TP_STRUCT__entry(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001534 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001535 __field( ino_t, ino )
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001536 __field( ext4_lblk_t, m_lblk )
1537 __field( unsigned, m_len )
1538 __field( ext4_lblk_t, u_lblk )
1539 __field( unsigned, u_len )
1540 __field( ext4_fsblk_t, u_pblk )
1541 ),
1542
1543 TP_fast_assign(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001544 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001545 __entry->ino = inode->i_ino;
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001546 __entry->m_lblk = map->m_lblk;
1547 __entry->m_len = map->m_len;
1548 __entry->u_lblk = le32_to_cpu(ux->ee_block);
1549 __entry->u_len = ext4_ext_get_actual_len(ux);
1550 __entry->u_pblk = ext4_ext_pblock(ux);
1551 ),
1552
1553 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u u_lblk %u u_len %u "
1554 "u_pblk %llu",
1555 MAJOR(__entry->dev), MINOR(__entry->dev),
1556 (unsigned long) __entry->ino,
1557 __entry->m_lblk, __entry->m_len,
1558 __entry->u_lblk, __entry->u_len, __entry->u_pblk)
1559);
1560
1561/*
Lukas Czerner556615d2014-04-20 23:45:47 -04001562 * 'ux' is the unwritten extent.
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001563 * 'ix' is the initialized extent to which blocks are transferred.
1564 */
1565TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath,
1566 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1567 struct ext4_extent *ux, struct ext4_extent *ix),
1568
1569 TP_ARGS(inode, map, ux, ix),
1570
1571 TP_STRUCT__entry(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001572 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001573 __field( ino_t, ino )
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001574 __field( ext4_lblk_t, m_lblk )
1575 __field( unsigned, m_len )
1576 __field( ext4_lblk_t, u_lblk )
1577 __field( unsigned, u_len )
1578 __field( ext4_fsblk_t, u_pblk )
1579 __field( ext4_lblk_t, i_lblk )
1580 __field( unsigned, i_len )
1581 __field( ext4_fsblk_t, i_pblk )
1582 ),
1583
1584 TP_fast_assign(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001585 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001586 __entry->ino = inode->i_ino;
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001587 __entry->m_lblk = map->m_lblk;
1588 __entry->m_len = map->m_len;
1589 __entry->u_lblk = le32_to_cpu(ux->ee_block);
1590 __entry->u_len = ext4_ext_get_actual_len(ux);
1591 __entry->u_pblk = ext4_ext_pblock(ux);
1592 __entry->i_lblk = le32_to_cpu(ix->ee_block);
1593 __entry->i_len = ext4_ext_get_actual_len(ix);
1594 __entry->i_pblk = ext4_ext_pblock(ix);
1595 ),
1596
1597 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u "
1598 "u_lblk %u u_len %u u_pblk %llu "
1599 "i_lblk %u i_len %u i_pblk %llu ",
1600 MAJOR(__entry->dev), MINOR(__entry->dev),
1601 (unsigned long) __entry->ino,
1602 __entry->m_lblk, __entry->m_len,
1603 __entry->u_lblk, __entry->u_len, __entry->u_pblk,
1604 __entry->i_lblk, __entry->i_len, __entry->i_pblk)
1605);
1606
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001607DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1608 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001609 unsigned int len, unsigned int flags),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001610
1611 TP_ARGS(inode, lblk, len, flags),
1612
1613 TP_STRUCT__entry(
Anatol Pomozov210c0522012-08-17 09:50:17 -04001614 __field( dev_t, dev )
1615 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001616 __field( ext4_lblk_t, lblk )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001617 __field( unsigned int, len )
1618 __field( unsigned int, flags )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001619 ),
1620
1621 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001622 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001623 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001624 __entry->lblk = lblk;
1625 __entry->len = len;
1626 __entry->flags = flags;
1627 ),
1628
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001629 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %s",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001630 MAJOR(__entry->dev), MINOR(__entry->dev),
1631 (unsigned long) __entry->ino,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001632 __entry->lblk, __entry->len, show_map_flags(__entry->flags))
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001633);
1634
1635DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter,
1636 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1637 unsigned len, unsigned flags),
1638
1639 TP_ARGS(inode, lblk, len, flags)
1640);
1641
1642DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter,
1643 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1644 unsigned len, unsigned flags),
1645
1646 TP_ARGS(inode, lblk, len, flags)
1647);
1648
1649DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001650 TP_PROTO(struct inode *inode, unsigned flags, struct ext4_map_blocks *map,
1651 int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001652
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001653 TP_ARGS(inode, flags, map, ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001654
1655 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001656 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001657 __field( ino_t, ino )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001658 __field( unsigned int, flags )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001659 __field( ext4_fsblk_t, pblk )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001660 __field( ext4_lblk_t, lblk )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001661 __field( unsigned int, len )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001662 __field( unsigned int, mflags )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001663 __field( int, ret )
1664 ),
1665
1666 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001667 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001668 __entry->ino = inode->i_ino;
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001669 __entry->flags = flags;
Zheng Liu19b303d2012-11-08 14:34:04 -05001670 __entry->pblk = map->m_pblk;
1671 __entry->lblk = map->m_lblk;
1672 __entry->len = map->m_len;
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001673 __entry->mflags = map->m_flags;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001674 __entry->ret = ret;
1675 ),
1676
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001677 TP_printk("dev %d,%d ino %lu flags %s lblk %u pblk %llu len %u "
1678 "mflags %s ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001679 MAJOR(__entry->dev), MINOR(__entry->dev),
1680 (unsigned long) __entry->ino,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001681 show_map_flags(__entry->flags), __entry->lblk, __entry->pblk,
1682 __entry->len, show_mflags(__entry->mflags), __entry->ret)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001683);
1684
1685DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001686 TP_PROTO(struct inode *inode, unsigned flags,
1687 struct ext4_map_blocks *map, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001688
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001689 TP_ARGS(inode, flags, map, ret)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001690);
1691
1692DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001693 TP_PROTO(struct inode *inode, unsigned flags,
1694 struct ext4_map_blocks *map, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001695
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001696 TP_ARGS(inode, flags, map, ret)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001697);
1698
1699TRACE_EVENT(ext4_ext_load_extent,
1700 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk),
1701
1702 TP_ARGS(inode, lblk, pblk),
1703
1704 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001705 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001706 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001707 __field( ext4_fsblk_t, pblk )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001708 __field( ext4_lblk_t, lblk )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001709 ),
1710
1711 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001712 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001713 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001714 __entry->pblk = pblk;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001715 __entry->lblk = lblk;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001716 ),
1717
1718 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1719 MAJOR(__entry->dev), MINOR(__entry->dev),
1720 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001721 __entry->lblk, __entry->pblk)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001722);
1723
1724TRACE_EVENT(ext4_load_inode,
1725 TP_PROTO(struct inode *inode),
1726
1727 TP_ARGS(inode),
1728
1729 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001730 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001731 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001732 ),
1733
1734 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001735 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001736 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001737 ),
1738
1739 TP_printk("dev %d,%d ino %ld",
1740 MAJOR(__entry->dev), MINOR(__entry->dev),
1741 (unsigned long) __entry->ino)
1742);
1743
Theodore Ts'o12706392011-07-10 22:37:50 -04001744TRACE_EVENT(ext4_journal_start,
Jan Kara5fe2fe82013-06-04 12:37:50 -04001745 TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks,
1746 unsigned long IP),
Theodore Ts'o12706392011-07-10 22:37:50 -04001747
Jan Kara5fe2fe82013-06-04 12:37:50 -04001748 TP_ARGS(sb, blocks, rsv_blocks, IP),
Theodore Ts'o12706392011-07-10 22:37:50 -04001749
1750 TP_STRUCT__entry(
1751 __field( dev_t, dev )
Theodore Ts'o12706392011-07-10 22:37:50 -04001752 __field(unsigned long, ip )
Jan Kara5fe2fe82013-06-04 12:37:50 -04001753 __field( int, blocks )
1754 __field( int, rsv_blocks )
Theodore Ts'o12706392011-07-10 22:37:50 -04001755 ),
1756
1757 TP_fast_assign(
Jan Kara5fe2fe82013-06-04 12:37:50 -04001758 __entry->dev = sb->s_dev;
1759 __entry->ip = IP;
1760 __entry->blocks = blocks;
1761 __entry->rsv_blocks = rsv_blocks;
Theodore Ts'o12706392011-07-10 22:37:50 -04001762 ),
1763
Scott Woodbbedb172015-03-11 22:13:57 -05001764 TP_printk("dev %d,%d blocks, %d rsv_blocks, %d caller %pS",
Theodore Ts'o12706392011-07-10 22:37:50 -04001765 MAJOR(__entry->dev), MINOR(__entry->dev),
Jan Kara5fe2fe82013-06-04 12:37:50 -04001766 __entry->blocks, __entry->rsv_blocks, (void *)__entry->ip)
1767);
1768
1769TRACE_EVENT(ext4_journal_start_reserved,
1770 TP_PROTO(struct super_block *sb, int blocks, unsigned long IP),
1771
1772 TP_ARGS(sb, blocks, IP),
1773
1774 TP_STRUCT__entry(
1775 __field( dev_t, dev )
1776 __field(unsigned long, ip )
1777 __field( int, blocks )
1778 ),
1779
1780 TP_fast_assign(
1781 __entry->dev = sb->s_dev;
1782 __entry->ip = IP;
1783 __entry->blocks = blocks;
1784 ),
1785
Scott Woodbbedb172015-03-11 22:13:57 -05001786 TP_printk("dev %d,%d blocks, %d caller %pS",
Jan Kara5fe2fe82013-06-04 12:37:50 -04001787 MAJOR(__entry->dev), MINOR(__entry->dev),
1788 __entry->blocks, (void *)__entry->ip)
Theodore Ts'o12706392011-07-10 22:37:50 -04001789);
1790
Tao Mab3d4c2b2011-07-11 00:01:52 -04001791DECLARE_EVENT_CLASS(ext4__trim,
1792 TP_PROTO(struct super_block *sb,
1793 ext4_group_t group,
1794 ext4_grpblk_t start,
1795 ext4_grpblk_t len),
1796
1797 TP_ARGS(sb, group, start, len),
1798
1799 TP_STRUCT__entry(
1800 __field( int, dev_major )
1801 __field( int, dev_minor )
1802 __field( __u32, group )
1803 __field( int, start )
1804 __field( int, len )
1805 ),
1806
1807 TP_fast_assign(
1808 __entry->dev_major = MAJOR(sb->s_dev);
1809 __entry->dev_minor = MINOR(sb->s_dev);
1810 __entry->group = group;
1811 __entry->start = start;
1812 __entry->len = len;
1813 ),
1814
1815 TP_printk("dev %d,%d group %u, start %d, len %d",
1816 __entry->dev_major, __entry->dev_minor,
1817 __entry->group, __entry->start, __entry->len)
1818);
1819
1820DEFINE_EVENT(ext4__trim, ext4_trim_extent,
1821
1822 TP_PROTO(struct super_block *sb,
1823 ext4_group_t group,
1824 ext4_grpblk_t start,
1825 ext4_grpblk_t len),
1826
1827 TP_ARGS(sb, group, start, len)
1828);
1829
1830DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
1831
1832 TP_PROTO(struct super_block *sb,
1833 ext4_group_t group,
1834 ext4_grpblk_t start,
1835 ext4_grpblk_t len),
1836
1837 TP_ARGS(sb, group, start, len)
1838);
1839
Lukas Czerner556615d2014-04-20 23:45:47 -04001840TRACE_EVENT(ext4_ext_handle_unwritten_extents,
Zheng Liub5645532012-11-08 14:33:43 -05001841 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int flags,
Aditya Kalid8990242011-09-09 19:18:51 -04001842 unsigned int allocated, ext4_fsblk_t newblock),
1843
Zheng Liub5645532012-11-08 14:33:43 -05001844 TP_ARGS(inode, map, flags, allocated, newblock),
Aditya Kalid8990242011-09-09 19:18:51 -04001845
1846 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001847 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001848 __field( ino_t, ino )
1849 __field( int, flags )
Aditya Kalid8990242011-09-09 19:18:51 -04001850 __field( ext4_lblk_t, lblk )
1851 __field( ext4_fsblk_t, pblk )
1852 __field( unsigned int, len )
Aditya Kalid8990242011-09-09 19:18:51 -04001853 __field( unsigned int, allocated )
1854 __field( ext4_fsblk_t, newblk )
1855 ),
1856
1857 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001858 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001859 __entry->ino = inode->i_ino;
Zheng Liub5645532012-11-08 14:33:43 -05001860 __entry->flags = flags;
Aditya Kalid8990242011-09-09 19:18:51 -04001861 __entry->lblk = map->m_lblk;
1862 __entry->pblk = map->m_pblk;
1863 __entry->len = map->m_len;
Aditya Kalid8990242011-09-09 19:18:51 -04001864 __entry->allocated = allocated;
1865 __entry->newblk = newblock;
1866 ),
1867
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001868 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 -04001869 "allocated %d newblock %llu",
1870 MAJOR(__entry->dev), MINOR(__entry->dev),
1871 (unsigned long) __entry->ino,
1872 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001873 __entry->len, show_map_flags(__entry->flags),
Aditya Kalid8990242011-09-09 19:18:51 -04001874 (unsigned int) __entry->allocated,
1875 (unsigned long long) __entry->newblk)
1876);
1877
1878TRACE_EVENT(ext4_get_implied_cluster_alloc_exit,
1879 TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret),
1880
1881 TP_ARGS(sb, map, ret),
1882
1883 TP_STRUCT__entry(
1884 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001885 __field( unsigned int, flags )
Aditya Kalid8990242011-09-09 19:18:51 -04001886 __field( ext4_lblk_t, lblk )
1887 __field( ext4_fsblk_t, pblk )
1888 __field( unsigned int, len )
Aditya Kalid8990242011-09-09 19:18:51 -04001889 __field( int, ret )
1890 ),
1891
1892 TP_fast_assign(
1893 __entry->dev = sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001894 __entry->flags = map->m_flags;
Aditya Kalid8990242011-09-09 19:18:51 -04001895 __entry->lblk = map->m_lblk;
1896 __entry->pblk = map->m_pblk;
1897 __entry->len = map->m_len;
Aditya Kalid8990242011-09-09 19:18:51 -04001898 __entry->ret = ret;
1899 ),
1900
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001901 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 -04001902 MAJOR(__entry->dev), MINOR(__entry->dev),
1903 __entry->lblk, (unsigned long long) __entry->pblk,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001904 __entry->len, show_mflags(__entry->flags), __entry->ret)
Aditya Kalid8990242011-09-09 19:18:51 -04001905);
1906
1907TRACE_EVENT(ext4_ext_put_in_cache,
1908 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len,
1909 ext4_fsblk_t start),
1910
1911 TP_ARGS(inode, lblk, len, start),
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( unsigned int, len )
1918 __field( ext4_fsblk_t, start )
1919 ),
1920
1921 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001922 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001923 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04001924 __entry->lblk = lblk;
1925 __entry->len = len;
1926 __entry->start = start;
1927 ),
1928
1929 TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu",
1930 MAJOR(__entry->dev), MINOR(__entry->dev),
1931 (unsigned long) __entry->ino,
1932 (unsigned) __entry->lblk,
1933 __entry->len,
1934 (unsigned long long) __entry->start)
1935);
1936
1937TRACE_EVENT(ext4_ext_in_cache,
1938 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret),
1939
1940 TP_ARGS(inode, lblk, ret),
1941
1942 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001943 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001944 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04001945 __field( ext4_lblk_t, lblk )
1946 __field( int, ret )
1947 ),
1948
1949 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001950 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001951 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04001952 __entry->lblk = lblk;
1953 __entry->ret = ret;
1954 ),
1955
1956 TP_printk("dev %d,%d ino %lu lblk %u ret %d",
1957 MAJOR(__entry->dev), MINOR(__entry->dev),
1958 (unsigned long) __entry->ino,
1959 (unsigned) __entry->lblk,
1960 __entry->ret)
1961
1962);
1963
1964TRACE_EVENT(ext4_find_delalloc_range,
1965 TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to,
1966 int reverse, int found, ext4_lblk_t found_blk),
1967
1968 TP_ARGS(inode, from, to, reverse, found, found_blk),
1969
1970 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001971 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001972 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04001973 __field( ext4_lblk_t, from )
1974 __field( ext4_lblk_t, to )
1975 __field( int, reverse )
1976 __field( int, found )
1977 __field( ext4_lblk_t, found_blk )
1978 ),
1979
1980 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001981 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001982 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04001983 __entry->from = from;
1984 __entry->to = to;
1985 __entry->reverse = reverse;
1986 __entry->found = found;
1987 __entry->found_blk = found_blk;
1988 ),
1989
1990 TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d "
1991 "(blk = %u)",
1992 MAJOR(__entry->dev), MINOR(__entry->dev),
1993 (unsigned long) __entry->ino,
1994 (unsigned) __entry->from, (unsigned) __entry->to,
1995 __entry->reverse, __entry->found,
1996 (unsigned) __entry->found_blk)
1997);
1998
1999TRACE_EVENT(ext4_get_reserved_cluster_alloc,
2000 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len),
2001
2002 TP_ARGS(inode, lblk, len),
2003
2004 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002005 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002006 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002007 __field( ext4_lblk_t, lblk )
2008 __field( unsigned int, len )
2009 ),
2010
2011 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002012 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002013 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002014 __entry->lblk = lblk;
2015 __entry->len = len;
2016 ),
2017
2018 TP_printk("dev %d,%d ino %lu lblk %u len %u",
2019 MAJOR(__entry->dev), MINOR(__entry->dev),
2020 (unsigned long) __entry->ino,
2021 (unsigned) __entry->lblk,
2022 __entry->len)
2023);
2024
2025TRACE_EVENT(ext4_ext_show_extent,
2026 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk,
2027 unsigned short len),
2028
2029 TP_ARGS(inode, lblk, pblk, len),
2030
2031 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002032 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002033 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002034 __field( ext4_fsblk_t, pblk )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002035 __field( ext4_lblk_t, lblk )
Aditya Kalid8990242011-09-09 19:18:51 -04002036 __field( unsigned short, len )
2037 ),
2038
2039 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002040 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002041 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002042 __entry->pblk = pblk;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002043 __entry->lblk = lblk;
Aditya Kalid8990242011-09-09 19:18:51 -04002044 __entry->len = len;
2045 ),
2046
2047 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u",
2048 MAJOR(__entry->dev), MINOR(__entry->dev),
2049 (unsigned long) __entry->ino,
2050 (unsigned) __entry->lblk,
2051 (unsigned long long) __entry->pblk,
2052 (unsigned short) __entry->len)
2053);
2054
2055TRACE_EVENT(ext4_remove_blocks,
2056 TP_PROTO(struct inode *inode, struct ext4_extent *ex,
2057 ext4_lblk_t from, ext4_fsblk_t to,
Lukas Czernerd23142c2013-05-27 23:33:35 -04002058 long long partial_cluster),
Aditya Kalid8990242011-09-09 19:18:51 -04002059
2060 TP_ARGS(inode, ex, from, to, partial_cluster),
2061
2062 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002063 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002064 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002065 __field( ext4_lblk_t, from )
2066 __field( ext4_lblk_t, to )
Lukas Czernerd23142c2013-05-27 23:33:35 -04002067 __field( long long, partial )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002068 __field( ext4_fsblk_t, ee_pblk )
2069 __field( ext4_lblk_t, ee_lblk )
2070 __field( unsigned short, ee_len )
Aditya Kalid8990242011-09-09 19:18:51 -04002071 ),
2072
2073 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002074 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002075 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002076 __entry->from = from;
2077 __entry->to = to;
2078 __entry->partial = partial_cluster;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002079 __entry->ee_pblk = ext4_ext_pblock(ex);
Theodore Ts'od6a77102013-04-09 23:59:55 -04002080 __entry->ee_lblk = le32_to_cpu(ex->ee_block);
Anatol Pomozov210c0522012-08-17 09:50:17 -04002081 __entry->ee_len = ext4_ext_get_actual_len(ex);
Aditya Kalid8990242011-09-09 19:18:51 -04002082 ),
2083
2084 TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
Lukas Czernerd23142c2013-05-27 23:33:35 -04002085 "from %u to %u partial_cluster %lld",
Aditya Kalid8990242011-09-09 19:18:51 -04002086 MAJOR(__entry->dev), MINOR(__entry->dev),
2087 (unsigned long) __entry->ino,
2088 (unsigned) __entry->ee_lblk,
2089 (unsigned long long) __entry->ee_pblk,
2090 (unsigned short) __entry->ee_len,
2091 (unsigned) __entry->from,
2092 (unsigned) __entry->to,
Lukas Czernerd23142c2013-05-27 23:33:35 -04002093 (long long) __entry->partial)
Aditya Kalid8990242011-09-09 19:18:51 -04002094);
2095
2096TRACE_EVENT(ext4_ext_rm_leaf,
2097 TP_PROTO(struct inode *inode, ext4_lblk_t start,
Lukas Czernerd23142c2013-05-27 23:33:35 -04002098 struct ext4_extent *ex,
2099 long long partial_cluster),
Aditya Kalid8990242011-09-09 19:18:51 -04002100
2101 TP_ARGS(inode, start, ex, partial_cluster),
2102
2103 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002104 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002105 __field( ino_t, ino )
Lukas Czernerd23142c2013-05-27 23:33:35 -04002106 __field( long long, partial )
Aditya Kalid8990242011-09-09 19:18:51 -04002107 __field( ext4_lblk_t, start )
2108 __field( ext4_lblk_t, ee_lblk )
2109 __field( ext4_fsblk_t, ee_pblk )
2110 __field( short, ee_len )
Aditya Kalid8990242011-09-09 19:18:51 -04002111 ),
2112
2113 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002114 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002115 __entry->ino = inode->i_ino;
2116 __entry->partial = partial_cluster;
Aditya Kalid8990242011-09-09 19:18:51 -04002117 __entry->start = start;
2118 __entry->ee_lblk = le32_to_cpu(ex->ee_block);
2119 __entry->ee_pblk = ext4_ext_pblock(ex);
2120 __entry->ee_len = ext4_ext_get_actual_len(ex);
Aditya Kalid8990242011-09-09 19:18:51 -04002121 ),
2122
2123 TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
Lukas Czernerd23142c2013-05-27 23:33:35 -04002124 "partial_cluster %lld",
Aditya Kalid8990242011-09-09 19:18:51 -04002125 MAJOR(__entry->dev), MINOR(__entry->dev),
2126 (unsigned long) __entry->ino,
2127 (unsigned) __entry->start,
2128 (unsigned) __entry->ee_lblk,
2129 (unsigned long long) __entry->ee_pblk,
2130 (unsigned short) __entry->ee_len,
Lukas Czernerd23142c2013-05-27 23:33:35 -04002131 (long long) __entry->partial)
Aditya Kalid8990242011-09-09 19:18:51 -04002132);
2133
2134TRACE_EVENT(ext4_ext_rm_idx,
2135 TP_PROTO(struct inode *inode, ext4_fsblk_t pblk),
2136
2137 TP_ARGS(inode, pblk),
2138
2139 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002140 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002141 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002142 __field( ext4_fsblk_t, pblk )
2143 ),
2144
2145 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002146 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002147 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002148 __entry->pblk = pblk;
2149 ),
2150
2151 TP_printk("dev %d,%d ino %lu index_pblk %llu",
2152 MAJOR(__entry->dev), MINOR(__entry->dev),
2153 (unsigned long) __entry->ino,
2154 (unsigned long long) __entry->pblk)
2155);
2156
2157TRACE_EVENT(ext4_ext_remove_space,
Lukas Czerner61801322013-05-27 23:32:35 -04002158 TP_PROTO(struct inode *inode, ext4_lblk_t start,
2159 ext4_lblk_t end, int depth),
Aditya Kalid8990242011-09-09 19:18:51 -04002160
Lukas Czerner61801322013-05-27 23:32:35 -04002161 TP_ARGS(inode, start, end, depth),
Aditya Kalid8990242011-09-09 19:18:51 -04002162
2163 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002164 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002165 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002166 __field( ext4_lblk_t, start )
Lukas Czerner61801322013-05-27 23:32:35 -04002167 __field( ext4_lblk_t, end )
Aditya Kalid8990242011-09-09 19:18:51 -04002168 __field( int, depth )
2169 ),
2170
2171 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002172 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002173 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002174 __entry->start = start;
Lukas Czerner61801322013-05-27 23:32:35 -04002175 __entry->end = end;
Aditya Kalid8990242011-09-09 19:18:51 -04002176 __entry->depth = depth;
2177 ),
2178
Lukas Czerner61801322013-05-27 23:32:35 -04002179 TP_printk("dev %d,%d ino %lu since %u end %u depth %d",
Aditya Kalid8990242011-09-09 19:18:51 -04002180 MAJOR(__entry->dev), MINOR(__entry->dev),
2181 (unsigned long) __entry->ino,
2182 (unsigned) __entry->start,
Lukas Czerner61801322013-05-27 23:32:35 -04002183 (unsigned) __entry->end,
Aditya Kalid8990242011-09-09 19:18:51 -04002184 __entry->depth)
2185);
2186
2187TRACE_EVENT(ext4_ext_remove_space_done,
Lukas Czerner61801322013-05-27 23:32:35 -04002188 TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end,
Lukas Czernerd23142c2013-05-27 23:33:35 -04002189 int depth, long long partial, __le16 eh_entries),
Aditya Kalid8990242011-09-09 19:18:51 -04002190
Lukas Czerner61801322013-05-27 23:32:35 -04002191 TP_ARGS(inode, start, end, depth, partial, eh_entries),
Aditya Kalid8990242011-09-09 19:18:51 -04002192
2193 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002194 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002195 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002196 __field( ext4_lblk_t, start )
Lukas Czerner61801322013-05-27 23:32:35 -04002197 __field( ext4_lblk_t, end )
Aditya Kalid8990242011-09-09 19:18:51 -04002198 __field( int, depth )
Lukas Czernerd23142c2013-05-27 23:33:35 -04002199 __field( long long, partial )
Aditya Kalid8990242011-09-09 19:18:51 -04002200 __field( unsigned short, eh_entries )
2201 ),
2202
2203 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002204 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002205 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002206 __entry->start = start;
Lukas Czerner61801322013-05-27 23:32:35 -04002207 __entry->end = end;
Aditya Kalid8990242011-09-09 19:18:51 -04002208 __entry->depth = depth;
2209 __entry->partial = partial;
Theodore Ts'od6a77102013-04-09 23:59:55 -04002210 __entry->eh_entries = le16_to_cpu(eh_entries);
Aditya Kalid8990242011-09-09 19:18:51 -04002211 ),
2212
Lukas Czernerd23142c2013-05-27 23:33:35 -04002213 TP_printk("dev %d,%d ino %lu since %u end %u depth %d partial %lld "
Aditya Kalid8990242011-09-09 19:18:51 -04002214 "remaining_entries %u",
2215 MAJOR(__entry->dev), MINOR(__entry->dev),
2216 (unsigned long) __entry->ino,
2217 (unsigned) __entry->start,
Lukas Czerner61801322013-05-27 23:32:35 -04002218 (unsigned) __entry->end,
Aditya Kalid8990242011-09-09 19:18:51 -04002219 __entry->depth,
Lukas Czernerd23142c2013-05-27 23:33:35 -04002220 (long long) __entry->partial,
Aditya Kalid8990242011-09-09 19:18:51 -04002221 (unsigned short) __entry->eh_entries)
2222);
2223
Theodore Ts'o107a7bd2013-08-16 21:23:41 -04002224DECLARE_EVENT_CLASS(ext4__es_extent,
Zheng Liufdc02122013-02-18 00:26:51 -05002225 TP_PROTO(struct inode *inode, struct extent_status *es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002226
Zheng Liufdc02122013-02-18 00:26:51 -05002227 TP_ARGS(inode, es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002228
2229 TP_STRUCT__entry(
Zheng Liufdc02122013-02-18 00:26:51 -05002230 __field( dev_t, dev )
2231 __field( ino_t, ino )
2232 __field( ext4_lblk_t, lblk )
2233 __field( ext4_lblk_t, len )
2234 __field( ext4_fsblk_t, pblk )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002235 __field( char, status )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002236 ),
2237
2238 TP_fast_assign(
2239 __entry->dev = inode->i_sb->s_dev;
2240 __entry->ino = inode->i_ino;
Zheng Liufdc02122013-02-18 00:26:51 -05002241 __entry->lblk = es->es_lblk;
2242 __entry->len = es->es_len;
2243 __entry->pblk = ext4_es_pblock(es);
Theodore Ts'o3be78c72013-08-16 21:22:41 -04002244 __entry->status = ext4_es_status(es);
Zheng Liu992e9fd2012-11-08 21:57:33 -05002245 ),
2246
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002247 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
Zheng Liu992e9fd2012-11-08 21:57:33 -05002248 MAJOR(__entry->dev), MINOR(__entry->dev),
2249 (unsigned long) __entry->ino,
Zheng Liufdc02122013-02-18 00:26:51 -05002250 __entry->lblk, __entry->len,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002251 __entry->pblk, show_extent_status(__entry->status))
Zheng Liu992e9fd2012-11-08 21:57:33 -05002252);
2253
Theodore Ts'o107a7bd2013-08-16 21:23:41 -04002254DEFINE_EVENT(ext4__es_extent, ext4_es_insert_extent,
2255 TP_PROTO(struct inode *inode, struct extent_status *es),
2256
2257 TP_ARGS(inode, es)
2258);
2259
2260DEFINE_EVENT(ext4__es_extent, ext4_es_cache_extent,
2261 TP_PROTO(struct inode *inode, struct extent_status *es),
2262
2263 TP_ARGS(inode, es)
2264);
2265
Zheng Liu992e9fd2012-11-08 21:57:33 -05002266TRACE_EVENT(ext4_es_remove_extent,
Zheng Liu06b0c882013-02-18 00:26:51 -05002267 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002268
Zheng Liu06b0c882013-02-18 00:26:51 -05002269 TP_ARGS(inode, lblk, len),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002270
2271 TP_STRUCT__entry(
2272 __field( dev_t, dev )
2273 __field( ino_t, ino )
Zheng Liu06b0c882013-02-18 00:26:51 -05002274 __field( loff_t, lblk )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002275 __field( loff_t, len )
2276 ),
2277
2278 TP_fast_assign(
2279 __entry->dev = inode->i_sb->s_dev;
2280 __entry->ino = inode->i_ino;
Zheng Liu06b0c882013-02-18 00:26:51 -05002281 __entry->lblk = lblk;
Zheng Liu992e9fd2012-11-08 21:57:33 -05002282 __entry->len = len;
2283 ),
2284
2285 TP_printk("dev %d,%d ino %lu es [%lld/%lld)",
2286 MAJOR(__entry->dev), MINOR(__entry->dev),
2287 (unsigned long) __entry->ino,
Zheng Liu06b0c882013-02-18 00:26:51 -05002288 __entry->lblk, __entry->len)
Zheng Liu992e9fd2012-11-08 21:57:33 -05002289);
2290
Yan, Zhenge30b5dc2013-05-03 02:15:52 -04002291TRACE_EVENT(ext4_es_find_delayed_extent_range_enter,
Zheng Liu06b0c882013-02-18 00:26:51 -05002292 TP_PROTO(struct inode *inode, ext4_lblk_t lblk),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002293
Zheng Liu06b0c882013-02-18 00:26:51 -05002294 TP_ARGS(inode, lblk),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002295
2296 TP_STRUCT__entry(
2297 __field( dev_t, dev )
2298 __field( ino_t, ino )
Zheng Liu06b0c882013-02-18 00:26:51 -05002299 __field( ext4_lblk_t, lblk )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002300 ),
2301
2302 TP_fast_assign(
2303 __entry->dev = inode->i_sb->s_dev;
2304 __entry->ino = inode->i_ino;
Zheng Liu06b0c882013-02-18 00:26:51 -05002305 __entry->lblk = lblk;
Zheng Liu992e9fd2012-11-08 21:57:33 -05002306 ),
2307
Zheng Liu06b0c882013-02-18 00:26:51 -05002308 TP_printk("dev %d,%d ino %lu lblk %u",
Zheng Liu992e9fd2012-11-08 21:57:33 -05002309 MAJOR(__entry->dev), MINOR(__entry->dev),
Zheng Liu06b0c882013-02-18 00:26:51 -05002310 (unsigned long) __entry->ino, __entry->lblk)
Zheng Liu992e9fd2012-11-08 21:57:33 -05002311);
2312
Yan, Zhenge30b5dc2013-05-03 02:15:52 -04002313TRACE_EVENT(ext4_es_find_delayed_extent_range_exit,
Zheng Liube401362013-02-18 00:27:26 -05002314 TP_PROTO(struct inode *inode, struct extent_status *es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002315
Zheng Liube401362013-02-18 00:27:26 -05002316 TP_ARGS(inode, es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002317
2318 TP_STRUCT__entry(
2319 __field( dev_t, dev )
2320 __field( ino_t, ino )
Zheng Liu06b0c882013-02-18 00:26:51 -05002321 __field( ext4_lblk_t, lblk )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002322 __field( ext4_lblk_t, len )
Zheng Liufdc02122013-02-18 00:26:51 -05002323 __field( ext4_fsblk_t, pblk )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002324 __field( char, status )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002325 ),
2326
2327 TP_fast_assign(
2328 __entry->dev = inode->i_sb->s_dev;
2329 __entry->ino = inode->i_ino;
Zheng Liu06b0c882013-02-18 00:26:51 -05002330 __entry->lblk = es->es_lblk;
2331 __entry->len = es->es_len;
Zheng Liufdc02122013-02-18 00:26:51 -05002332 __entry->pblk = ext4_es_pblock(es);
Theodore Ts'o3be78c72013-08-16 21:22:41 -04002333 __entry->status = ext4_es_status(es);
Zheng Liu992e9fd2012-11-08 21:57:33 -05002334 ),
2335
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002336 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
Zheng Liu992e9fd2012-11-08 21:57:33 -05002337 MAJOR(__entry->dev), MINOR(__entry->dev),
2338 (unsigned long) __entry->ino,
Zheng Liufdc02122013-02-18 00:26:51 -05002339 __entry->lblk, __entry->len,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002340 __entry->pblk, show_extent_status(__entry->status))
Zheng Liu992e9fd2012-11-08 21:57:33 -05002341);
2342
Zheng Liud100eef2013-02-18 00:29:59 -05002343TRACE_EVENT(ext4_es_lookup_extent_enter,
2344 TP_PROTO(struct inode *inode, ext4_lblk_t lblk),
2345
2346 TP_ARGS(inode, lblk),
2347
2348 TP_STRUCT__entry(
2349 __field( dev_t, dev )
2350 __field( ino_t, ino )
2351 __field( ext4_lblk_t, lblk )
2352 ),
2353
2354 TP_fast_assign(
2355 __entry->dev = inode->i_sb->s_dev;
2356 __entry->ino = inode->i_ino;
2357 __entry->lblk = lblk;
2358 ),
2359
2360 TP_printk("dev %d,%d ino %lu lblk %u",
2361 MAJOR(__entry->dev), MINOR(__entry->dev),
2362 (unsigned long) __entry->ino, __entry->lblk)
2363);
2364
2365TRACE_EVENT(ext4_es_lookup_extent_exit,
2366 TP_PROTO(struct inode *inode, struct extent_status *es,
2367 int found),
2368
2369 TP_ARGS(inode, es, found),
2370
2371 TP_STRUCT__entry(
2372 __field( dev_t, dev )
2373 __field( ino_t, ino )
2374 __field( ext4_lblk_t, lblk )
2375 __field( ext4_lblk_t, len )
2376 __field( ext4_fsblk_t, pblk )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002377 __field( char, status )
Zheng Liud100eef2013-02-18 00:29:59 -05002378 __field( int, found )
2379 ),
2380
2381 TP_fast_assign(
2382 __entry->dev = inode->i_sb->s_dev;
2383 __entry->ino = inode->i_ino;
2384 __entry->lblk = es->es_lblk;
2385 __entry->len = es->es_len;
2386 __entry->pblk = ext4_es_pblock(es);
Theodore Ts'o3be78c72013-08-16 21:22:41 -04002387 __entry->status = ext4_es_status(es);
Zheng Liud100eef2013-02-18 00:29:59 -05002388 __entry->found = found;
2389 ),
2390
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002391 TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %s",
Zheng Liud100eef2013-02-18 00:29:59 -05002392 MAJOR(__entry->dev), MINOR(__entry->dev),
2393 (unsigned long) __entry->ino, __entry->found,
2394 __entry->lblk, __entry->len,
2395 __entry->found ? __entry->pblk : 0,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002396 show_extent_status(__entry->found ? __entry->status : 0))
Zheng Liud100eef2013-02-18 00:29:59 -05002397);
2398
Zheng Liue963bb12014-09-01 22:22:13 -04002399DECLARE_EVENT_CLASS(ext4__es_shrink_enter,
Theodore Ts'o24630772013-02-28 23:58:56 -05002400 TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002401
Theodore Ts'o24630772013-02-28 23:58:56 -05002402 TP_ARGS(sb, nr_to_scan, cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002403
2404 TP_STRUCT__entry(
2405 __field( dev_t, dev )
2406 __field( int, nr_to_scan )
Theodore Ts'o24630772013-02-28 23:58:56 -05002407 __field( int, cache_cnt )
Zheng Liu74cd15c2013-02-18 00:32:55 -05002408 ),
2409
2410 TP_fast_assign(
2411 __entry->dev = sb->s_dev;
2412 __entry->nr_to_scan = nr_to_scan;
Theodore Ts'o24630772013-02-28 23:58:56 -05002413 __entry->cache_cnt = cache_cnt;
Zheng Liu74cd15c2013-02-18 00:32:55 -05002414 ),
2415
Theodore Ts'o24630772013-02-28 23:58:56 -05002416 TP_printk("dev %d,%d nr_to_scan %d cache_cnt %d",
Zheng Liu74cd15c2013-02-18 00:32:55 -05002417 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o24630772013-02-28 23:58:56 -05002418 __entry->nr_to_scan, __entry->cache_cnt)
Zheng Liu74cd15c2013-02-18 00:32:55 -05002419);
2420
Zheng Liue963bb12014-09-01 22:22:13 -04002421DEFINE_EVENT(ext4__es_shrink_enter, ext4_es_shrink_count,
2422 TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002423
Zheng Liue963bb12014-09-01 22:22:13 -04002424 TP_ARGS(sb, nr_to_scan, cache_cnt)
2425);
2426
2427DEFINE_EVENT(ext4__es_shrink_enter, ext4_es_shrink_scan_enter,
2428 TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt),
2429
2430 TP_ARGS(sb, nr_to_scan, cache_cnt)
2431);
2432
2433TRACE_EVENT(ext4_es_shrink_scan_exit,
2434 TP_PROTO(struct super_block *sb, int nr_shrunk, int cache_cnt),
2435
2436 TP_ARGS(sb, nr_shrunk, cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002437
2438 TP_STRUCT__entry(
2439 __field( dev_t, dev )
Zheng Liue963bb12014-09-01 22:22:13 -04002440 __field( int, nr_shrunk )
Theodore Ts'o24630772013-02-28 23:58:56 -05002441 __field( int, cache_cnt )
Zheng Liu74cd15c2013-02-18 00:32:55 -05002442 ),
2443
2444 TP_fast_assign(
2445 __entry->dev = sb->s_dev;
Zheng Liue963bb12014-09-01 22:22:13 -04002446 __entry->nr_shrunk = nr_shrunk;
Theodore Ts'o24630772013-02-28 23:58:56 -05002447 __entry->cache_cnt = cache_cnt;
Zheng Liu74cd15c2013-02-18 00:32:55 -05002448 ),
2449
Zheng Liue963bb12014-09-01 22:22:13 -04002450 TP_printk("dev %d,%d nr_shrunk %d cache_cnt %d",
Zheng Liu74cd15c2013-02-18 00:32:55 -05002451 MAJOR(__entry->dev), MINOR(__entry->dev),
Zheng Liue963bb12014-09-01 22:22:13 -04002452 __entry->nr_shrunk, __entry->cache_cnt)
Zheng Liu74cd15c2013-02-18 00:32:55 -05002453);
2454
Namjae Jeon9eb79482014-02-23 15:18:59 -05002455TRACE_EVENT(ext4_collapse_range,
2456 TP_PROTO(struct inode *inode, loff_t offset, loff_t len),
2457
2458 TP_ARGS(inode, offset, len),
2459
2460 TP_STRUCT__entry(
2461 __field(dev_t, dev)
2462 __field(ino_t, ino)
2463 __field(loff_t, offset)
2464 __field(loff_t, len)
2465 ),
2466
2467 TP_fast_assign(
2468 __entry->dev = inode->i_sb->s_dev;
2469 __entry->ino = inode->i_ino;
2470 __entry->offset = offset;
2471 __entry->len = len;
2472 ),
2473
2474 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2475 MAJOR(__entry->dev), MINOR(__entry->dev),
2476 (unsigned long) __entry->ino,
2477 __entry->offset, __entry->len)
2478);
2479
Namjae Jeon331573f2015-06-09 01:55:03 -04002480TRACE_EVENT(ext4_insert_range,
2481 TP_PROTO(struct inode *inode, loff_t offset, loff_t len),
2482
2483 TP_ARGS(inode, offset, len),
2484
2485 TP_STRUCT__entry(
2486 __field(dev_t, dev)
2487 __field(ino_t, ino)
2488 __field(loff_t, offset)
2489 __field(loff_t, len)
2490 ),
2491
2492 TP_fast_assign(
2493 __entry->dev = inode->i_sb->s_dev;
2494 __entry->ino = inode->i_ino;
2495 __entry->offset = offset;
2496 __entry->len = len;
2497 ),
2498
2499 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2500 MAJOR(__entry->dev), MINOR(__entry->dev),
2501 (unsigned long) __entry->ino,
2502 __entry->offset, __entry->len)
2503);
2504
Zheng Liueb68d0e2014-09-01 22:26:49 -04002505TRACE_EVENT(ext4_es_shrink,
2506 TP_PROTO(struct super_block *sb, int nr_shrunk, u64 scan_time,
Zheng Liuedaa53c2014-11-25 11:45:37 -05002507 int nr_skipped, int retried),
Zheng Liueb68d0e2014-09-01 22:26:49 -04002508
Zheng Liuedaa53c2014-11-25 11:45:37 -05002509 TP_ARGS(sb, nr_shrunk, scan_time, nr_skipped, retried),
Zheng Liueb68d0e2014-09-01 22:26:49 -04002510
2511 TP_STRUCT__entry(
2512 __field( dev_t, dev )
2513 __field( int, nr_shrunk )
2514 __field( unsigned long long, scan_time )
Zheng Liueb68d0e2014-09-01 22:26:49 -04002515 __field( int, nr_skipped )
2516 __field( int, retried )
2517 ),
2518
2519 TP_fast_assign(
2520 __entry->dev = sb->s_dev;
2521 __entry->nr_shrunk = nr_shrunk;
2522 __entry->scan_time = div_u64(scan_time, 1000);
Zheng Liueb68d0e2014-09-01 22:26:49 -04002523 __entry->nr_skipped = nr_skipped;
2524 __entry->retried = retried;
2525 ),
2526
Zheng Liuedaa53c2014-11-25 11:45:37 -05002527 TP_printk("dev %d,%d nr_shrunk %d, scan_time %llu "
Zheng Liueb68d0e2014-09-01 22:26:49 -04002528 "nr_skipped %d retried %d",
2529 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->nr_shrunk,
Zheng Liuedaa53c2014-11-25 11:45:37 -05002530 __entry->scan_time, __entry->nr_skipped, __entry->retried)
Zheng Liueb68d0e2014-09-01 22:26:49 -04002531);
2532
Darrick J. Wong0c9ec4b2017-04-30 00:36:53 -04002533/* fsmap traces */
2534DECLARE_EVENT_CLASS(ext4_fsmap_class,
2535 TP_PROTO(struct super_block *sb, u32 keydev, u32 agno, u64 bno, u64 len,
2536 u64 owner),
2537 TP_ARGS(sb, keydev, agno, bno, len, owner),
2538 TP_STRUCT__entry(
2539 __field(dev_t, dev)
2540 __field(dev_t, keydev)
2541 __field(u32, agno)
2542 __field(u64, bno)
2543 __field(u64, len)
2544 __field(u64, owner)
2545 ),
2546 TP_fast_assign(
2547 __entry->dev = sb->s_bdev->bd_dev;
2548 __entry->keydev = new_decode_dev(keydev);
2549 __entry->agno = agno;
2550 __entry->bno = bno;
2551 __entry->len = len;
2552 __entry->owner = owner;
2553 ),
2554 TP_printk("dev %d:%d keydev %d:%d agno %u bno %llu len %llu owner %lld\n",
2555 MAJOR(__entry->dev), MINOR(__entry->dev),
2556 MAJOR(__entry->keydev), MINOR(__entry->keydev),
2557 __entry->agno,
2558 __entry->bno,
2559 __entry->len,
2560 __entry->owner)
2561)
2562#define DEFINE_FSMAP_EVENT(name) \
2563DEFINE_EVENT(ext4_fsmap_class, name, \
2564 TP_PROTO(struct super_block *sb, u32 keydev, u32 agno, u64 bno, u64 len, \
2565 u64 owner), \
2566 TP_ARGS(sb, keydev, agno, bno, len, owner))
2567DEFINE_FSMAP_EVENT(ext4_fsmap_low_key);
2568DEFINE_FSMAP_EVENT(ext4_fsmap_high_key);
2569DEFINE_FSMAP_EVENT(ext4_fsmap_mapping);
2570
2571DECLARE_EVENT_CLASS(ext4_getfsmap_class,
2572 TP_PROTO(struct super_block *sb, struct ext4_fsmap *fsmap),
2573 TP_ARGS(sb, fsmap),
2574 TP_STRUCT__entry(
2575 __field(dev_t, dev)
2576 __field(dev_t, keydev)
2577 __field(u64, block)
2578 __field(u64, len)
2579 __field(u64, owner)
2580 __field(u64, flags)
2581 ),
2582 TP_fast_assign(
2583 __entry->dev = sb->s_bdev->bd_dev;
2584 __entry->keydev = new_decode_dev(fsmap->fmr_device);
2585 __entry->block = fsmap->fmr_physical;
2586 __entry->len = fsmap->fmr_length;
2587 __entry->owner = fsmap->fmr_owner;
2588 __entry->flags = fsmap->fmr_flags;
2589 ),
2590 TP_printk("dev %d:%d keydev %d:%d block %llu len %llu owner %lld flags 0x%llx\n",
2591 MAJOR(__entry->dev), MINOR(__entry->dev),
2592 MAJOR(__entry->keydev), MINOR(__entry->keydev),
2593 __entry->block,
2594 __entry->len,
2595 __entry->owner,
2596 __entry->flags)
2597)
2598#define DEFINE_GETFSMAP_EVENT(name) \
2599DEFINE_EVENT(ext4_getfsmap_class, name, \
2600 TP_PROTO(struct super_block *sb, struct ext4_fsmap *fsmap), \
2601 TP_ARGS(sb, fsmap))
2602DEFINE_GETFSMAP_EVENT(ext4_getfsmap_low_key);
2603DEFINE_GETFSMAP_EVENT(ext4_getfsmap_high_key);
2604DEFINE_GETFSMAP_EVENT(ext4_getfsmap_mapping);
2605
Theodore Ts'o9bffad12009-06-17 11:48:11 -04002606#endif /* _TRACE_EXT4_H */
2607
2608/* This part must be outside protection */
2609#include <trace/define_trace.h>