blob: 40ff8a2fc7635920bdbbf93da2a1923461c1438c [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Theodore Ts'o9bffad12009-06-17 11:48:11 -04002#undef TRACE_SYSTEM
3#define TRACE_SYSTEM ext4
4
Li Zefand0b6e042009-07-13 10:33:21 +08005#if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ)
6#define _TRACE_EXT4_H
7
Theodore Ts'o9bffad12009-06-17 11:48:11 -04008#include <linux/writeback.h>
Theodore Ts'o9bffad12009-06-17 11:48:11 -04009#include <linux/tracepoint.h>
10
Theodore Ts'o3661d282009-09-14 22:59:50 -040011struct ext4_allocation_context;
12struct ext4_allocation_request;
Eric Gouriou6f91bc52011-10-27 11:43:23 -040013struct ext4_extent;
Theodore Ts'o3661d282009-09-14 22:59:50 -040014struct ext4_prealloc_space;
Theodore Ts'ofb40ba02009-09-16 19:30:40 -040015struct ext4_inode_info;
Josh Stone0ef12242009-09-30 00:51:22 -040016struct mpage_da_data;
Aditya Kalid8990242011-09-09 19:18:51 -040017struct ext4_map_blocks;
Zheng Liu992e9fd2012-11-08 21:57:33 -050018struct extent_status;
Darrick J. Wong0c9ec4b2017-04-30 00:36:53 -040019struct ext4_fsmap;
Eric Whitney9fe67142018-10-01 14:25:08 -040020struct partial_cluster;
Theodore Ts'ofb40ba02009-09-16 19:30:40 -040021
22#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
Theodore Ts'o3661d282009-09-14 22:59:50 -040023
Theodore Ts'o21ddd562013-07-01 08:12:40 -040024#define show_mballoc_flags(flags) __print_flags(flags, "|", \
25 { EXT4_MB_HINT_MERGE, "HINT_MERGE" }, \
26 { EXT4_MB_HINT_RESERVED, "HINT_RESV" }, \
27 { EXT4_MB_HINT_METADATA, "HINT_MDATA" }, \
28 { EXT4_MB_HINT_FIRST, "HINT_FIRST" }, \
29 { EXT4_MB_HINT_BEST, "HINT_BEST" }, \
30 { EXT4_MB_HINT_DATA, "HINT_DATA" }, \
31 { EXT4_MB_HINT_NOPREALLOC, "HINT_NOPREALLOC" }, \
32 { EXT4_MB_HINT_GROUP_ALLOC, "HINT_GRP_ALLOC" }, \
33 { EXT4_MB_HINT_GOAL_ONLY, "HINT_GOAL_ONLY" }, \
34 { EXT4_MB_HINT_TRY_GOAL, "HINT_TRY_GOAL" }, \
35 { EXT4_MB_DELALLOC_RESERVED, "DELALLOC_RESV" }, \
36 { EXT4_MB_STREAM_ALLOC, "STREAM_ALLOC" }, \
37 { EXT4_MB_USE_ROOT_BLOCKS, "USE_ROOT_BLKS" }, \
38 { EXT4_MB_USE_RESERVED, "USE_RESV" })
39
40#define show_map_flags(flags) __print_flags(flags, "|", \
41 { EXT4_GET_BLOCKS_CREATE, "CREATE" }, \
Lukas Czerner556615d2014-04-20 23:45:47 -040042 { EXT4_GET_BLOCKS_UNWRIT_EXT, "UNWRIT" }, \
Theodore Ts'o21ddd562013-07-01 08:12:40 -040043 { EXT4_GET_BLOCKS_DELALLOC_RESERVE, "DELALLOC" }, \
44 { EXT4_GET_BLOCKS_PRE_IO, "PRE_IO" }, \
45 { EXT4_GET_BLOCKS_CONVERT, "CONVERT" }, \
46 { EXT4_GET_BLOCKS_METADATA_NOFAIL, "METADATA_NOFAIL" }, \
47 { EXT4_GET_BLOCKS_NO_NORMALIZE, "NO_NORMALIZE" }, \
Jan Karac86d8db2015-12-07 15:10:26 -050048 { EXT4_GET_BLOCKS_ZERO, "ZERO" })
Theodore Ts'o21ddd562013-07-01 08:12:40 -040049
Dmitry Monakhov459c8072019-11-14 20:01:46 +000050/*
51 * __print_flags() requires that all enum values be wrapped in the
52 * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
53 * ring buffer.
54 */
55TRACE_DEFINE_ENUM(BH_New);
56TRACE_DEFINE_ENUM(BH_Mapped);
57TRACE_DEFINE_ENUM(BH_Unwritten);
58TRACE_DEFINE_ENUM(BH_Boundary);
59
Theodore Ts'o21ddd562013-07-01 08:12:40 -040060#define show_mflags(flags) __print_flags(flags, "", \
61 { EXT4_MAP_NEW, "N" }, \
62 { EXT4_MAP_MAPPED, "M" }, \
63 { EXT4_MAP_UNWRITTEN, "U" }, \
Jan Karacbd75842014-11-25 11:41:49 -050064 { EXT4_MAP_BOUNDARY, "B" })
Theodore Ts'o21ddd562013-07-01 08:12:40 -040065
66#define show_free_flags(flags) __print_flags(flags, "|", \
67 { EXT4_FREE_BLOCKS_METADATA, "METADATA" }, \
68 { EXT4_FREE_BLOCKS_FORGET, "FORGET" }, \
69 { EXT4_FREE_BLOCKS_VALIDATED, "VALIDATED" }, \
70 { EXT4_FREE_BLOCKS_NO_QUOT_UPDATE, "NO_QUOTA" }, \
71 { EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER,"1ST_CLUSTER" },\
72 { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" })
73
Dmitry Monakhov459c8072019-11-14 20:01:46 +000074TRACE_DEFINE_ENUM(ES_WRITTEN_B);
75TRACE_DEFINE_ENUM(ES_UNWRITTEN_B);
76TRACE_DEFINE_ENUM(ES_DELAYED_B);
77TRACE_DEFINE_ENUM(ES_HOLE_B);
78TRACE_DEFINE_ENUM(ES_REFERENCED_B);
79
Theodore Ts'o21ddd562013-07-01 08:12:40 -040080#define show_extent_status(status) __print_flags(status, "", \
Theodore Ts'o3be78c72013-08-16 21:22:41 -040081 { EXTENT_STATUS_WRITTEN, "W" }, \
82 { EXTENT_STATUS_UNWRITTEN, "U" }, \
83 { EXTENT_STATUS_DELAYED, "D" }, \
Dmitry Monakhov459c8072019-11-14 20:01:46 +000084 { EXTENT_STATUS_HOLE, "H" }, \
85 { EXTENT_STATUS_REFERENCED, "R" })
Theodore Ts'o21ddd562013-07-01 08:12:40 -040086
Lukas Czernera633f5a2014-02-22 06:18:17 -050087#define show_falloc_mode(mode) __print_flags(mode, "|", \
88 { FALLOC_FL_KEEP_SIZE, "KEEP_SIZE"}, \
89 { FALLOC_FL_PUNCH_HOLE, "PUNCH_HOLE"}, \
Namjae Jeon9eb79482014-02-23 15:18:59 -050090 { FALLOC_FL_NO_HIDE_STALE, "NO_HIDE_STALE"}, \
Lukas Czernerb8a86842014-03-18 18:05:35 -040091 { FALLOC_FL_COLLAPSE_RANGE, "COLLAPSE_RANGE"}, \
92 { FALLOC_FL_ZERO_RANGE, "ZERO_RANGE"})
Lukas Czernera633f5a2014-02-22 06:18:17 -050093
Theodore Ts'o21ddd562013-07-01 08:12:40 -040094
Theodore Ts'oa26f4992015-02-02 00:37:02 -050095TRACE_EVENT(ext4_other_inode_update_time,
96 TP_PROTO(struct inode *inode, ino_t orig_ino),
97
98 TP_ARGS(inode, orig_ino),
99
100 TP_STRUCT__entry(
101 __field( dev_t, dev )
102 __field( ino_t, ino )
103 __field( ino_t, orig_ino )
104 __field( uid_t, uid )
105 __field( gid_t, gid )
106 __field( __u16, mode )
107 ),
108
109 TP_fast_assign(
110 __entry->orig_ino = orig_ino;
111 __entry->dev = inode->i_sb->s_dev;
112 __entry->ino = inode->i_ino;
113 __entry->uid = i_uid_read(inode);
114 __entry->gid = i_gid_read(inode);
115 __entry->mode = inode->i_mode;
116 ),
117
118 TP_printk("dev %d,%d orig_ino %lu ino %lu mode 0%o uid %u gid %u",
119 MAJOR(__entry->dev), MINOR(__entry->dev),
120 (unsigned long) __entry->orig_ino,
121 (unsigned long) __entry->ino, __entry->mode,
122 __entry->uid, __entry->gid)
123);
124
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400125TRACE_EVENT(ext4_free_inode,
126 TP_PROTO(struct inode *inode),
127
128 TP_ARGS(inode),
129
130 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400131 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400132 __field( ino_t, ino )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400133 __field( uid_t, uid )
134 __field( gid_t, gid )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400135 __field( __u64, blocks )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400136 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400137 ),
138
139 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400140 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400141 __entry->ino = inode->i_ino;
Eric W. Biederman08cefc72012-02-07 15:41:49 -0800142 __entry->uid = i_uid_read(inode);
143 __entry->gid = i_gid_read(inode);
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400144 __entry->blocks = inode->i_blocks;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400145 __entry->mode = inode->i_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400146 ),
147
Theodore Ts'oa2690292010-10-27 22:08:50 -0400148 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400149 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -0400150 (unsigned long) __entry->ino, __entry->mode,
151 __entry->uid, __entry->gid, __entry->blocks)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400152);
153
154TRACE_EVENT(ext4_request_inode,
155 TP_PROTO(struct inode *dir, int mode),
156
157 TP_ARGS(dir, mode),
158
159 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400160 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400161 __field( ino_t, dir )
Theodore Ts'o59be8e72011-07-30 12:38:46 -0400162 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400163 ),
164
165 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400166 __entry->dev = dir->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400167 __entry->dir = dir->i_ino;
168 __entry->mode = mode;
169 ),
170
Theodore Ts'oa2690292010-10-27 22:08:50 -0400171 TP_printk("dev %d,%d dir %lu mode 0%o",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400172 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400173 (unsigned long) __entry->dir, __entry->mode)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400174);
175
176TRACE_EVENT(ext4_allocate_inode,
177 TP_PROTO(struct inode *inode, struct inode *dir, int mode),
178
179 TP_ARGS(inode, dir, mode),
180
181 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400182 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400183 __field( ino_t, ino )
184 __field( ino_t, dir )
Theodore Ts'o59be8e72011-07-30 12:38:46 -0400185 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400186 ),
187
188 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400189 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400190 __entry->ino = inode->i_ino;
191 __entry->dir = dir->i_ino;
192 __entry->mode = mode;
193 ),
194
Theodore Ts'oa2690292010-10-27 22:08:50 -0400195 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400196 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400197 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400198 (unsigned long) __entry->dir, __entry->mode)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400199);
200
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500201TRACE_EVENT(ext4_evict_inode,
202 TP_PROTO(struct inode *inode),
203
204 TP_ARGS(inode),
205
206 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400207 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500208 __field( ino_t, ino )
209 __field( int, nlink )
210 ),
211
212 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400213 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500214 __entry->ino = inode->i_ino;
215 __entry->nlink = inode->i_nlink;
216 ),
217
218 TP_printk("dev %d,%d ino %lu nlink %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400219 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500220 (unsigned long) __entry->ino, __entry->nlink)
221);
222
223TRACE_EVENT(ext4_drop_inode,
224 TP_PROTO(struct inode *inode, int drop),
225
226 TP_ARGS(inode, drop),
227
228 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400229 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500230 __field( ino_t, ino )
231 __field( int, drop )
232 ),
233
234 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400235 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500236 __entry->ino = inode->i_ino;
237 __entry->drop = drop;
238 ),
239
240 TP_printk("dev %d,%d ino %lu drop %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400241 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500242 (unsigned long) __entry->ino, __entry->drop)
243);
244
Theodore Ts'ofde87262018-12-19 14:07:58 -0500245TRACE_EVENT(ext4_nfs_commit_metadata,
246 TP_PROTO(struct inode *inode),
247
248 TP_ARGS(inode),
249
250 TP_STRUCT__entry(
251 __field( dev_t, dev )
252 __field( ino_t, ino )
253 ),
254
255 TP_fast_assign(
256 __entry->dev = inode->i_sb->s_dev;
257 __entry->ino = inode->i_ino;
258 ),
259
260 TP_printk("dev %d,%d ino %lu",
261 MAJOR(__entry->dev), MINOR(__entry->dev),
262 (unsigned long) __entry->ino)
263);
264
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500265TRACE_EVENT(ext4_mark_inode_dirty,
266 TP_PROTO(struct inode *inode, unsigned long IP),
267
268 TP_ARGS(inode, IP),
269
270 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400271 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500272 __field( ino_t, ino )
273 __field(unsigned long, ip )
274 ),
275
276 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400277 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500278 __entry->ino = inode->i_ino;
279 __entry->ip = IP;
280 ),
281
Scott Woodbbedb172015-03-11 22:13:57 -0500282 TP_printk("dev %d,%d ino %lu caller %pS",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400283 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500284 (unsigned long) __entry->ino, (void *)__entry->ip)
285);
286
287TRACE_EVENT(ext4_begin_ordered_truncate,
288 TP_PROTO(struct inode *inode, loff_t new_size),
289
290 TP_ARGS(inode, new_size),
291
292 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400293 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500294 __field( ino_t, ino )
295 __field( loff_t, new_size )
296 ),
297
298 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400299 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500300 __entry->ino = inode->i_ino;
301 __entry->new_size = new_size;
302 ),
303
304 TP_printk("dev %d,%d ino %lu new_size %lld",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400305 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500306 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400307 __entry->new_size)
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500308);
309
Li Zefanb5eb34c2009-11-26 15:07:36 +0800310DECLARE_EVENT_CLASS(ext4__write_begin,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400311
312 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
313 unsigned int flags),
314
315 TP_ARGS(inode, pos, len, flags),
316
317 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400318 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400319 __field( ino_t, ino )
320 __field( loff_t, pos )
321 __field( unsigned int, len )
322 __field( unsigned int, flags )
323 ),
324
325 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400326 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400327 __entry->ino = inode->i_ino;
328 __entry->pos = pos;
329 __entry->len = len;
330 __entry->flags = flags;
331 ),
332
Lukas Czernera9c667f2011-06-06 09:51:52 -0400333 TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400334 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400335 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400336 __entry->pos, __entry->len, __entry->flags)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400337);
338
Li Zefanb5eb34c2009-11-26 15:07:36 +0800339DEFINE_EVENT(ext4__write_begin, ext4_write_begin,
340
341 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
342 unsigned int flags),
343
344 TP_ARGS(inode, pos, len, flags)
345);
346
347DEFINE_EVENT(ext4__write_begin, ext4_da_write_begin,
348
349 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
350 unsigned int flags),
351
352 TP_ARGS(inode, pos, len, flags)
353);
354
355DECLARE_EVENT_CLASS(ext4__write_end,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400356 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
357 unsigned int copied),
358
359 TP_ARGS(inode, pos, len, copied),
360
361 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400362 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400363 __field( ino_t, ino )
364 __field( loff_t, pos )
365 __field( unsigned int, len )
366 __field( unsigned int, copied )
367 ),
368
369 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400370 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400371 __entry->ino = inode->i_ino;
372 __entry->pos = pos;
373 __entry->len = len;
374 __entry->copied = copied;
375 ),
376
Lukas Czernera9c667f2011-06-06 09:51:52 -0400377 TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400378 MAJOR(__entry->dev), MINOR(__entry->dev),
379 (unsigned long) __entry->ino,
380 __entry->pos, __entry->len, __entry->copied)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400381);
382
Theodore Ts'o74d553a2013-04-03 12:39:17 -0400383DEFINE_EVENT(ext4__write_end, ext4_write_end,
Li Zefanb5eb34c2009-11-26 15:07:36 +0800384
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400385 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
386 unsigned int copied),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400387
Li Zefanb5eb34c2009-11-26 15:07:36 +0800388 TP_ARGS(inode, pos, len, copied)
389);
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400390
Li Zefanb5eb34c2009-11-26 15:07:36 +0800391DEFINE_EVENT(ext4__write_end, ext4_journalled_write_end,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400392
Li Zefanb5eb34c2009-11-26 15:07:36 +0800393 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
394 unsigned int copied),
395
396 TP_ARGS(inode, pos, len, copied)
397);
398
399DEFINE_EVENT(ext4__write_end, ext4_da_write_end,
400
401 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
402 unsigned int copied),
403
404 TP_ARGS(inode, pos, len, copied)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400405);
406
Theodore Ts'o20970ba2013-06-06 14:00:46 -0400407TRACE_EVENT(ext4_writepages,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400408 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
409
410 TP_ARGS(inode, wbc),
411
412 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400413 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400414 __field( ino_t, ino )
415 __field( long, nr_to_write )
416 __field( long, pages_skipped )
417 __field( loff_t, range_start )
418 __field( loff_t, range_end )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400419 __field( pgoff_t, writeback_index )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400420 __field( int, sync_mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400421 __field( char, for_kupdate )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400422 __field( char, range_cyclic )
423 ),
424
425 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400426 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400427 __entry->ino = inode->i_ino;
428 __entry->nr_to_write = wbc->nr_to_write;
429 __entry->pages_skipped = wbc->pages_skipped;
430 __entry->range_start = wbc->range_start;
431 __entry->range_end = wbc->range_end;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400432 __entry->writeback_index = inode->i_mapping->writeback_index;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400433 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400434 __entry->for_kupdate = wbc->for_kupdate;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400435 __entry->range_cyclic = wbc->range_cyclic;
436 ),
437
Theodore Ts'oa107e5a2010-10-27 23:44:47 -0400438 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
Anatol Pomozov81370292012-08-17 09:52:17 -0400439 "range_start %lld range_end %lld sync_mode %d "
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400440 "for_kupdate %d range_cyclic %d writeback_index %lu",
441 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400442 (unsigned long) __entry->ino, __entry->nr_to_write,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400443 __entry->pages_skipped, __entry->range_start,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400444 __entry->range_end, __entry->sync_mode,
445 __entry->for_kupdate, __entry->range_cyclic,
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400446 (unsigned long) __entry->writeback_index)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400447);
448
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400449TRACE_EVENT(ext4_da_write_pages,
Jan Kara4e7ea812013-06-04 13:17:40 -0400450 TP_PROTO(struct inode *inode, pgoff_t first_page,
451 struct writeback_control *wbc),
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400452
Jan Kara4e7ea812013-06-04 13:17:40 -0400453 TP_ARGS(inode, first_page, wbc),
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400454
455 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400456 __field( dev_t, dev )
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400457 __field( ino_t, ino )
Jan Kara4e7ea812013-06-04 13:17:40 -0400458 __field( pgoff_t, first_page )
459 __field( long, nr_to_write )
460 __field( int, sync_mode )
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400461 ),
462
463 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400464 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400465 __entry->ino = inode->i_ino;
Jan Kara4e7ea812013-06-04 13:17:40 -0400466 __entry->first_page = first_page;
467 __entry->nr_to_write = wbc->nr_to_write;
468 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400469 ),
470
Jan Kara4e7ea812013-06-04 13:17:40 -0400471 TP_printk("dev %d,%d ino %lu first_page %lu nr_to_write %ld "
472 "sync_mode %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400473 MAJOR(__entry->dev), MINOR(__entry->dev),
Jan Kara4e7ea812013-06-04 13:17:40 -0400474 (unsigned long) __entry->ino, __entry->first_page,
475 __entry->nr_to_write, __entry->sync_mode)
476);
477
478TRACE_EVENT(ext4_da_write_pages_extent,
479 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map),
480
481 TP_ARGS(inode, map),
482
483 TP_STRUCT__entry(
484 __field( dev_t, dev )
485 __field( ino_t, ino )
486 __field( __u64, lblk )
487 __field( __u32, len )
488 __field( __u32, flags )
489 ),
490
491 TP_fast_assign(
492 __entry->dev = inode->i_sb->s_dev;
493 __entry->ino = inode->i_ino;
494 __entry->lblk = map->m_lblk;
495 __entry->len = map->m_len;
496 __entry->flags = map->m_flags;
497 ),
498
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400499 TP_printk("dev %d,%d ino %lu lblk %llu len %u flags %s",
Jan Kara4e7ea812013-06-04 13:17:40 -0400500 MAJOR(__entry->dev), MINOR(__entry->dev),
501 (unsigned long) __entry->ino, __entry->lblk, __entry->len,
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400502 show_mflags(__entry->flags))
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400503);
504
Theodore Ts'o20970ba2013-06-06 14:00:46 -0400505TRACE_EVENT(ext4_writepages_result,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400506 TP_PROTO(struct inode *inode, struct writeback_control *wbc,
507 int ret, int pages_written),
508
509 TP_ARGS(inode, wbc, ret, pages_written),
510
511 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400512 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400513 __field( ino_t, ino )
514 __field( int, ret )
515 __field( int, pages_written )
516 __field( long, pages_skipped )
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400517 __field( pgoff_t, writeback_index )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400518 __field( int, sync_mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400519 ),
520
521 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400522 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400523 __entry->ino = inode->i_ino;
524 __entry->ret = ret;
525 __entry->pages_written = pages_written;
526 __entry->pages_skipped = wbc->pages_skipped;
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400527 __entry->writeback_index = inode->i_mapping->writeback_index;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400528 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400529 ),
530
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400531 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
Wu Fengguangb7a24412010-07-21 22:19:51 -0600532 "sync_mode %d writeback_index %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400533 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400534 (unsigned long) __entry->ino, __entry->ret,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400535 __entry->pages_written, __entry->pages_skipped,
Wu Fengguangb7a24412010-07-21 22:19:51 -0600536 __entry->sync_mode,
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400537 (unsigned long) __entry->writeback_index)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400538);
539
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400540DECLARE_EVENT_CLASS(ext4__page_op,
541 TP_PROTO(struct page *page),
542
543 TP_ARGS(page),
544
545 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400546 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400547 __field( ino_t, ino )
548 __field( pgoff_t, index )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400549
550 ),
551
552 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400553 __entry->dev = page->mapping->host->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400554 __entry->ino = page->mapping->host->i_ino;
555 __entry->index = page->index;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400556 ),
557
558 TP_printk("dev %d,%d ino %lu page_index %lu",
559 MAJOR(__entry->dev), MINOR(__entry->dev),
560 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400561 (unsigned long) __entry->index)
562);
563
564DEFINE_EVENT(ext4__page_op, ext4_writepage,
565
566 TP_PROTO(struct page *page),
567
568 TP_ARGS(page)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400569);
570
571DEFINE_EVENT(ext4__page_op, ext4_readpage,
572
573 TP_PROTO(struct page *page),
574
575 TP_ARGS(page)
576);
577
578DEFINE_EVENT(ext4__page_op, ext4_releasepage,
579
580 TP_PROTO(struct page *page),
581
582 TP_ARGS(page)
583);
584
Jan Kara4520fb32012-12-25 13:28:54 -0500585DECLARE_EVENT_CLASS(ext4_invalidatepage_op,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400586 TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400587
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400588 TP_ARGS(page, offset, length),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400589
590 TP_STRUCT__entry(
Anatol Pomozov210c0522012-08-17 09:50:17 -0400591 __field( dev_t, dev )
592 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400593 __field( pgoff_t, index )
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400594 __field( unsigned int, offset )
595 __field( unsigned int, length )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400596 ),
597
598 TP_fast_assign(
Anatol Pomozov210c0522012-08-17 09:50:17 -0400599 __entry->dev = page->mapping->host->i_sb->s_dev;
600 __entry->ino = page->mapping->host->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400601 __entry->index = page->index;
602 __entry->offset = offset;
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400603 __entry->length = length;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400604 ),
605
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400606 TP_printk("dev %d,%d ino %lu page_index %lu offset %u length %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400607 MAJOR(__entry->dev), MINOR(__entry->dev),
608 (unsigned long) __entry->ino,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400609 (unsigned long) __entry->index,
610 __entry->offset, __entry->length)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400611);
612
Jan Kara4520fb32012-12-25 13:28:54 -0500613DEFINE_EVENT(ext4_invalidatepage_op, ext4_invalidatepage,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400614 TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
Jan Kara4520fb32012-12-25 13:28:54 -0500615
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400616 TP_ARGS(page, offset, length)
Jan Kara4520fb32012-12-25 13:28:54 -0500617);
618
619DEFINE_EVENT(ext4_invalidatepage_op, ext4_journalled_invalidatepage,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400620 TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
Jan Kara4520fb32012-12-25 13:28:54 -0500621
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400622 TP_ARGS(page, offset, length)
Jan Kara4520fb32012-12-25 13:28:54 -0500623);
624
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400625TRACE_EVENT(ext4_discard_blocks,
626 TP_PROTO(struct super_block *sb, unsigned long long blk,
627 unsigned long long count),
628
629 TP_ARGS(sb, blk, count),
630
631 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400632 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400633 __field( __u64, blk )
634 __field( __u64, count )
635
636 ),
637
638 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400639 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400640 __entry->blk = blk;
641 __entry->count = count;
642 ),
643
Theodore Ts'oa2690292010-10-27 22:08:50 -0400644 TP_printk("dev %d,%d blk %llu count %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400645 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400646 __entry->blk, __entry->count)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400647);
648
Li Zefanf084db92010-05-17 04:00:00 -0400649DECLARE_EVENT_CLASS(ext4__mb_new_pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400650 TP_PROTO(struct ext4_allocation_context *ac,
651 struct ext4_prealloc_space *pa),
652
653 TP_ARGS(ac, pa),
654
655 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400656 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400657 __field( ino_t, ino )
658 __field( __u64, pa_pstart )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400659 __field( __u64, pa_lstart )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400660 __field( __u32, pa_len )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400661
662 ),
663
664 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400665 __entry->dev = ac->ac_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400666 __entry->ino = ac->ac_inode->i_ino;
667 __entry->pa_pstart = pa->pa_pstart;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400668 __entry->pa_lstart = pa->pa_lstart;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400669 __entry->pa_len = pa->pa_len;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400670 ),
671
Theodore Ts'oa2690292010-10-27 22:08:50 -0400672 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400673 MAJOR(__entry->dev), MINOR(__entry->dev),
674 (unsigned long) __entry->ino,
675 __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400676);
677
Li Zefanf084db92010-05-17 04:00:00 -0400678DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa,
679
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400680 TP_PROTO(struct ext4_allocation_context *ac,
681 struct ext4_prealloc_space *pa),
682
Li Zefanf084db92010-05-17 04:00:00 -0400683 TP_ARGS(ac, pa)
684);
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400685
Li Zefanf084db92010-05-17 04:00:00 -0400686DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400687
Li Zefanf084db92010-05-17 04:00:00 -0400688 TP_PROTO(struct ext4_allocation_context *ac,
689 struct ext4_prealloc_space *pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400690
Li Zefanf084db92010-05-17 04:00:00 -0400691 TP_ARGS(ac, pa)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400692);
693
694TRACE_EVENT(ext4_mb_release_inode_pa,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400695 TP_PROTO(struct ext4_prealloc_space *pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400696 unsigned long long block, unsigned int count),
697
Lukas Czernera9c667f2011-06-06 09:51:52 -0400698 TP_ARGS(pa, block, count),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400699
700 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400701 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400702 __field( ino_t, ino )
703 __field( __u64, block )
704 __field( __u32, count )
705
706 ),
707
708 TP_fast_assign(
Lukas Czernera9c667f2011-06-06 09:51:52 -0400709 __entry->dev = pa->pa_inode->i_sb->s_dev;
710 __entry->ino = pa->pa_inode->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400711 __entry->block = block;
712 __entry->count = count;
713 ),
714
Theodore Ts'oa2690292010-10-27 22:08:50 -0400715 TP_printk("dev %d,%d ino %lu block %llu count %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400716 MAJOR(__entry->dev), MINOR(__entry->dev),
717 (unsigned long) __entry->ino,
718 __entry->block, __entry->count)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400719);
720
721TRACE_EVENT(ext4_mb_release_group_pa,
Yongqiang Yang60e07cf2011-12-18 15:49:54 -0500722 TP_PROTO(struct super_block *sb, struct ext4_prealloc_space *pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400723
Yongqiang Yang60e07cf2011-12-18 15:49:54 -0500724 TP_ARGS(sb, pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400725
726 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400727 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400728 __field( __u64, pa_pstart )
729 __field( __u32, pa_len )
730
731 ),
732
733 TP_fast_assign(
Yongqiang Yang60e07cf2011-12-18 15:49:54 -0500734 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400735 __entry->pa_pstart = pa->pa_pstart;
736 __entry->pa_len = pa->pa_len;
737 ),
738
Theodore Ts'oa2690292010-10-27 22:08:50 -0400739 TP_printk("dev %d,%d pstart %llu len %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400740 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400741 __entry->pa_pstart, __entry->pa_len)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400742);
743
744TRACE_EVENT(ext4_discard_preallocations,
745 TP_PROTO(struct inode *inode),
746
747 TP_ARGS(inode),
748
749 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400750 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400751 __field( ino_t, ino )
752
753 ),
754
755 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400756 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400757 __entry->ino = inode->i_ino;
758 ),
759
Theodore Ts'oa2690292010-10-27 22:08:50 -0400760 TP_printk("dev %d,%d ino %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400761 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400762 (unsigned long) __entry->ino)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400763);
764
765TRACE_EVENT(ext4_mb_discard_preallocations,
766 TP_PROTO(struct super_block *sb, int needed),
767
768 TP_ARGS(sb, needed),
769
770 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400771 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400772 __field( int, needed )
773
774 ),
775
776 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400777 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400778 __entry->needed = needed;
779 ),
780
Theodore Ts'oa2690292010-10-27 22:08:50 -0400781 TP_printk("dev %d,%d needed %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400782 MAJOR(__entry->dev), MINOR(__entry->dev),
783 __entry->needed)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400784);
785
786TRACE_EVENT(ext4_request_blocks,
787 TP_PROTO(struct ext4_allocation_request *ar),
788
789 TP_ARGS(ar),
790
791 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400792 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400793 __field( ino_t, ino )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400794 __field( unsigned int, len )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400795 __field( __u32, logical )
796 __field( __u32, lleft )
797 __field( __u32, lright )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400798 __field( __u64, goal )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400799 __field( __u64, pleft )
800 __field( __u64, pright )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400801 __field( unsigned int, flags )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400802 ),
803
804 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400805 __entry->dev = ar->inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400806 __entry->ino = ar->inode->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400807 __entry->len = ar->len;
808 __entry->logical = ar->logical;
809 __entry->goal = ar->goal;
810 __entry->lleft = ar->lleft;
811 __entry->lright = ar->lright;
812 __entry->pleft = ar->pleft;
813 __entry->pright = ar->pright;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400814 __entry->flags = ar->flags;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400815 ),
816
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400817 TP_printk("dev %d,%d ino %lu flags %s len %u lblk %u goal %llu "
Lukas Czernera9c667f2011-06-06 09:51:52 -0400818 "lleft %u lright %u pleft %llu pright %llu ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400819 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400820 (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags),
Lukas Czernera9c667f2011-06-06 09:51:52 -0400821 __entry->len, __entry->logical, __entry->goal,
822 __entry->lleft, __entry->lright, __entry->pleft,
823 __entry->pright)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400824);
825
826TRACE_EVENT(ext4_allocate_blocks,
827 TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block),
828
829 TP_ARGS(ar, block),
830
831 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400832 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400833 __field( ino_t, ino )
834 __field( __u64, block )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400835 __field( unsigned int, len )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400836 __field( __u32, logical )
837 __field( __u32, lleft )
838 __field( __u32, lright )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400839 __field( __u64, goal )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400840 __field( __u64, pleft )
841 __field( __u64, pright )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400842 __field( unsigned int, flags )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400843 ),
844
845 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400846 __entry->dev = ar->inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400847 __entry->ino = ar->inode->i_ino;
848 __entry->block = block;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400849 __entry->len = ar->len;
850 __entry->logical = ar->logical;
851 __entry->goal = ar->goal;
852 __entry->lleft = ar->lleft;
853 __entry->lright = ar->lright;
854 __entry->pleft = ar->pleft;
855 __entry->pright = ar->pright;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400856 __entry->flags = ar->flags;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400857 ),
858
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400859 TP_printk("dev %d,%d ino %lu flags %s len %u block %llu lblk %u "
Lukas Czernera9c667f2011-06-06 09:51:52 -0400860 "goal %llu lleft %u lright %u pleft %llu pright %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400861 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400862 (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags),
Lukas Czernera9c667f2011-06-06 09:51:52 -0400863 __entry->len, __entry->block, __entry->logical,
864 __entry->goal, __entry->lleft, __entry->lright,
865 __entry->pleft, __entry->pright)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400866);
867
868TRACE_EVENT(ext4_free_blocks,
869 TP_PROTO(struct inode *inode, __u64 block, unsigned long count,
Theodore Ts'oe6362602009-11-23 07:17:05 -0500870 int flags),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400871
Theodore Ts'oe6362602009-11-23 07:17:05 -0500872 TP_ARGS(inode, block, count, flags),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400873
874 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400875 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400876 __field( ino_t, ino )
877 __field( __u64, block )
878 __field( unsigned long, count )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400879 __field( int, flags )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400880 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400881 ),
882
883 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400884 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400885 __entry->ino = inode->i_ino;
886 __entry->block = block;
887 __entry->count = count;
Theodore Ts'oe6362602009-11-23 07:17:05 -0500888 __entry->flags = flags;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400889 __entry->mode = inode->i_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400890 ),
891
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400892 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %s",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400893 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400894 (unsigned long) __entry->ino,
Theodore Ts'oe6362602009-11-23 07:17:05 -0500895 __entry->mode, __entry->block, __entry->count,
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400896 show_free_flags(__entry->flags))
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400897);
898
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400899TRACE_EVENT(ext4_sync_file_enter,
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200900 TP_PROTO(struct file *file, int datasync),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400901
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200902 TP_ARGS(file, datasync),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400903
904 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400905 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400906 __field( ino_t, ino )
907 __field( ino_t, parent )
908 __field( int, datasync )
909 ),
910
911 TP_fast_assign(
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200912 struct dentry *dentry = file->f_path.dentry;
913
Al Virofc640052016-04-10 01:33:30 -0400914 __entry->dev = dentry->d_sb->s_dev;
David Howells2b0143b2015-03-17 22:25:59 +0000915 __entry->ino = d_inode(dentry)->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400916 __entry->datasync = datasync;
David Howells2b0143b2015-03-17 22:25:59 +0000917 __entry->parent = d_inode(dentry->d_parent)->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400918 ),
919
Lukas Czernera9c667f2011-06-06 09:51:52 -0400920 TP_printk("dev %d,%d ino %lu parent %lu datasync %d ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400921 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400922 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400923 (unsigned long) __entry->parent, __entry->datasync)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400924);
925
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400926TRACE_EVENT(ext4_sync_file_exit,
927 TP_PROTO(struct inode *inode, int ret),
928
929 TP_ARGS(inode, ret),
930
931 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400932 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400933 __field( ino_t, ino )
934 __field( int, ret )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400935 ),
936
937 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400938 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400939 __entry->ino = inode->i_ino;
940 __entry->ret = ret;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400941 ),
942
Lukas Czernera9c667f2011-06-06 09:51:52 -0400943 TP_printk("dev %d,%d ino %lu ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400944 MAJOR(__entry->dev), MINOR(__entry->dev),
945 (unsigned long) __entry->ino,
946 __entry->ret)
947);
948
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400949TRACE_EVENT(ext4_sync_fs,
950 TP_PROTO(struct super_block *sb, int wait),
951
952 TP_ARGS(sb, wait),
953
954 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400955 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400956 __field( int, wait )
957
958 ),
959
960 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400961 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400962 __entry->wait = wait;
963 ),
964
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400965 TP_printk("dev %d,%d wait %d",
966 MAJOR(__entry->dev), MINOR(__entry->dev),
967 __entry->wait)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400968);
969
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400970TRACE_EVENT(ext4_alloc_da_blocks,
971 TP_PROTO(struct inode *inode),
972
973 TP_ARGS(inode),
974
975 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400976 __field( dev_t, dev )
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400977 __field( ino_t, ino )
Eric Whitneya627b0a2017-07-30 22:30:11 -0400978 __field( unsigned int, data_blocks )
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400979 ),
980
981 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400982 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400983 __entry->ino = inode->i_ino;
984 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400985 ),
986
Eric Whitneya627b0a2017-07-30 22:30:11 -0400987 TP_printk("dev %d,%d ino %lu reserved_data_blocks %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400988 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400989 (unsigned long) __entry->ino,
Eric Whitneya627b0a2017-07-30 22:30:11 -0400990 __entry->data_blocks)
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400991);
992
Theodore Ts'o296c3552009-09-30 00:32:42 -0400993TRACE_EVENT(ext4_mballoc_alloc,
994 TP_PROTO(struct ext4_allocation_context *ac),
995
996 TP_ARGS(ac),
997
998 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400999 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001000 __field( ino_t, ino )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001001 __field( __u32, orig_logical )
1002 __field( int, orig_start )
1003 __field( __u32, orig_group )
1004 __field( int, orig_len )
1005 __field( __u32, goal_logical )
1006 __field( int, goal_start )
1007 __field( __u32, goal_group )
1008 __field( int, goal_len )
1009 __field( __u32, result_logical )
1010 __field( int, result_start )
1011 __field( __u32, result_group )
1012 __field( int, result_len )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001013 __field( __u16, found )
1014 __field( __u16, groups )
1015 __field( __u16, buddy )
1016 __field( __u16, flags )
1017 __field( __u16, tail )
1018 __field( __u8, cr )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001019 ),
1020
1021 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001022 __entry->dev = ac->ac_inode->i_sb->s_dev;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001023 __entry->ino = ac->ac_inode->i_ino;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001024 __entry->orig_logical = ac->ac_o_ex.fe_logical;
1025 __entry->orig_start = ac->ac_o_ex.fe_start;
1026 __entry->orig_group = ac->ac_o_ex.fe_group;
1027 __entry->orig_len = ac->ac_o_ex.fe_len;
1028 __entry->goal_logical = ac->ac_g_ex.fe_logical;
1029 __entry->goal_start = ac->ac_g_ex.fe_start;
1030 __entry->goal_group = ac->ac_g_ex.fe_group;
1031 __entry->goal_len = ac->ac_g_ex.fe_len;
1032 __entry->result_logical = ac->ac_f_ex.fe_logical;
1033 __entry->result_start = ac->ac_f_ex.fe_start;
1034 __entry->result_group = ac->ac_f_ex.fe_group;
1035 __entry->result_len = ac->ac_f_ex.fe_len;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001036 __entry->found = ac->ac_found;
1037 __entry->flags = ac->ac_flags;
1038 __entry->groups = ac->ac_groups_scanned;
1039 __entry->buddy = ac->ac_buddy;
1040 __entry->tail = ac->ac_tail;
1041 __entry->cr = ac->ac_criteria;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001042 ),
1043
Theodore Ts'oa2690292010-10-27 22:08:50 -04001044 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 -04001045 "result %u/%d/%u@%u blks %u grps %u cr %u flags %s "
Theodore Ts'o296c3552009-09-30 00:32:42 -04001046 "tail %u broken %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001047 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001048 (unsigned long) __entry->ino,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001049 __entry->orig_group, __entry->orig_start,
1050 __entry->orig_len, __entry->orig_logical,
1051 __entry->goal_group, __entry->goal_start,
1052 __entry->goal_len, __entry->goal_logical,
1053 __entry->result_group, __entry->result_start,
1054 __entry->result_len, __entry->result_logical,
1055 __entry->found, __entry->groups, __entry->cr,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001056 show_mballoc_flags(__entry->flags), __entry->tail,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001057 __entry->buddy ? 1 << __entry->buddy : 0)
1058);
1059
1060TRACE_EVENT(ext4_mballoc_prealloc,
1061 TP_PROTO(struct ext4_allocation_context *ac),
1062
1063 TP_ARGS(ac),
1064
1065 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001066 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001067 __field( ino_t, ino )
1068 __field( __u32, orig_logical )
1069 __field( int, orig_start )
1070 __field( __u32, orig_group )
1071 __field( int, orig_len )
1072 __field( __u32, result_logical )
1073 __field( int, result_start )
1074 __field( __u32, result_group )
1075 __field( int, result_len )
1076 ),
1077
1078 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001079 __entry->dev = ac->ac_inode->i_sb->s_dev;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001080 __entry->ino = ac->ac_inode->i_ino;
1081 __entry->orig_logical = ac->ac_o_ex.fe_logical;
1082 __entry->orig_start = ac->ac_o_ex.fe_start;
1083 __entry->orig_group = ac->ac_o_ex.fe_group;
1084 __entry->orig_len = ac->ac_o_ex.fe_len;
1085 __entry->result_logical = ac->ac_b_ex.fe_logical;
1086 __entry->result_start = ac->ac_b_ex.fe_start;
1087 __entry->result_group = ac->ac_b_ex.fe_group;
1088 __entry->result_len = ac->ac_b_ex.fe_len;
1089 ),
1090
Theodore Ts'oa2690292010-10-27 22:08:50 -04001091 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001092 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001093 (unsigned long) __entry->ino,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001094 __entry->orig_group, __entry->orig_start,
1095 __entry->orig_len, __entry->orig_logical,
1096 __entry->result_group, __entry->result_start,
1097 __entry->result_len, __entry->result_logical)
1098);
1099
Li Zefanf084db92010-05-17 04:00:00 -04001100DECLARE_EVENT_CLASS(ext4__mballoc,
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001101 TP_PROTO(struct super_block *sb,
1102 struct inode *inode,
1103 ext4_group_t group,
1104 ext4_grpblk_t start,
1105 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001106
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001107 TP_ARGS(sb, inode, group, start, len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001108
1109 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001110 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001111 __field( ino_t, ino )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001112 __field( int, result_start )
1113 __field( __u32, result_group )
1114 __field( int, result_len )
1115 ),
1116
1117 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001118 __entry->dev = sb->s_dev;
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001119 __entry->ino = inode ? inode->i_ino : 0;
1120 __entry->result_start = start;
1121 __entry->result_group = group;
1122 __entry->result_len = len;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001123 ),
1124
Lukas Czernera9c667f2011-06-06 09:51:52 -04001125 TP_printk("dev %d,%d inode %lu extent %u/%d/%d ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001126 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001127 (unsigned long) __entry->ino,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001128 __entry->result_group, __entry->result_start,
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001129 __entry->result_len)
Theodore Ts'o296c3552009-09-30 00:32:42 -04001130);
1131
Li Zefanf084db92010-05-17 04:00:00 -04001132DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard,
1133
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001134 TP_PROTO(struct super_block *sb,
1135 struct inode *inode,
1136 ext4_group_t group,
1137 ext4_grpblk_t start,
1138 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001139
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001140 TP_ARGS(sb, inode, group, start, len)
Li Zefanf084db92010-05-17 04:00:00 -04001141);
Theodore Ts'o296c3552009-09-30 00:32:42 -04001142
Li Zefanf084db92010-05-17 04:00:00 -04001143DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001144
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001145 TP_PROTO(struct super_block *sb,
1146 struct inode *inode,
1147 ext4_group_t group,
1148 ext4_grpblk_t start,
1149 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001150
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001151 TP_ARGS(sb, inode, group, start, len)
Theodore Ts'o296c3552009-09-30 00:32:42 -04001152);
1153
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001154TRACE_EVENT(ext4_forget,
1155 TP_PROTO(struct inode *inode, int is_metadata, __u64 block),
1156
1157 TP_ARGS(inode, is_metadata, block),
1158
1159 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001160 __field( dev_t, dev )
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001161 __field( ino_t, ino )
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001162 __field( __u64, block )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001163 __field( int, is_metadata )
1164 __field( __u16, mode )
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001165 ),
1166
1167 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001168 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001169 __entry->ino = inode->i_ino;
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001170 __entry->block = block;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001171 __entry->is_metadata = is_metadata;
1172 __entry->mode = inode->i_mode;
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001173 ),
1174
Theodore Ts'oa2690292010-10-27 22:08:50 -04001175 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001176 MAJOR(__entry->dev), MINOR(__entry->dev),
1177 (unsigned long) __entry->ino,
1178 __entry->mode, __entry->is_metadata, __entry->block)
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001179);
1180
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001181TRACE_EVENT(ext4_da_update_reserve_space,
Aditya Kalid8990242011-09-09 19:18:51 -04001182 TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001183
Aditya Kalid8990242011-09-09 19:18:51 -04001184 TP_ARGS(inode, used_blocks, quota_claim),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001185
1186 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001187 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001188 __field( ino_t, ino )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001189 __field( __u64, i_blocks )
1190 __field( int, used_blocks )
1191 __field( int, reserved_data_blocks )
Aditya Kalid8990242011-09-09 19:18:51 -04001192 __field( int, quota_claim )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001193 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001194 ),
1195
1196 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001197 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001198 __entry->ino = inode->i_ino;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001199 __entry->i_blocks = inode->i_blocks;
1200 __entry->used_blocks = used_blocks;
Aditya Kalid8990242011-09-09 19:18:51 -04001201 __entry->reserved_data_blocks =
1202 EXT4_I(inode)->i_reserved_data_blocks;
Aditya Kalid8990242011-09-09 19:18:51 -04001203 __entry->quota_claim = quota_claim;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001204 __entry->mode = inode->i_mode;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001205 ),
1206
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001207 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
Eric Whitneya627b0a2017-07-30 22:30:11 -04001208 "reserved_data_blocks %d quota_claim %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001209 MAJOR(__entry->dev), MINOR(__entry->dev),
1210 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001211 __entry->mode, __entry->i_blocks,
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001212 __entry->used_blocks, __entry->reserved_data_blocks,
Aditya Kalid8990242011-09-09 19:18:51 -04001213 __entry->quota_claim)
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001214);
1215
1216TRACE_EVENT(ext4_da_reserve_space,
Eric Whitneyc27e43a2015-06-21 21:37:05 -04001217 TP_PROTO(struct inode *inode),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001218
Eric Whitneyc27e43a2015-06-21 21:37:05 -04001219 TP_ARGS(inode),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001220
1221 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001222 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001223 __field( ino_t, ino )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001224 __field( __u64, i_blocks )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001225 __field( int, reserved_data_blocks )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001226 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001227 ),
1228
1229 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001230 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001231 __entry->ino = inode->i_ino;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001232 __entry->i_blocks = inode->i_blocks;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001233 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001234 __entry->mode = inode->i_mode;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001235 ),
1236
Eric Whitneyc27e43a2015-06-21 21:37:05 -04001237 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu "
Eric Whitneya627b0a2017-07-30 22:30:11 -04001238 "reserved_data_blocks %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001239 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001240 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001241 __entry->mode, __entry->i_blocks,
Eric Whitneya627b0a2017-07-30 22:30:11 -04001242 __entry->reserved_data_blocks)
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001243);
1244
1245TRACE_EVENT(ext4_da_release_space,
1246 TP_PROTO(struct inode *inode, int freed_blocks),
1247
1248 TP_ARGS(inode, freed_blocks),
1249
1250 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001251 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001252 __field( ino_t, ino )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001253 __field( __u64, i_blocks )
1254 __field( int, freed_blocks )
1255 __field( int, reserved_data_blocks )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001256 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001257 ),
1258
1259 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001260 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001261 __entry->ino = inode->i_ino;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001262 __entry->i_blocks = inode->i_blocks;
1263 __entry->freed_blocks = freed_blocks;
1264 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001265 __entry->mode = inode->i_mode;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001266 ),
1267
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001268 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
Eric Whitneya627b0a2017-07-30 22:30:11 -04001269 "reserved_data_blocks %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001270 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001271 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001272 __entry->mode, __entry->i_blocks,
Eric Whitneya627b0a2017-07-30 22:30:11 -04001273 __entry->freed_blocks, __entry->reserved_data_blocks)
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001274);
1275
Theodore Ts'of3073332010-05-17 03:00:00 -04001276DECLARE_EVENT_CLASS(ext4__bitmap_load,
1277 TP_PROTO(struct super_block *sb, unsigned long group),
1278
1279 TP_ARGS(sb, group),
1280
1281 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001282 __field( dev_t, dev )
Theodore Ts'of3073332010-05-17 03:00:00 -04001283 __field( __u32, group )
1284
1285 ),
1286
1287 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001288 __entry->dev = sb->s_dev;
Theodore Ts'of3073332010-05-17 03:00:00 -04001289 __entry->group = group;
1290 ),
1291
Theodore Ts'oa2690292010-10-27 22:08:50 -04001292 TP_printk("dev %d,%d group %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001293 MAJOR(__entry->dev), MINOR(__entry->dev),
1294 __entry->group)
Theodore Ts'of3073332010-05-17 03:00:00 -04001295);
1296
1297DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
1298
1299 TP_PROTO(struct super_block *sb, unsigned long group),
1300
1301 TP_ARGS(sb, group)
1302);
1303
1304DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
1305
1306 TP_PROTO(struct super_block *sb, unsigned long group),
1307
1308 TP_ARGS(sb, group)
1309);
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001310
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001311DEFINE_EVENT(ext4__bitmap_load, ext4_read_block_bitmap_load,
1312
1313 TP_PROTO(struct super_block *sb, unsigned long group),
1314
1315 TP_ARGS(sb, group)
1316);
1317
1318DEFINE_EVENT(ext4__bitmap_load, ext4_load_inode_bitmap,
1319
1320 TP_PROTO(struct super_block *sb, unsigned long group),
1321
1322 TP_ARGS(sb, group)
1323);
1324
1325TRACE_EVENT(ext4_direct_IO_enter,
1326 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
1327
1328 TP_ARGS(inode, offset, len, rw),
1329
1330 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001331 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001332 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001333 __field( loff_t, pos )
1334 __field( unsigned long, len )
1335 __field( int, rw )
1336 ),
1337
1338 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001339 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001340 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001341 __entry->pos = offset;
1342 __entry->len = len;
1343 __entry->rw = rw;
1344 ),
1345
Lukas Czernera9c667f2011-06-06 09:51:52 -04001346 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001347 MAJOR(__entry->dev), MINOR(__entry->dev),
1348 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001349 __entry->pos, __entry->len, __entry->rw)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001350);
1351
1352TRACE_EVENT(ext4_direct_IO_exit,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001353 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
1354 int rw, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001355
1356 TP_ARGS(inode, offset, len, rw, ret),
1357
1358 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001359 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001360 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001361 __field( loff_t, pos )
1362 __field( unsigned long, len )
1363 __field( int, rw )
1364 __field( int, ret )
1365 ),
1366
1367 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001368 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001369 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001370 __entry->pos = offset;
1371 __entry->len = len;
1372 __entry->rw = rw;
1373 __entry->ret = ret;
1374 ),
1375
Lukas Czernera9c667f2011-06-06 09:51:52 -04001376 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001377 MAJOR(__entry->dev), MINOR(__entry->dev),
1378 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001379 __entry->pos, __entry->len,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001380 __entry->rw, __entry->ret)
1381);
1382
Lukas Czernerb8a86842014-03-18 18:05:35 -04001383DECLARE_EVENT_CLASS(ext4__fallocate_mode,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001384 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1385
1386 TP_ARGS(inode, offset, len, mode),
1387
1388 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001389 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001390 __field( ino_t, ino )
Lukas Czernerb8a86842014-03-18 18:05:35 -04001391 __field( loff_t, offset )
1392 __field( loff_t, len )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001393 __field( int, mode )
1394 ),
1395
1396 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001397 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001398 __entry->ino = inode->i_ino;
Lukas Czernerb8a86842014-03-18 18:05:35 -04001399 __entry->offset = offset;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001400 __entry->len = len;
1401 __entry->mode = mode;
1402 ),
1403
Lukas Czernerb8a86842014-03-18 18:05:35 -04001404 TP_printk("dev %d,%d ino %lu offset %lld len %lld mode %s",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001405 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernerb8a86842014-03-18 18:05:35 -04001406 (unsigned long) __entry->ino,
1407 __entry->offset, __entry->len,
1408 show_falloc_mode(__entry->mode))
1409);
1410
1411DEFINE_EVENT(ext4__fallocate_mode, ext4_fallocate_enter,
1412
1413 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1414
1415 TP_ARGS(inode, offset, len, mode)
1416);
1417
1418DEFINE_EVENT(ext4__fallocate_mode, ext4_punch_hole,
1419
1420 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1421
1422 TP_ARGS(inode, offset, len, mode)
1423);
1424
1425DEFINE_EVENT(ext4__fallocate_mode, ext4_zero_range,
1426
1427 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1428
1429 TP_ARGS(inode, offset, len, mode)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001430);
1431
1432TRACE_EVENT(ext4_fallocate_exit,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001433 TP_PROTO(struct inode *inode, loff_t offset,
1434 unsigned int max_blocks, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001435
1436 TP_ARGS(inode, offset, max_blocks, ret),
1437
1438 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001439 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001440 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001441 __field( loff_t, pos )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001442 __field( unsigned int, blocks )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001443 __field( int, ret )
1444 ),
1445
1446 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001447 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001448 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001449 __entry->pos = offset;
1450 __entry->blocks = max_blocks;
1451 __entry->ret = ret;
1452 ),
1453
Lukas Czernera9c667f2011-06-06 09:51:52 -04001454 TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001455 MAJOR(__entry->dev), MINOR(__entry->dev),
1456 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001457 __entry->pos, __entry->blocks,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001458 __entry->ret)
1459);
1460
1461TRACE_EVENT(ext4_unlink_enter,
1462 TP_PROTO(struct inode *parent, struct dentry *dentry),
1463
1464 TP_ARGS(parent, dentry),
1465
1466 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001467 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001468 __field( ino_t, ino )
1469 __field( ino_t, parent )
1470 __field( loff_t, size )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001471 ),
1472
1473 TP_fast_assign(
Al Virofc640052016-04-10 01:33:30 -04001474 __entry->dev = dentry->d_sb->s_dev;
David Howells2b0143b2015-03-17 22:25:59 +00001475 __entry->ino = d_inode(dentry)->i_ino;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001476 __entry->parent = parent->i_ino;
David Howells2b0143b2015-03-17 22:25:59 +00001477 __entry->size = d_inode(dentry)->i_size;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001478 ),
1479
Lukas Czernera9c667f2011-06-06 09:51:52 -04001480 TP_printk("dev %d,%d ino %lu size %lld parent %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001481 MAJOR(__entry->dev), MINOR(__entry->dev),
1482 (unsigned long) __entry->ino, __entry->size,
1483 (unsigned long) __entry->parent)
1484);
1485
1486TRACE_EVENT(ext4_unlink_exit,
1487 TP_PROTO(struct dentry *dentry, int ret),
1488
1489 TP_ARGS(dentry, ret),
1490
1491 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001492 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001493 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001494 __field( int, ret )
1495 ),
1496
1497 TP_fast_assign(
Al Virofc640052016-04-10 01:33:30 -04001498 __entry->dev = dentry->d_sb->s_dev;
David Howells2b0143b2015-03-17 22:25:59 +00001499 __entry->ino = d_inode(dentry)->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001500 __entry->ret = ret;
1501 ),
1502
Lukas Czernera9c667f2011-06-06 09:51:52 -04001503 TP_printk("dev %d,%d ino %lu ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001504 MAJOR(__entry->dev), MINOR(__entry->dev),
1505 (unsigned long) __entry->ino,
1506 __entry->ret)
1507);
1508
1509DECLARE_EVENT_CLASS(ext4__truncate,
1510 TP_PROTO(struct inode *inode),
1511
1512 TP_ARGS(inode),
1513
1514 TP_STRUCT__entry(
Anatol Pomozov210c0522012-08-17 09:50:17 -04001515 __field( dev_t, dev )
1516 __field( ino_t, ino )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001517 __field( __u64, blocks )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001518 ),
1519
1520 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001521 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001522 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001523 __entry->blocks = inode->i_blocks;
1524 ),
1525
Lukas Czernera9c667f2011-06-06 09:51:52 -04001526 TP_printk("dev %d,%d ino %lu blocks %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001527 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -04001528 (unsigned long) __entry->ino, __entry->blocks)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001529);
1530
1531DEFINE_EVENT(ext4__truncate, ext4_truncate_enter,
1532
1533 TP_PROTO(struct inode *inode),
1534
1535 TP_ARGS(inode)
1536);
1537
1538DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
1539
1540 TP_PROTO(struct inode *inode),
1541
1542 TP_ARGS(inode)
1543);
1544
Lukas Czerner556615d2014-04-20 23:45:47 -04001545/* 'ux' is the unwritten extent. */
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001546TRACE_EVENT(ext4_ext_convert_to_initialized_enter,
1547 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1548 struct ext4_extent *ux),
1549
1550 TP_ARGS(inode, map, ux),
1551
1552 TP_STRUCT__entry(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001553 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001554 __field( ino_t, ino )
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001555 __field( ext4_lblk_t, m_lblk )
1556 __field( unsigned, m_len )
1557 __field( ext4_lblk_t, u_lblk )
1558 __field( unsigned, u_len )
1559 __field( ext4_fsblk_t, u_pblk )
1560 ),
1561
1562 TP_fast_assign(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001563 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001564 __entry->ino = inode->i_ino;
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001565 __entry->m_lblk = map->m_lblk;
1566 __entry->m_len = map->m_len;
1567 __entry->u_lblk = le32_to_cpu(ux->ee_block);
1568 __entry->u_len = ext4_ext_get_actual_len(ux);
1569 __entry->u_pblk = ext4_ext_pblock(ux);
1570 ),
1571
1572 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u u_lblk %u u_len %u "
1573 "u_pblk %llu",
1574 MAJOR(__entry->dev), MINOR(__entry->dev),
1575 (unsigned long) __entry->ino,
1576 __entry->m_lblk, __entry->m_len,
1577 __entry->u_lblk, __entry->u_len, __entry->u_pblk)
1578);
1579
1580/*
Lukas Czerner556615d2014-04-20 23:45:47 -04001581 * 'ux' is the unwritten extent.
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001582 * 'ix' is the initialized extent to which blocks are transferred.
1583 */
1584TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath,
1585 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1586 struct ext4_extent *ux, struct ext4_extent *ix),
1587
1588 TP_ARGS(inode, map, ux, ix),
1589
1590 TP_STRUCT__entry(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001591 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001592 __field( ino_t, ino )
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001593 __field( ext4_lblk_t, m_lblk )
1594 __field( unsigned, m_len )
1595 __field( ext4_lblk_t, u_lblk )
1596 __field( unsigned, u_len )
1597 __field( ext4_fsblk_t, u_pblk )
1598 __field( ext4_lblk_t, i_lblk )
1599 __field( unsigned, i_len )
1600 __field( ext4_fsblk_t, i_pblk )
1601 ),
1602
1603 TP_fast_assign(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001604 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001605 __entry->ino = inode->i_ino;
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001606 __entry->m_lblk = map->m_lblk;
1607 __entry->m_len = map->m_len;
1608 __entry->u_lblk = le32_to_cpu(ux->ee_block);
1609 __entry->u_len = ext4_ext_get_actual_len(ux);
1610 __entry->u_pblk = ext4_ext_pblock(ux);
1611 __entry->i_lblk = le32_to_cpu(ix->ee_block);
1612 __entry->i_len = ext4_ext_get_actual_len(ix);
1613 __entry->i_pblk = ext4_ext_pblock(ix);
1614 ),
1615
1616 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u "
1617 "u_lblk %u u_len %u u_pblk %llu "
1618 "i_lblk %u i_len %u i_pblk %llu ",
1619 MAJOR(__entry->dev), MINOR(__entry->dev),
1620 (unsigned long) __entry->ino,
1621 __entry->m_lblk, __entry->m_len,
1622 __entry->u_lblk, __entry->u_len, __entry->u_pblk,
1623 __entry->i_lblk, __entry->i_len, __entry->i_pblk)
1624);
1625
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001626DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1627 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001628 unsigned int len, unsigned int flags),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001629
1630 TP_ARGS(inode, lblk, len, flags),
1631
1632 TP_STRUCT__entry(
Anatol Pomozov210c0522012-08-17 09:50:17 -04001633 __field( dev_t, dev )
1634 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001635 __field( ext4_lblk_t, lblk )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001636 __field( unsigned int, len )
1637 __field( unsigned int, flags )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001638 ),
1639
1640 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001641 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001642 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001643 __entry->lblk = lblk;
1644 __entry->len = len;
1645 __entry->flags = flags;
1646 ),
1647
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001648 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %s",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001649 MAJOR(__entry->dev), MINOR(__entry->dev),
1650 (unsigned long) __entry->ino,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001651 __entry->lblk, __entry->len, show_map_flags(__entry->flags))
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001652);
1653
1654DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter,
1655 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1656 unsigned len, unsigned flags),
1657
1658 TP_ARGS(inode, lblk, len, flags)
1659);
1660
1661DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter,
1662 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1663 unsigned len, unsigned flags),
1664
1665 TP_ARGS(inode, lblk, len, flags)
1666);
1667
1668DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001669 TP_PROTO(struct inode *inode, unsigned flags, struct ext4_map_blocks *map,
1670 int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001671
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001672 TP_ARGS(inode, flags, map, ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001673
1674 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001675 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001676 __field( ino_t, ino )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001677 __field( unsigned int, flags )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001678 __field( ext4_fsblk_t, pblk )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001679 __field( ext4_lblk_t, lblk )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001680 __field( unsigned int, len )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001681 __field( unsigned int, mflags )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001682 __field( int, ret )
1683 ),
1684
1685 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001686 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001687 __entry->ino = inode->i_ino;
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001688 __entry->flags = flags;
Zheng Liu19b303d2012-11-08 14:34:04 -05001689 __entry->pblk = map->m_pblk;
1690 __entry->lblk = map->m_lblk;
1691 __entry->len = map->m_len;
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001692 __entry->mflags = map->m_flags;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001693 __entry->ret = ret;
1694 ),
1695
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001696 TP_printk("dev %d,%d ino %lu flags %s lblk %u pblk %llu len %u "
1697 "mflags %s ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001698 MAJOR(__entry->dev), MINOR(__entry->dev),
1699 (unsigned long) __entry->ino,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001700 show_map_flags(__entry->flags), __entry->lblk, __entry->pblk,
1701 __entry->len, show_mflags(__entry->mflags), __entry->ret)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001702);
1703
1704DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001705 TP_PROTO(struct inode *inode, unsigned flags,
1706 struct ext4_map_blocks *map, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001707
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001708 TP_ARGS(inode, flags, map, ret)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001709);
1710
1711DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001712 TP_PROTO(struct inode *inode, unsigned flags,
1713 struct ext4_map_blocks *map, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001714
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001715 TP_ARGS(inode, flags, map, ret)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001716);
1717
1718TRACE_EVENT(ext4_ext_load_extent,
1719 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk),
1720
1721 TP_ARGS(inode, lblk, pblk),
1722
1723 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001724 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001725 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001726 __field( ext4_fsblk_t, pblk )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001727 __field( ext4_lblk_t, lblk )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001728 ),
1729
1730 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001731 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001732 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001733 __entry->pblk = pblk;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001734 __entry->lblk = lblk;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001735 ),
1736
1737 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1738 MAJOR(__entry->dev), MINOR(__entry->dev),
1739 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001740 __entry->lblk, __entry->pblk)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001741);
1742
1743TRACE_EVENT(ext4_load_inode,
1744 TP_PROTO(struct inode *inode),
1745
1746 TP_ARGS(inode),
1747
1748 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001749 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001750 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001751 ),
1752
1753 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001754 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001755 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001756 ),
1757
1758 TP_printk("dev %d,%d ino %ld",
1759 MAJOR(__entry->dev), MINOR(__entry->dev),
1760 (unsigned long) __entry->ino)
1761);
1762
Theodore Ts'o12706392011-07-10 22:37:50 -04001763TRACE_EVENT(ext4_journal_start,
Jan Kara5fe2fe82013-06-04 12:37:50 -04001764 TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks,
Jan Kara83448bd2019-11-05 17:44:29 +01001765 int revoke_creds, unsigned long IP),
Theodore Ts'o12706392011-07-10 22:37:50 -04001766
Jan Kara83448bd2019-11-05 17:44:29 +01001767 TP_ARGS(sb, blocks, rsv_blocks, revoke_creds, IP),
Theodore Ts'o12706392011-07-10 22:37:50 -04001768
1769 TP_STRUCT__entry(
1770 __field( dev_t, dev )
Theodore Ts'o12706392011-07-10 22:37:50 -04001771 __field(unsigned long, ip )
Jan Kara5fe2fe82013-06-04 12:37:50 -04001772 __field( int, blocks )
1773 __field( int, rsv_blocks )
Jan Kara83448bd2019-11-05 17:44:29 +01001774 __field( int, revoke_creds )
Theodore Ts'o12706392011-07-10 22:37:50 -04001775 ),
1776
1777 TP_fast_assign(
Jan Kara5fe2fe82013-06-04 12:37:50 -04001778 __entry->dev = sb->s_dev;
1779 __entry->ip = IP;
1780 __entry->blocks = blocks;
1781 __entry->rsv_blocks = rsv_blocks;
Jan Kara83448bd2019-11-05 17:44:29 +01001782 __entry->revoke_creds = revoke_creds;
Theodore Ts'o12706392011-07-10 22:37:50 -04001783 ),
1784
Jan Kara83448bd2019-11-05 17:44:29 +01001785 TP_printk("dev %d,%d blocks %d, rsv_blocks %d, revoke_creds %d, "
1786 "caller %pS", MAJOR(__entry->dev), MINOR(__entry->dev),
1787 __entry->blocks, __entry->rsv_blocks, __entry->revoke_creds,
1788 (void *)__entry->ip)
Jan Kara5fe2fe82013-06-04 12:37:50 -04001789);
1790
1791TRACE_EVENT(ext4_journal_start_reserved,
1792 TP_PROTO(struct super_block *sb, int blocks, unsigned long IP),
1793
1794 TP_ARGS(sb, blocks, IP),
1795
1796 TP_STRUCT__entry(
1797 __field( dev_t, dev )
1798 __field(unsigned long, ip )
1799 __field( int, blocks )
1800 ),
1801
1802 TP_fast_assign(
1803 __entry->dev = sb->s_dev;
1804 __entry->ip = IP;
1805 __entry->blocks = blocks;
1806 ),
1807
Scott Woodbbedb172015-03-11 22:13:57 -05001808 TP_printk("dev %d,%d blocks, %d caller %pS",
Jan Kara5fe2fe82013-06-04 12:37:50 -04001809 MAJOR(__entry->dev), MINOR(__entry->dev),
1810 __entry->blocks, (void *)__entry->ip)
Theodore Ts'o12706392011-07-10 22:37:50 -04001811);
1812
Tao Mab3d4c2b2011-07-11 00:01:52 -04001813DECLARE_EVENT_CLASS(ext4__trim,
1814 TP_PROTO(struct super_block *sb,
1815 ext4_group_t group,
1816 ext4_grpblk_t start,
1817 ext4_grpblk_t len),
1818
1819 TP_ARGS(sb, group, start, len),
1820
1821 TP_STRUCT__entry(
1822 __field( int, dev_major )
1823 __field( int, dev_minor )
1824 __field( __u32, group )
1825 __field( int, start )
1826 __field( int, len )
1827 ),
1828
1829 TP_fast_assign(
1830 __entry->dev_major = MAJOR(sb->s_dev);
1831 __entry->dev_minor = MINOR(sb->s_dev);
1832 __entry->group = group;
1833 __entry->start = start;
1834 __entry->len = len;
1835 ),
1836
1837 TP_printk("dev %d,%d group %u, start %d, len %d",
1838 __entry->dev_major, __entry->dev_minor,
1839 __entry->group, __entry->start, __entry->len)
1840);
1841
1842DEFINE_EVENT(ext4__trim, ext4_trim_extent,
1843
1844 TP_PROTO(struct super_block *sb,
1845 ext4_group_t group,
1846 ext4_grpblk_t start,
1847 ext4_grpblk_t len),
1848
1849 TP_ARGS(sb, group, start, len)
1850);
1851
1852DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
1853
1854 TP_PROTO(struct super_block *sb,
1855 ext4_group_t group,
1856 ext4_grpblk_t start,
1857 ext4_grpblk_t len),
1858
1859 TP_ARGS(sb, group, start, len)
1860);
1861
Lukas Czerner556615d2014-04-20 23:45:47 -04001862TRACE_EVENT(ext4_ext_handle_unwritten_extents,
Zheng Liub5645532012-11-08 14:33:43 -05001863 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int flags,
Aditya Kalid8990242011-09-09 19:18:51 -04001864 unsigned int allocated, ext4_fsblk_t newblock),
1865
Zheng Liub5645532012-11-08 14:33:43 -05001866 TP_ARGS(inode, map, flags, allocated, newblock),
Aditya Kalid8990242011-09-09 19:18:51 -04001867
1868 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001869 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001870 __field( ino_t, ino )
1871 __field( int, flags )
Aditya Kalid8990242011-09-09 19:18:51 -04001872 __field( ext4_lblk_t, lblk )
1873 __field( ext4_fsblk_t, pblk )
1874 __field( unsigned int, len )
Aditya Kalid8990242011-09-09 19:18:51 -04001875 __field( unsigned int, allocated )
1876 __field( ext4_fsblk_t, newblk )
1877 ),
1878
1879 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001880 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001881 __entry->ino = inode->i_ino;
Zheng Liub5645532012-11-08 14:33:43 -05001882 __entry->flags = flags;
Aditya Kalid8990242011-09-09 19:18:51 -04001883 __entry->lblk = map->m_lblk;
1884 __entry->pblk = map->m_pblk;
1885 __entry->len = map->m_len;
Aditya Kalid8990242011-09-09 19:18:51 -04001886 __entry->allocated = allocated;
1887 __entry->newblk = newblock;
1888 ),
1889
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001890 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 -04001891 "allocated %d newblock %llu",
1892 MAJOR(__entry->dev), MINOR(__entry->dev),
1893 (unsigned long) __entry->ino,
1894 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001895 __entry->len, show_map_flags(__entry->flags),
Aditya Kalid8990242011-09-09 19:18:51 -04001896 (unsigned int) __entry->allocated,
1897 (unsigned long long) __entry->newblk)
1898);
1899
1900TRACE_EVENT(ext4_get_implied_cluster_alloc_exit,
1901 TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret),
1902
1903 TP_ARGS(sb, map, ret),
1904
1905 TP_STRUCT__entry(
1906 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001907 __field( unsigned int, flags )
Aditya Kalid8990242011-09-09 19:18:51 -04001908 __field( ext4_lblk_t, lblk )
1909 __field( ext4_fsblk_t, pblk )
1910 __field( unsigned int, len )
Aditya Kalid8990242011-09-09 19:18:51 -04001911 __field( int, ret )
1912 ),
1913
1914 TP_fast_assign(
1915 __entry->dev = sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001916 __entry->flags = map->m_flags;
Aditya Kalid8990242011-09-09 19:18:51 -04001917 __entry->lblk = map->m_lblk;
1918 __entry->pblk = map->m_pblk;
1919 __entry->len = map->m_len;
Aditya Kalid8990242011-09-09 19:18:51 -04001920 __entry->ret = ret;
1921 ),
1922
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001923 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 -04001924 MAJOR(__entry->dev), MINOR(__entry->dev),
1925 __entry->lblk, (unsigned long long) __entry->pblk,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001926 __entry->len, show_mflags(__entry->flags), __entry->ret)
Aditya Kalid8990242011-09-09 19:18:51 -04001927);
1928
1929TRACE_EVENT(ext4_ext_put_in_cache,
1930 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len,
1931 ext4_fsblk_t start),
1932
1933 TP_ARGS(inode, lblk, len, start),
1934
1935 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001936 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001937 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04001938 __field( ext4_lblk_t, lblk )
1939 __field( unsigned int, len )
1940 __field( ext4_fsblk_t, start )
1941 ),
1942
1943 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001944 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001945 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04001946 __entry->lblk = lblk;
1947 __entry->len = len;
1948 __entry->start = start;
1949 ),
1950
1951 TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu",
1952 MAJOR(__entry->dev), MINOR(__entry->dev),
1953 (unsigned long) __entry->ino,
1954 (unsigned) __entry->lblk,
1955 __entry->len,
1956 (unsigned long long) __entry->start)
1957);
1958
1959TRACE_EVENT(ext4_ext_in_cache,
1960 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret),
1961
1962 TP_ARGS(inode, lblk, ret),
1963
1964 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001965 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001966 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04001967 __field( ext4_lblk_t, lblk )
1968 __field( int, ret )
1969 ),
1970
1971 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001972 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001973 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04001974 __entry->lblk = lblk;
1975 __entry->ret = ret;
1976 ),
1977
1978 TP_printk("dev %d,%d ino %lu lblk %u ret %d",
1979 MAJOR(__entry->dev), MINOR(__entry->dev),
1980 (unsigned long) __entry->ino,
1981 (unsigned) __entry->lblk,
1982 __entry->ret)
1983
1984);
1985
1986TRACE_EVENT(ext4_find_delalloc_range,
1987 TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to,
1988 int reverse, int found, ext4_lblk_t found_blk),
1989
1990 TP_ARGS(inode, from, to, reverse, found, found_blk),
1991
1992 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001993 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001994 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04001995 __field( ext4_lblk_t, from )
1996 __field( ext4_lblk_t, to )
1997 __field( int, reverse )
1998 __field( int, found )
1999 __field( ext4_lblk_t, found_blk )
2000 ),
2001
2002 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002003 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002004 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002005 __entry->from = from;
2006 __entry->to = to;
2007 __entry->reverse = reverse;
2008 __entry->found = found;
2009 __entry->found_blk = found_blk;
2010 ),
2011
2012 TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d "
2013 "(blk = %u)",
2014 MAJOR(__entry->dev), MINOR(__entry->dev),
2015 (unsigned long) __entry->ino,
2016 (unsigned) __entry->from, (unsigned) __entry->to,
2017 __entry->reverse, __entry->found,
2018 (unsigned) __entry->found_blk)
2019);
2020
2021TRACE_EVENT(ext4_get_reserved_cluster_alloc,
2022 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len),
2023
2024 TP_ARGS(inode, lblk, len),
2025
2026 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002027 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002028 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002029 __field( ext4_lblk_t, lblk )
2030 __field( unsigned int, len )
2031 ),
2032
2033 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002034 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002035 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002036 __entry->lblk = lblk;
2037 __entry->len = len;
2038 ),
2039
2040 TP_printk("dev %d,%d ino %lu lblk %u len %u",
2041 MAJOR(__entry->dev), MINOR(__entry->dev),
2042 (unsigned long) __entry->ino,
2043 (unsigned) __entry->lblk,
2044 __entry->len)
2045);
2046
2047TRACE_EVENT(ext4_ext_show_extent,
2048 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk,
2049 unsigned short len),
2050
2051 TP_ARGS(inode, lblk, pblk, len),
2052
2053 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002054 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002055 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002056 __field( ext4_fsblk_t, pblk )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002057 __field( ext4_lblk_t, lblk )
Aditya Kalid8990242011-09-09 19:18:51 -04002058 __field( unsigned short, len )
2059 ),
2060
2061 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002062 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002063 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002064 __entry->pblk = pblk;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002065 __entry->lblk = lblk;
Aditya Kalid8990242011-09-09 19:18:51 -04002066 __entry->len = len;
2067 ),
2068
2069 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u",
2070 MAJOR(__entry->dev), MINOR(__entry->dev),
2071 (unsigned long) __entry->ino,
2072 (unsigned) __entry->lblk,
2073 (unsigned long long) __entry->pblk,
2074 (unsigned short) __entry->len)
2075);
2076
2077TRACE_EVENT(ext4_remove_blocks,
Eric Whitney9fe67142018-10-01 14:25:08 -04002078 TP_PROTO(struct inode *inode, struct ext4_extent *ex,
2079 ext4_lblk_t from, ext4_fsblk_t to,
2080 struct partial_cluster *pc),
Aditya Kalid8990242011-09-09 19:18:51 -04002081
Eric Whitney9fe67142018-10-01 14:25:08 -04002082 TP_ARGS(inode, ex, from, to, pc),
Aditya Kalid8990242011-09-09 19:18:51 -04002083
2084 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002085 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002086 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002087 __field( ext4_lblk_t, from )
2088 __field( ext4_lblk_t, to )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002089 __field( ext4_fsblk_t, ee_pblk )
2090 __field( ext4_lblk_t, ee_lblk )
2091 __field( unsigned short, ee_len )
Eric Whitney9fe67142018-10-01 14:25:08 -04002092 __field( ext4_fsblk_t, pc_pclu )
2093 __field( ext4_lblk_t, pc_lblk )
2094 __field( int, pc_state)
Aditya Kalid8990242011-09-09 19:18:51 -04002095 ),
2096
2097 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002098 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002099 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002100 __entry->from = from;
2101 __entry->to = to;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002102 __entry->ee_pblk = ext4_ext_pblock(ex);
Theodore Ts'od6a77102013-04-09 23:59:55 -04002103 __entry->ee_lblk = le32_to_cpu(ex->ee_block);
Anatol Pomozov210c0522012-08-17 09:50:17 -04002104 __entry->ee_len = ext4_ext_get_actual_len(ex);
Eric Whitney9fe67142018-10-01 14:25:08 -04002105 __entry->pc_pclu = pc->pclu;
2106 __entry->pc_lblk = pc->lblk;
2107 __entry->pc_state = pc->state;
Aditya Kalid8990242011-09-09 19:18:51 -04002108 ),
2109
2110 TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
Eric Whitney9fe67142018-10-01 14:25:08 -04002111 "from %u to %u partial [pclu %lld lblk %u state %d]",
Aditya Kalid8990242011-09-09 19:18:51 -04002112 MAJOR(__entry->dev), MINOR(__entry->dev),
2113 (unsigned long) __entry->ino,
2114 (unsigned) __entry->ee_lblk,
2115 (unsigned long long) __entry->ee_pblk,
2116 (unsigned short) __entry->ee_len,
2117 (unsigned) __entry->from,
2118 (unsigned) __entry->to,
Eric Whitney9fe67142018-10-01 14:25:08 -04002119 (long long) __entry->pc_pclu,
2120 (unsigned int) __entry->pc_lblk,
2121 (int) __entry->pc_state)
Aditya Kalid8990242011-09-09 19:18:51 -04002122);
2123
2124TRACE_EVENT(ext4_ext_rm_leaf,
2125 TP_PROTO(struct inode *inode, ext4_lblk_t start,
Lukas Czernerd23142c2013-05-27 23:33:35 -04002126 struct ext4_extent *ex,
Eric Whitney9fe67142018-10-01 14:25:08 -04002127 struct partial_cluster *pc),
Aditya Kalid8990242011-09-09 19:18:51 -04002128
Eric Whitney9fe67142018-10-01 14:25:08 -04002129 TP_ARGS(inode, start, ex, pc),
Aditya Kalid8990242011-09-09 19:18:51 -04002130
2131 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002132 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002133 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002134 __field( ext4_lblk_t, start )
2135 __field( ext4_lblk_t, ee_lblk )
2136 __field( ext4_fsblk_t, ee_pblk )
2137 __field( short, ee_len )
Eric Whitney9fe67142018-10-01 14:25:08 -04002138 __field( ext4_fsblk_t, pc_pclu )
2139 __field( ext4_lblk_t, pc_lblk )
2140 __field( int, pc_state)
Aditya Kalid8990242011-09-09 19:18:51 -04002141 ),
2142
2143 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002144 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002145 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002146 __entry->start = start;
2147 __entry->ee_lblk = le32_to_cpu(ex->ee_block);
2148 __entry->ee_pblk = ext4_ext_pblock(ex);
2149 __entry->ee_len = ext4_ext_get_actual_len(ex);
Eric Whitney9fe67142018-10-01 14:25:08 -04002150 __entry->pc_pclu = pc->pclu;
2151 __entry->pc_lblk = pc->lblk;
2152 __entry->pc_state = pc->state;
Aditya Kalid8990242011-09-09 19:18:51 -04002153 ),
2154
2155 TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
Eric Whitney9fe67142018-10-01 14:25:08 -04002156 "partial [pclu %lld lblk %u state %d]",
Aditya Kalid8990242011-09-09 19:18:51 -04002157 MAJOR(__entry->dev), MINOR(__entry->dev),
2158 (unsigned long) __entry->ino,
2159 (unsigned) __entry->start,
2160 (unsigned) __entry->ee_lblk,
2161 (unsigned long long) __entry->ee_pblk,
2162 (unsigned short) __entry->ee_len,
Eric Whitney9fe67142018-10-01 14:25:08 -04002163 (long long) __entry->pc_pclu,
2164 (unsigned int) __entry->pc_lblk,
2165 (int) __entry->pc_state)
Aditya Kalid8990242011-09-09 19:18:51 -04002166);
2167
2168TRACE_EVENT(ext4_ext_rm_idx,
2169 TP_PROTO(struct inode *inode, ext4_fsblk_t pblk),
2170
2171 TP_ARGS(inode, pblk),
2172
2173 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002174 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002175 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002176 __field( ext4_fsblk_t, pblk )
2177 ),
2178
2179 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002180 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002181 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002182 __entry->pblk = pblk;
2183 ),
2184
2185 TP_printk("dev %d,%d ino %lu index_pblk %llu",
2186 MAJOR(__entry->dev), MINOR(__entry->dev),
2187 (unsigned long) __entry->ino,
2188 (unsigned long long) __entry->pblk)
2189);
2190
2191TRACE_EVENT(ext4_ext_remove_space,
Lukas Czerner61801322013-05-27 23:32:35 -04002192 TP_PROTO(struct inode *inode, ext4_lblk_t start,
2193 ext4_lblk_t end, int depth),
Aditya Kalid8990242011-09-09 19:18:51 -04002194
Lukas Czerner61801322013-05-27 23:32:35 -04002195 TP_ARGS(inode, start, end, depth),
Aditya Kalid8990242011-09-09 19:18:51 -04002196
2197 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002198 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002199 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002200 __field( ext4_lblk_t, start )
Lukas Czerner61801322013-05-27 23:32:35 -04002201 __field( ext4_lblk_t, end )
Aditya Kalid8990242011-09-09 19:18:51 -04002202 __field( int, depth )
2203 ),
2204
2205 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002206 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002207 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002208 __entry->start = start;
Lukas Czerner61801322013-05-27 23:32:35 -04002209 __entry->end = end;
Aditya Kalid8990242011-09-09 19:18:51 -04002210 __entry->depth = depth;
2211 ),
2212
Lukas Czerner61801322013-05-27 23:32:35 -04002213 TP_printk("dev %d,%d ino %lu since %u end %u depth %d",
Aditya Kalid8990242011-09-09 19:18:51 -04002214 MAJOR(__entry->dev), MINOR(__entry->dev),
2215 (unsigned long) __entry->ino,
2216 (unsigned) __entry->start,
Lukas Czerner61801322013-05-27 23:32:35 -04002217 (unsigned) __entry->end,
Aditya Kalid8990242011-09-09 19:18:51 -04002218 __entry->depth)
2219);
2220
2221TRACE_EVENT(ext4_ext_remove_space_done,
Lukas Czerner61801322013-05-27 23:32:35 -04002222 TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end,
Eric Whitney9fe67142018-10-01 14:25:08 -04002223 int depth, struct partial_cluster *pc, __le16 eh_entries),
Aditya Kalid8990242011-09-09 19:18:51 -04002224
Eric Whitney9fe67142018-10-01 14:25:08 -04002225 TP_ARGS(inode, start, end, depth, pc, eh_entries),
Aditya Kalid8990242011-09-09 19:18:51 -04002226
2227 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002228 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002229 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002230 __field( ext4_lblk_t, start )
Lukas Czerner61801322013-05-27 23:32:35 -04002231 __field( ext4_lblk_t, end )
Aditya Kalid8990242011-09-09 19:18:51 -04002232 __field( int, depth )
Eric Whitney9fe67142018-10-01 14:25:08 -04002233 __field( ext4_fsblk_t, pc_pclu )
2234 __field( ext4_lblk_t, pc_lblk )
2235 __field( int, pc_state )
Aditya Kalid8990242011-09-09 19:18:51 -04002236 __field( unsigned short, eh_entries )
2237 ),
2238
2239 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002240 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002241 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002242 __entry->start = start;
Lukas Czerner61801322013-05-27 23:32:35 -04002243 __entry->end = end;
Aditya Kalid8990242011-09-09 19:18:51 -04002244 __entry->depth = depth;
Eric Whitney9fe67142018-10-01 14:25:08 -04002245 __entry->pc_pclu = pc->pclu;
2246 __entry->pc_lblk = pc->lblk;
2247 __entry->pc_state = pc->state;
Theodore Ts'od6a77102013-04-09 23:59:55 -04002248 __entry->eh_entries = le16_to_cpu(eh_entries);
Aditya Kalid8990242011-09-09 19:18:51 -04002249 ),
2250
Eric Whitney9fe67142018-10-01 14:25:08 -04002251 TP_printk("dev %d,%d ino %lu since %u end %u depth %d "
2252 "partial [pclu %lld lblk %u state %d] "
Aditya Kalid8990242011-09-09 19:18:51 -04002253 "remaining_entries %u",
2254 MAJOR(__entry->dev), MINOR(__entry->dev),
2255 (unsigned long) __entry->ino,
2256 (unsigned) __entry->start,
Lukas Czerner61801322013-05-27 23:32:35 -04002257 (unsigned) __entry->end,
Aditya Kalid8990242011-09-09 19:18:51 -04002258 __entry->depth,
Eric Whitney9fe67142018-10-01 14:25:08 -04002259 (long long) __entry->pc_pclu,
2260 (unsigned int) __entry->pc_lblk,
2261 (int) __entry->pc_state,
Aditya Kalid8990242011-09-09 19:18:51 -04002262 (unsigned short) __entry->eh_entries)
2263);
2264
Theodore Ts'o107a7bd2013-08-16 21:23:41 -04002265DECLARE_EVENT_CLASS(ext4__es_extent,
Zheng Liufdc02122013-02-18 00:26:51 -05002266 TP_PROTO(struct inode *inode, struct extent_status *es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002267
Zheng Liufdc02122013-02-18 00:26:51 -05002268 TP_ARGS(inode, es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002269
2270 TP_STRUCT__entry(
Zheng Liufdc02122013-02-18 00:26:51 -05002271 __field( dev_t, dev )
2272 __field( ino_t, ino )
2273 __field( ext4_lblk_t, lblk )
2274 __field( ext4_lblk_t, len )
2275 __field( ext4_fsblk_t, pblk )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002276 __field( char, status )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002277 ),
2278
2279 TP_fast_assign(
2280 __entry->dev = inode->i_sb->s_dev;
2281 __entry->ino = inode->i_ino;
Zheng Liufdc02122013-02-18 00:26:51 -05002282 __entry->lblk = es->es_lblk;
2283 __entry->len = es->es_len;
Dmitry Monakhov52144d82019-11-14 20:01:47 +00002284 __entry->pblk = ext4_es_show_pblock(es);
Theodore Ts'o3be78c72013-08-16 21:22:41 -04002285 __entry->status = ext4_es_status(es);
Zheng Liu992e9fd2012-11-08 21:57:33 -05002286 ),
2287
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002288 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
Zheng Liu992e9fd2012-11-08 21:57:33 -05002289 MAJOR(__entry->dev), MINOR(__entry->dev),
2290 (unsigned long) __entry->ino,
Zheng Liufdc02122013-02-18 00:26:51 -05002291 __entry->lblk, __entry->len,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002292 __entry->pblk, show_extent_status(__entry->status))
Zheng Liu992e9fd2012-11-08 21:57:33 -05002293);
2294
Theodore Ts'o107a7bd2013-08-16 21:23:41 -04002295DEFINE_EVENT(ext4__es_extent, ext4_es_insert_extent,
2296 TP_PROTO(struct inode *inode, struct extent_status *es),
2297
2298 TP_ARGS(inode, es)
2299);
2300
2301DEFINE_EVENT(ext4__es_extent, ext4_es_cache_extent,
2302 TP_PROTO(struct inode *inode, struct extent_status *es),
2303
2304 TP_ARGS(inode, es)
2305);
2306
Zheng Liu992e9fd2012-11-08 21:57:33 -05002307TRACE_EVENT(ext4_es_remove_extent,
Zheng Liu06b0c882013-02-18 00:26:51 -05002308 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002309
Zheng Liu06b0c882013-02-18 00:26:51 -05002310 TP_ARGS(inode, lblk, len),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002311
2312 TP_STRUCT__entry(
2313 __field( dev_t, dev )
2314 __field( ino_t, ino )
Zheng Liu06b0c882013-02-18 00:26:51 -05002315 __field( loff_t, lblk )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002316 __field( loff_t, len )
2317 ),
2318
2319 TP_fast_assign(
2320 __entry->dev = inode->i_sb->s_dev;
2321 __entry->ino = inode->i_ino;
Zheng Liu06b0c882013-02-18 00:26:51 -05002322 __entry->lblk = lblk;
Zheng Liu992e9fd2012-11-08 21:57:33 -05002323 __entry->len = len;
2324 ),
2325
2326 TP_printk("dev %d,%d ino %lu es [%lld/%lld)",
2327 MAJOR(__entry->dev), MINOR(__entry->dev),
2328 (unsigned long) __entry->ino,
Zheng Liu06b0c882013-02-18 00:26:51 -05002329 __entry->lblk, __entry->len)
Zheng Liu992e9fd2012-11-08 21:57:33 -05002330);
2331
Eric Whitneyad431022018-10-01 14:10:39 -04002332TRACE_EVENT(ext4_es_find_extent_range_enter,
Zheng Liu06b0c882013-02-18 00:26:51 -05002333 TP_PROTO(struct inode *inode, ext4_lblk_t lblk),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002334
Zheng Liu06b0c882013-02-18 00:26:51 -05002335 TP_ARGS(inode, lblk),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002336
2337 TP_STRUCT__entry(
2338 __field( dev_t, dev )
2339 __field( ino_t, ino )
Zheng Liu06b0c882013-02-18 00:26:51 -05002340 __field( ext4_lblk_t, lblk )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002341 ),
2342
2343 TP_fast_assign(
2344 __entry->dev = inode->i_sb->s_dev;
2345 __entry->ino = inode->i_ino;
Zheng Liu06b0c882013-02-18 00:26:51 -05002346 __entry->lblk = lblk;
Zheng Liu992e9fd2012-11-08 21:57:33 -05002347 ),
2348
Zheng Liu06b0c882013-02-18 00:26:51 -05002349 TP_printk("dev %d,%d ino %lu lblk %u",
Zheng Liu992e9fd2012-11-08 21:57:33 -05002350 MAJOR(__entry->dev), MINOR(__entry->dev),
Zheng Liu06b0c882013-02-18 00:26:51 -05002351 (unsigned long) __entry->ino, __entry->lblk)
Zheng Liu992e9fd2012-11-08 21:57:33 -05002352);
2353
Eric Whitneyad431022018-10-01 14:10:39 -04002354TRACE_EVENT(ext4_es_find_extent_range_exit,
Zheng Liube401362013-02-18 00:27:26 -05002355 TP_PROTO(struct inode *inode, struct extent_status *es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002356
Zheng Liube401362013-02-18 00:27:26 -05002357 TP_ARGS(inode, es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002358
2359 TP_STRUCT__entry(
2360 __field( dev_t, dev )
2361 __field( ino_t, ino )
Zheng Liu06b0c882013-02-18 00:26:51 -05002362 __field( ext4_lblk_t, lblk )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002363 __field( ext4_lblk_t, len )
Zheng Liufdc02122013-02-18 00:26:51 -05002364 __field( ext4_fsblk_t, pblk )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002365 __field( char, status )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002366 ),
2367
2368 TP_fast_assign(
2369 __entry->dev = inode->i_sb->s_dev;
2370 __entry->ino = inode->i_ino;
Zheng Liu06b0c882013-02-18 00:26:51 -05002371 __entry->lblk = es->es_lblk;
2372 __entry->len = es->es_len;
Dmitry Monakhov52144d82019-11-14 20:01:47 +00002373 __entry->pblk = ext4_es_show_pblock(es);
Theodore Ts'o3be78c72013-08-16 21:22:41 -04002374 __entry->status = ext4_es_status(es);
Zheng Liu992e9fd2012-11-08 21:57:33 -05002375 ),
2376
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002377 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
Zheng Liu992e9fd2012-11-08 21:57:33 -05002378 MAJOR(__entry->dev), MINOR(__entry->dev),
2379 (unsigned long) __entry->ino,
Zheng Liufdc02122013-02-18 00:26:51 -05002380 __entry->lblk, __entry->len,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002381 __entry->pblk, show_extent_status(__entry->status))
Zheng Liu992e9fd2012-11-08 21:57:33 -05002382);
2383
Zheng Liud100eef2013-02-18 00:29:59 -05002384TRACE_EVENT(ext4_es_lookup_extent_enter,
2385 TP_PROTO(struct inode *inode, ext4_lblk_t lblk),
2386
2387 TP_ARGS(inode, lblk),
2388
2389 TP_STRUCT__entry(
2390 __field( dev_t, dev )
2391 __field( ino_t, ino )
2392 __field( ext4_lblk_t, lblk )
2393 ),
2394
2395 TP_fast_assign(
2396 __entry->dev = inode->i_sb->s_dev;
2397 __entry->ino = inode->i_ino;
2398 __entry->lblk = lblk;
2399 ),
2400
2401 TP_printk("dev %d,%d ino %lu lblk %u",
2402 MAJOR(__entry->dev), MINOR(__entry->dev),
2403 (unsigned long) __entry->ino, __entry->lblk)
2404);
2405
2406TRACE_EVENT(ext4_es_lookup_extent_exit,
2407 TP_PROTO(struct inode *inode, struct extent_status *es,
2408 int found),
2409
2410 TP_ARGS(inode, es, found),
2411
2412 TP_STRUCT__entry(
2413 __field( dev_t, dev )
2414 __field( ino_t, ino )
2415 __field( ext4_lblk_t, lblk )
2416 __field( ext4_lblk_t, len )
2417 __field( ext4_fsblk_t, pblk )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002418 __field( char, status )
Zheng Liud100eef2013-02-18 00:29:59 -05002419 __field( int, found )
2420 ),
2421
2422 TP_fast_assign(
2423 __entry->dev = inode->i_sb->s_dev;
2424 __entry->ino = inode->i_ino;
2425 __entry->lblk = es->es_lblk;
2426 __entry->len = es->es_len;
Dmitry Monakhov52144d82019-11-14 20:01:47 +00002427 __entry->pblk = ext4_es_show_pblock(es);
Theodore Ts'o3be78c72013-08-16 21:22:41 -04002428 __entry->status = ext4_es_status(es);
Zheng Liud100eef2013-02-18 00:29:59 -05002429 __entry->found = found;
2430 ),
2431
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002432 TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %s",
Zheng Liud100eef2013-02-18 00:29:59 -05002433 MAJOR(__entry->dev), MINOR(__entry->dev),
2434 (unsigned long) __entry->ino, __entry->found,
2435 __entry->lblk, __entry->len,
2436 __entry->found ? __entry->pblk : 0,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002437 show_extent_status(__entry->found ? __entry->status : 0))
Zheng Liud100eef2013-02-18 00:29:59 -05002438);
2439
Zheng Liue963bb12014-09-01 22:22:13 -04002440DECLARE_EVENT_CLASS(ext4__es_shrink_enter,
Theodore Ts'o24630772013-02-28 23:58:56 -05002441 TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002442
Theodore Ts'o24630772013-02-28 23:58:56 -05002443 TP_ARGS(sb, nr_to_scan, cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002444
2445 TP_STRUCT__entry(
2446 __field( dev_t, dev )
2447 __field( int, nr_to_scan )
Theodore Ts'o24630772013-02-28 23:58:56 -05002448 __field( int, cache_cnt )
Zheng Liu74cd15c2013-02-18 00:32:55 -05002449 ),
2450
2451 TP_fast_assign(
2452 __entry->dev = sb->s_dev;
2453 __entry->nr_to_scan = nr_to_scan;
Theodore Ts'o24630772013-02-28 23:58:56 -05002454 __entry->cache_cnt = cache_cnt;
Zheng Liu74cd15c2013-02-18 00:32:55 -05002455 ),
2456
Theodore Ts'o24630772013-02-28 23:58:56 -05002457 TP_printk("dev %d,%d nr_to_scan %d cache_cnt %d",
Zheng Liu74cd15c2013-02-18 00:32:55 -05002458 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o24630772013-02-28 23:58:56 -05002459 __entry->nr_to_scan, __entry->cache_cnt)
Zheng Liu74cd15c2013-02-18 00:32:55 -05002460);
2461
Zheng Liue963bb12014-09-01 22:22:13 -04002462DEFINE_EVENT(ext4__es_shrink_enter, ext4_es_shrink_count,
2463 TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002464
Zheng Liue963bb12014-09-01 22:22:13 -04002465 TP_ARGS(sb, nr_to_scan, cache_cnt)
2466);
2467
2468DEFINE_EVENT(ext4__es_shrink_enter, ext4_es_shrink_scan_enter,
2469 TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt),
2470
2471 TP_ARGS(sb, nr_to_scan, cache_cnt)
2472);
2473
2474TRACE_EVENT(ext4_es_shrink_scan_exit,
2475 TP_PROTO(struct super_block *sb, int nr_shrunk, int cache_cnt),
2476
2477 TP_ARGS(sb, nr_shrunk, cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002478
2479 TP_STRUCT__entry(
2480 __field( dev_t, dev )
Zheng Liue963bb12014-09-01 22:22:13 -04002481 __field( int, nr_shrunk )
Theodore Ts'o24630772013-02-28 23:58:56 -05002482 __field( int, cache_cnt )
Zheng Liu74cd15c2013-02-18 00:32:55 -05002483 ),
2484
2485 TP_fast_assign(
2486 __entry->dev = sb->s_dev;
Zheng Liue963bb12014-09-01 22:22:13 -04002487 __entry->nr_shrunk = nr_shrunk;
Theodore Ts'o24630772013-02-28 23:58:56 -05002488 __entry->cache_cnt = cache_cnt;
Zheng Liu74cd15c2013-02-18 00:32:55 -05002489 ),
2490
Zheng Liue963bb12014-09-01 22:22:13 -04002491 TP_printk("dev %d,%d nr_shrunk %d cache_cnt %d",
Zheng Liu74cd15c2013-02-18 00:32:55 -05002492 MAJOR(__entry->dev), MINOR(__entry->dev),
Zheng Liue963bb12014-09-01 22:22:13 -04002493 __entry->nr_shrunk, __entry->cache_cnt)
Zheng Liu74cd15c2013-02-18 00:32:55 -05002494);
2495
Namjae Jeon9eb79482014-02-23 15:18:59 -05002496TRACE_EVENT(ext4_collapse_range,
2497 TP_PROTO(struct inode *inode, loff_t offset, loff_t len),
2498
2499 TP_ARGS(inode, offset, len),
2500
2501 TP_STRUCT__entry(
2502 __field(dev_t, dev)
2503 __field(ino_t, ino)
2504 __field(loff_t, offset)
2505 __field(loff_t, len)
2506 ),
2507
2508 TP_fast_assign(
2509 __entry->dev = inode->i_sb->s_dev;
2510 __entry->ino = inode->i_ino;
2511 __entry->offset = offset;
2512 __entry->len = len;
2513 ),
2514
2515 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2516 MAJOR(__entry->dev), MINOR(__entry->dev),
2517 (unsigned long) __entry->ino,
2518 __entry->offset, __entry->len)
2519);
2520
Namjae Jeon331573f2015-06-09 01:55:03 -04002521TRACE_EVENT(ext4_insert_range,
2522 TP_PROTO(struct inode *inode, loff_t offset, loff_t len),
2523
2524 TP_ARGS(inode, offset, len),
2525
2526 TP_STRUCT__entry(
2527 __field(dev_t, dev)
2528 __field(ino_t, ino)
2529 __field(loff_t, offset)
2530 __field(loff_t, len)
2531 ),
2532
2533 TP_fast_assign(
2534 __entry->dev = inode->i_sb->s_dev;
2535 __entry->ino = inode->i_ino;
2536 __entry->offset = offset;
2537 __entry->len = len;
2538 ),
2539
2540 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2541 MAJOR(__entry->dev), MINOR(__entry->dev),
2542 (unsigned long) __entry->ino,
2543 __entry->offset, __entry->len)
2544);
2545
Zheng Liueb68d0e2014-09-01 22:26:49 -04002546TRACE_EVENT(ext4_es_shrink,
2547 TP_PROTO(struct super_block *sb, int nr_shrunk, u64 scan_time,
Zheng Liuedaa53c2014-11-25 11:45:37 -05002548 int nr_skipped, int retried),
Zheng Liueb68d0e2014-09-01 22:26:49 -04002549
Zheng Liuedaa53c2014-11-25 11:45:37 -05002550 TP_ARGS(sb, nr_shrunk, scan_time, nr_skipped, retried),
Zheng Liueb68d0e2014-09-01 22:26:49 -04002551
2552 TP_STRUCT__entry(
2553 __field( dev_t, dev )
2554 __field( int, nr_shrunk )
2555 __field( unsigned long long, scan_time )
Zheng Liueb68d0e2014-09-01 22:26:49 -04002556 __field( int, nr_skipped )
2557 __field( int, retried )
2558 ),
2559
2560 TP_fast_assign(
2561 __entry->dev = sb->s_dev;
2562 __entry->nr_shrunk = nr_shrunk;
2563 __entry->scan_time = div_u64(scan_time, 1000);
Zheng Liueb68d0e2014-09-01 22:26:49 -04002564 __entry->nr_skipped = nr_skipped;
2565 __entry->retried = retried;
2566 ),
2567
Zheng Liuedaa53c2014-11-25 11:45:37 -05002568 TP_printk("dev %d,%d nr_shrunk %d, scan_time %llu "
Zheng Liueb68d0e2014-09-01 22:26:49 -04002569 "nr_skipped %d retried %d",
2570 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->nr_shrunk,
Zheng Liuedaa53c2014-11-25 11:45:37 -05002571 __entry->scan_time, __entry->nr_skipped, __entry->retried)
Zheng Liueb68d0e2014-09-01 22:26:49 -04002572);
2573
Eric Whitney0b02f4c2018-10-01 14:19:37 -04002574TRACE_EVENT(ext4_es_insert_delayed_block,
2575 TP_PROTO(struct inode *inode, struct extent_status *es,
2576 bool allocated),
2577
2578 TP_ARGS(inode, es, allocated),
2579
2580 TP_STRUCT__entry(
2581 __field( dev_t, dev )
2582 __field( ino_t, ino )
2583 __field( ext4_lblk_t, lblk )
2584 __field( ext4_lblk_t, len )
2585 __field( ext4_fsblk_t, pblk )
2586 __field( char, status )
2587 __field( bool, allocated )
2588 ),
2589
2590 TP_fast_assign(
2591 __entry->dev = inode->i_sb->s_dev;
2592 __entry->ino = inode->i_ino;
2593 __entry->lblk = es->es_lblk;
2594 __entry->len = es->es_len;
Dmitry Monakhov52144d82019-11-14 20:01:47 +00002595 __entry->pblk = ext4_es_show_pblock(es);
Eric Whitney0b02f4c2018-10-01 14:19:37 -04002596 __entry->status = ext4_es_status(es);
2597 __entry->allocated = allocated;
2598 ),
2599
2600 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s "
2601 "allocated %d",
2602 MAJOR(__entry->dev), MINOR(__entry->dev),
2603 (unsigned long) __entry->ino,
2604 __entry->lblk, __entry->len,
2605 __entry->pblk, show_extent_status(__entry->status),
2606 __entry->allocated)
2607);
2608
Darrick J. Wong0c9ec4b2017-04-30 00:36:53 -04002609/* fsmap traces */
2610DECLARE_EVENT_CLASS(ext4_fsmap_class,
2611 TP_PROTO(struct super_block *sb, u32 keydev, u32 agno, u64 bno, u64 len,
2612 u64 owner),
2613 TP_ARGS(sb, keydev, agno, bno, len, owner),
2614 TP_STRUCT__entry(
2615 __field(dev_t, dev)
2616 __field(dev_t, keydev)
2617 __field(u32, agno)
2618 __field(u64, bno)
2619 __field(u64, len)
2620 __field(u64, owner)
2621 ),
2622 TP_fast_assign(
2623 __entry->dev = sb->s_bdev->bd_dev;
2624 __entry->keydev = new_decode_dev(keydev);
2625 __entry->agno = agno;
2626 __entry->bno = bno;
2627 __entry->len = len;
2628 __entry->owner = owner;
2629 ),
2630 TP_printk("dev %d:%d keydev %d:%d agno %u bno %llu len %llu owner %lld\n",
2631 MAJOR(__entry->dev), MINOR(__entry->dev),
2632 MAJOR(__entry->keydev), MINOR(__entry->keydev),
2633 __entry->agno,
2634 __entry->bno,
2635 __entry->len,
2636 __entry->owner)
2637)
2638#define DEFINE_FSMAP_EVENT(name) \
2639DEFINE_EVENT(ext4_fsmap_class, name, \
2640 TP_PROTO(struct super_block *sb, u32 keydev, u32 agno, u64 bno, u64 len, \
2641 u64 owner), \
2642 TP_ARGS(sb, keydev, agno, bno, len, owner))
2643DEFINE_FSMAP_EVENT(ext4_fsmap_low_key);
2644DEFINE_FSMAP_EVENT(ext4_fsmap_high_key);
2645DEFINE_FSMAP_EVENT(ext4_fsmap_mapping);
2646
2647DECLARE_EVENT_CLASS(ext4_getfsmap_class,
2648 TP_PROTO(struct super_block *sb, struct ext4_fsmap *fsmap),
2649 TP_ARGS(sb, fsmap),
2650 TP_STRUCT__entry(
2651 __field(dev_t, dev)
2652 __field(dev_t, keydev)
2653 __field(u64, block)
2654 __field(u64, len)
2655 __field(u64, owner)
2656 __field(u64, flags)
2657 ),
2658 TP_fast_assign(
2659 __entry->dev = sb->s_bdev->bd_dev;
2660 __entry->keydev = new_decode_dev(fsmap->fmr_device);
2661 __entry->block = fsmap->fmr_physical;
2662 __entry->len = fsmap->fmr_length;
2663 __entry->owner = fsmap->fmr_owner;
2664 __entry->flags = fsmap->fmr_flags;
2665 ),
2666 TP_printk("dev %d:%d keydev %d:%d block %llu len %llu owner %lld flags 0x%llx\n",
2667 MAJOR(__entry->dev), MINOR(__entry->dev),
2668 MAJOR(__entry->keydev), MINOR(__entry->keydev),
2669 __entry->block,
2670 __entry->len,
2671 __entry->owner,
2672 __entry->flags)
2673)
2674#define DEFINE_GETFSMAP_EVENT(name) \
2675DEFINE_EVENT(ext4_getfsmap_class, name, \
2676 TP_PROTO(struct super_block *sb, struct ext4_fsmap *fsmap), \
2677 TP_ARGS(sb, fsmap))
2678DEFINE_GETFSMAP_EVENT(ext4_getfsmap_low_key);
2679DEFINE_GETFSMAP_EVENT(ext4_getfsmap_high_key);
2680DEFINE_GETFSMAP_EVENT(ext4_getfsmap_mapping);
2681
Theodore Ts'occf0f322018-02-18 20:53:23 -05002682TRACE_EVENT(ext4_shutdown,
2683 TP_PROTO(struct super_block *sb, unsigned long flags),
2684
2685 TP_ARGS(sb, flags),
2686
2687 TP_STRUCT__entry(
2688 __field( dev_t, dev )
2689 __field( unsigned, flags )
2690 ),
2691
2692 TP_fast_assign(
2693 __entry->dev = sb->s_dev;
2694 __entry->flags = flags;
2695 ),
2696
2697 TP_printk("dev %d,%d flags %u",
2698 MAJOR(__entry->dev), MINOR(__entry->dev),
2699 __entry->flags)
2700);
2701
2702TRACE_EVENT(ext4_error,
2703 TP_PROTO(struct super_block *sb, const char *function,
2704 unsigned int line),
2705
2706 TP_ARGS(sb, function, line),
2707
2708 TP_STRUCT__entry(
2709 __field( dev_t, dev )
2710 __field( const char *, function )
2711 __field( unsigned, line )
2712 ),
2713
2714 TP_fast_assign(
2715 __entry->dev = sb->s_dev;
2716 __entry->function = function;
2717 __entry->line = line;
2718 ),
2719
2720 TP_printk("dev %d,%d function %s line %u",
2721 MAJOR(__entry->dev), MINOR(__entry->dev),
2722 __entry->function, __entry->line)
2723);
2724
Theodore Ts'o9bffad12009-06-17 11:48:11 -04002725#endif /* _TRACE_EXT4_H */
2726
2727/* This part must be outside protection */
2728#include <trace/define_trace.h>