blob: cc41d692ae8edfa4421221da51c528d57eb8bf8f [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" }, \
Ritesh Harjani99377832020-05-20 12:10:36 +053038 { EXT4_MB_USE_RESERVED, "USE_RESV" }, \
39 { EXT4_MB_STRICT_CHECK, "STRICT_CHECK" })
Theodore Ts'o21ddd562013-07-01 08:12:40 -040040
41#define show_map_flags(flags) __print_flags(flags, "|", \
42 { EXT4_GET_BLOCKS_CREATE, "CREATE" }, \
Lukas Czerner556615d2014-04-20 23:45:47 -040043 { EXT4_GET_BLOCKS_UNWRIT_EXT, "UNWRIT" }, \
Theodore Ts'o21ddd562013-07-01 08:12:40 -040044 { EXT4_GET_BLOCKS_DELALLOC_RESERVE, "DELALLOC" }, \
45 { EXT4_GET_BLOCKS_PRE_IO, "PRE_IO" }, \
46 { EXT4_GET_BLOCKS_CONVERT, "CONVERT" }, \
47 { EXT4_GET_BLOCKS_METADATA_NOFAIL, "METADATA_NOFAIL" }, \
48 { EXT4_GET_BLOCKS_NO_NORMALIZE, "NO_NORMALIZE" }, \
Eric Whitney493e83a2020-04-15 16:31:40 -040049 { EXT4_GET_BLOCKS_CONVERT_UNWRITTEN, "CONVERT_UNWRITTEN" }, \
50 { EXT4_GET_BLOCKS_ZERO, "ZERO" }, \
51 { EXT4_GET_BLOCKS_IO_SUBMIT, "IO_SUBMIT" }, \
52 { EXT4_EX_NOCACHE, "EX_NOCACHE" })
Theodore Ts'o21ddd562013-07-01 08:12:40 -040053
Dmitry Monakhov459c8072019-11-14 20:01:46 +000054/*
55 * __print_flags() requires that all enum values be wrapped in the
56 * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
57 * ring buffer.
58 */
59TRACE_DEFINE_ENUM(BH_New);
60TRACE_DEFINE_ENUM(BH_Mapped);
61TRACE_DEFINE_ENUM(BH_Unwritten);
62TRACE_DEFINE_ENUM(BH_Boundary);
63
Theodore Ts'o21ddd562013-07-01 08:12:40 -040064#define show_mflags(flags) __print_flags(flags, "", \
65 { EXT4_MAP_NEW, "N" }, \
66 { EXT4_MAP_MAPPED, "M" }, \
67 { EXT4_MAP_UNWRITTEN, "U" }, \
Jan Karacbd75842014-11-25 11:41:49 -050068 { EXT4_MAP_BOUNDARY, "B" })
Theodore Ts'o21ddd562013-07-01 08:12:40 -040069
70#define show_free_flags(flags) __print_flags(flags, "|", \
71 { EXT4_FREE_BLOCKS_METADATA, "METADATA" }, \
72 { EXT4_FREE_BLOCKS_FORGET, "FORGET" }, \
73 { EXT4_FREE_BLOCKS_VALIDATED, "VALIDATED" }, \
74 { EXT4_FREE_BLOCKS_NO_QUOT_UPDATE, "NO_QUOTA" }, \
75 { EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER,"1ST_CLUSTER" },\
76 { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" })
77
Dmitry Monakhov459c8072019-11-14 20:01:46 +000078TRACE_DEFINE_ENUM(ES_WRITTEN_B);
79TRACE_DEFINE_ENUM(ES_UNWRITTEN_B);
80TRACE_DEFINE_ENUM(ES_DELAYED_B);
81TRACE_DEFINE_ENUM(ES_HOLE_B);
82TRACE_DEFINE_ENUM(ES_REFERENCED_B);
83
Theodore Ts'o21ddd562013-07-01 08:12:40 -040084#define show_extent_status(status) __print_flags(status, "", \
Theodore Ts'o3be78c72013-08-16 21:22:41 -040085 { EXTENT_STATUS_WRITTEN, "W" }, \
86 { EXTENT_STATUS_UNWRITTEN, "U" }, \
87 { EXTENT_STATUS_DELAYED, "D" }, \
Dmitry Monakhov459c8072019-11-14 20:01:46 +000088 { EXTENT_STATUS_HOLE, "H" }, \
89 { EXTENT_STATUS_REFERENCED, "R" })
Theodore Ts'o21ddd562013-07-01 08:12:40 -040090
Lukas Czernera633f5a2014-02-22 06:18:17 -050091#define show_falloc_mode(mode) __print_flags(mode, "|", \
92 { FALLOC_FL_KEEP_SIZE, "KEEP_SIZE"}, \
93 { FALLOC_FL_PUNCH_HOLE, "PUNCH_HOLE"}, \
Namjae Jeon9eb79482014-02-23 15:18:59 -050094 { FALLOC_FL_NO_HIDE_STALE, "NO_HIDE_STALE"}, \
Lukas Czernerb8a86842014-03-18 18:05:35 -040095 { FALLOC_FL_COLLAPSE_RANGE, "COLLAPSE_RANGE"}, \
96 { FALLOC_FL_ZERO_RANGE, "ZERO_RANGE"})
Lukas Czernera633f5a2014-02-22 06:18:17 -050097
Theodore Ts'o21ddd562013-07-01 08:12:40 -040098
Theodore Ts'oa26f4992015-02-02 00:37:02 -050099TRACE_EVENT(ext4_other_inode_update_time,
100 TP_PROTO(struct inode *inode, ino_t orig_ino),
101
102 TP_ARGS(inode, orig_ino),
103
104 TP_STRUCT__entry(
105 __field( dev_t, dev )
106 __field( ino_t, ino )
107 __field( ino_t, orig_ino )
108 __field( uid_t, uid )
109 __field( gid_t, gid )
110 __field( __u16, mode )
111 ),
112
113 TP_fast_assign(
114 __entry->orig_ino = orig_ino;
115 __entry->dev = inode->i_sb->s_dev;
116 __entry->ino = inode->i_ino;
117 __entry->uid = i_uid_read(inode);
118 __entry->gid = i_gid_read(inode);
119 __entry->mode = inode->i_mode;
120 ),
121
122 TP_printk("dev %d,%d orig_ino %lu ino %lu mode 0%o uid %u gid %u",
123 MAJOR(__entry->dev), MINOR(__entry->dev),
124 (unsigned long) __entry->orig_ino,
125 (unsigned long) __entry->ino, __entry->mode,
126 __entry->uid, __entry->gid)
127);
128
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400129TRACE_EVENT(ext4_free_inode,
130 TP_PROTO(struct inode *inode),
131
132 TP_ARGS(inode),
133
134 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400135 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400136 __field( ino_t, ino )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400137 __field( uid_t, uid )
138 __field( gid_t, gid )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400139 __field( __u64, blocks )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400140 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400141 ),
142
143 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400144 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400145 __entry->ino = inode->i_ino;
Eric W. Biederman08cefc72012-02-07 15:41:49 -0800146 __entry->uid = i_uid_read(inode);
147 __entry->gid = i_gid_read(inode);
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400148 __entry->blocks = inode->i_blocks;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400149 __entry->mode = inode->i_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400150 ),
151
Theodore Ts'oa2690292010-10-27 22:08:50 -0400152 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400153 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -0400154 (unsigned long) __entry->ino, __entry->mode,
155 __entry->uid, __entry->gid, __entry->blocks)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400156);
157
158TRACE_EVENT(ext4_request_inode,
159 TP_PROTO(struct inode *dir, int mode),
160
161 TP_ARGS(dir, mode),
162
163 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400164 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400165 __field( ino_t, dir )
Theodore Ts'o59be8e72011-07-30 12:38:46 -0400166 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400167 ),
168
169 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400170 __entry->dev = dir->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400171 __entry->dir = dir->i_ino;
172 __entry->mode = mode;
173 ),
174
Theodore Ts'oa2690292010-10-27 22:08:50 -0400175 TP_printk("dev %d,%d dir %lu mode 0%o",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400176 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400177 (unsigned long) __entry->dir, __entry->mode)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400178);
179
180TRACE_EVENT(ext4_allocate_inode,
181 TP_PROTO(struct inode *inode, struct inode *dir, int mode),
182
183 TP_ARGS(inode, dir, mode),
184
185 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400186 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400187 __field( ino_t, ino )
188 __field( ino_t, dir )
Theodore Ts'o59be8e72011-07-30 12:38:46 -0400189 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400190 ),
191
192 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400193 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400194 __entry->ino = inode->i_ino;
195 __entry->dir = dir->i_ino;
196 __entry->mode = mode;
197 ),
198
Theodore Ts'oa2690292010-10-27 22:08:50 -0400199 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400200 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400201 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400202 (unsigned long) __entry->dir, __entry->mode)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400203);
204
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500205TRACE_EVENT(ext4_evict_inode,
206 TP_PROTO(struct inode *inode),
207
208 TP_ARGS(inode),
209
210 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400211 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500212 __field( ino_t, ino )
213 __field( int, nlink )
214 ),
215
216 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400217 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500218 __entry->ino = inode->i_ino;
219 __entry->nlink = inode->i_nlink;
220 ),
221
222 TP_printk("dev %d,%d ino %lu nlink %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400223 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500224 (unsigned long) __entry->ino, __entry->nlink)
225);
226
227TRACE_EVENT(ext4_drop_inode,
228 TP_PROTO(struct inode *inode, int drop),
229
230 TP_ARGS(inode, drop),
231
232 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400233 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500234 __field( ino_t, ino )
235 __field( int, drop )
236 ),
237
238 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400239 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500240 __entry->ino = inode->i_ino;
241 __entry->drop = drop;
242 ),
243
244 TP_printk("dev %d,%d ino %lu drop %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400245 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500246 (unsigned long) __entry->ino, __entry->drop)
247);
248
Theodore Ts'ofde87262018-12-19 14:07:58 -0500249TRACE_EVENT(ext4_nfs_commit_metadata,
250 TP_PROTO(struct inode *inode),
251
252 TP_ARGS(inode),
253
254 TP_STRUCT__entry(
255 __field( dev_t, dev )
256 __field( ino_t, ino )
257 ),
258
259 TP_fast_assign(
260 __entry->dev = inode->i_sb->s_dev;
261 __entry->ino = inode->i_ino;
262 ),
263
264 TP_printk("dev %d,%d ino %lu",
265 MAJOR(__entry->dev), MINOR(__entry->dev),
266 (unsigned long) __entry->ino)
267);
268
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500269TRACE_EVENT(ext4_mark_inode_dirty,
270 TP_PROTO(struct inode *inode, unsigned long IP),
271
272 TP_ARGS(inode, IP),
273
274 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400275 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500276 __field( ino_t, ino )
277 __field(unsigned long, ip )
278 ),
279
280 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400281 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500282 __entry->ino = inode->i_ino;
283 __entry->ip = IP;
284 ),
285
Scott Woodbbedb172015-03-11 22:13:57 -0500286 TP_printk("dev %d,%d ino %lu caller %pS",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400287 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500288 (unsigned long) __entry->ino, (void *)__entry->ip)
289);
290
291TRACE_EVENT(ext4_begin_ordered_truncate,
292 TP_PROTO(struct inode *inode, loff_t new_size),
293
294 TP_ARGS(inode, new_size),
295
296 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400297 __field( dev_t, dev )
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500298 __field( ino_t, ino )
299 __field( loff_t, new_size )
300 ),
301
302 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400303 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500304 __entry->ino = inode->i_ino;
305 __entry->new_size = new_size;
306 ),
307
308 TP_printk("dev %d,%d ino %lu new_size %lld",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400309 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500310 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400311 __entry->new_size)
Theodore Ts'o7ff9c072010-11-08 13:51:33 -0500312);
313
Li Zefanb5eb34c2009-11-26 15:07:36 +0800314DECLARE_EVENT_CLASS(ext4__write_begin,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400315
316 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
317 unsigned int flags),
318
319 TP_ARGS(inode, pos, len, flags),
320
321 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400322 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400323 __field( ino_t, ino )
324 __field( loff_t, pos )
325 __field( unsigned int, len )
326 __field( unsigned int, flags )
327 ),
328
329 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400330 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400331 __entry->ino = inode->i_ino;
332 __entry->pos = pos;
333 __entry->len = len;
334 __entry->flags = flags;
335 ),
336
Lukas Czernera9c667f2011-06-06 09:51:52 -0400337 TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400338 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400339 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400340 __entry->pos, __entry->len, __entry->flags)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400341);
342
Li Zefanb5eb34c2009-11-26 15:07:36 +0800343DEFINE_EVENT(ext4__write_begin, ext4_write_begin,
344
345 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
346 unsigned int flags),
347
348 TP_ARGS(inode, pos, len, flags)
349);
350
351DEFINE_EVENT(ext4__write_begin, ext4_da_write_begin,
352
353 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
354 unsigned int flags),
355
356 TP_ARGS(inode, pos, len, flags)
357);
358
359DECLARE_EVENT_CLASS(ext4__write_end,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400360 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
361 unsigned int copied),
362
363 TP_ARGS(inode, pos, len, copied),
364
365 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400366 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400367 __field( ino_t, ino )
368 __field( loff_t, pos )
369 __field( unsigned int, len )
370 __field( unsigned int, copied )
371 ),
372
373 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400374 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400375 __entry->ino = inode->i_ino;
376 __entry->pos = pos;
377 __entry->len = len;
378 __entry->copied = copied;
379 ),
380
Lukas Czernera9c667f2011-06-06 09:51:52 -0400381 TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400382 MAJOR(__entry->dev), MINOR(__entry->dev),
383 (unsigned long) __entry->ino,
384 __entry->pos, __entry->len, __entry->copied)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400385);
386
Theodore Ts'o74d553a2013-04-03 12:39:17 -0400387DEFINE_EVENT(ext4__write_end, ext4_write_end,
Li Zefanb5eb34c2009-11-26 15:07:36 +0800388
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400389 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
390 unsigned int copied),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400391
Li Zefanb5eb34c2009-11-26 15:07:36 +0800392 TP_ARGS(inode, pos, len, copied)
393);
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400394
Li Zefanb5eb34c2009-11-26 15:07:36 +0800395DEFINE_EVENT(ext4__write_end, ext4_journalled_write_end,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400396
Li Zefanb5eb34c2009-11-26 15:07:36 +0800397 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
398 unsigned int copied),
399
400 TP_ARGS(inode, pos, len, copied)
401);
402
403DEFINE_EVENT(ext4__write_end, ext4_da_write_end,
404
405 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
406 unsigned int copied),
407
408 TP_ARGS(inode, pos, len, copied)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400409);
410
Theodore Ts'o20970ba2013-06-06 14:00:46 -0400411TRACE_EVENT(ext4_writepages,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400412 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
413
414 TP_ARGS(inode, wbc),
415
416 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400417 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400418 __field( ino_t, ino )
419 __field( long, nr_to_write )
420 __field( long, pages_skipped )
421 __field( loff_t, range_start )
422 __field( loff_t, range_end )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400423 __field( pgoff_t, writeback_index )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400424 __field( int, sync_mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400425 __field( char, for_kupdate )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400426 __field( char, range_cyclic )
427 ),
428
429 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400430 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400431 __entry->ino = inode->i_ino;
432 __entry->nr_to_write = wbc->nr_to_write;
433 __entry->pages_skipped = wbc->pages_skipped;
434 __entry->range_start = wbc->range_start;
435 __entry->range_end = wbc->range_end;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400436 __entry->writeback_index = inode->i_mapping->writeback_index;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400437 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400438 __entry->for_kupdate = wbc->for_kupdate;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400439 __entry->range_cyclic = wbc->range_cyclic;
440 ),
441
Theodore Ts'oa107e5a2010-10-27 23:44:47 -0400442 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
Anatol Pomozov81370292012-08-17 09:52:17 -0400443 "range_start %lld range_end %lld sync_mode %d "
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400444 "for_kupdate %d range_cyclic %d writeback_index %lu",
445 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400446 (unsigned long) __entry->ino, __entry->nr_to_write,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400447 __entry->pages_skipped, __entry->range_start,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400448 __entry->range_end, __entry->sync_mode,
449 __entry->for_kupdate, __entry->range_cyclic,
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400450 (unsigned long) __entry->writeback_index)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400451);
452
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400453TRACE_EVENT(ext4_da_write_pages,
Jan Kara4e7ea812013-06-04 13:17:40 -0400454 TP_PROTO(struct inode *inode, pgoff_t first_page,
455 struct writeback_control *wbc),
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400456
Jan Kara4e7ea812013-06-04 13:17:40 -0400457 TP_ARGS(inode, first_page, wbc),
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400458
459 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400460 __field( dev_t, dev )
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400461 __field( ino_t, ino )
Jan Kara4e7ea812013-06-04 13:17:40 -0400462 __field( pgoff_t, first_page )
463 __field( long, nr_to_write )
464 __field( int, sync_mode )
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400465 ),
466
467 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400468 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400469 __entry->ino = inode->i_ino;
Jan Kara4e7ea812013-06-04 13:17:40 -0400470 __entry->first_page = first_page;
471 __entry->nr_to_write = wbc->nr_to_write;
472 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400473 ),
474
Jan Kara4e7ea812013-06-04 13:17:40 -0400475 TP_printk("dev %d,%d ino %lu first_page %lu nr_to_write %ld "
476 "sync_mode %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400477 MAJOR(__entry->dev), MINOR(__entry->dev),
Jan Kara4e7ea812013-06-04 13:17:40 -0400478 (unsigned long) __entry->ino, __entry->first_page,
479 __entry->nr_to_write, __entry->sync_mode)
480);
481
482TRACE_EVENT(ext4_da_write_pages_extent,
483 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map),
484
485 TP_ARGS(inode, map),
486
487 TP_STRUCT__entry(
488 __field( dev_t, dev )
489 __field( ino_t, ino )
490 __field( __u64, lblk )
491 __field( __u32, len )
492 __field( __u32, flags )
493 ),
494
495 TP_fast_assign(
496 __entry->dev = inode->i_sb->s_dev;
497 __entry->ino = inode->i_ino;
498 __entry->lblk = map->m_lblk;
499 __entry->len = map->m_len;
500 __entry->flags = map->m_flags;
501 ),
502
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400503 TP_printk("dev %d,%d ino %lu lblk %llu len %u flags %s",
Jan Kara4e7ea812013-06-04 13:17:40 -0400504 MAJOR(__entry->dev), MINOR(__entry->dev),
505 (unsigned long) __entry->ino, __entry->lblk, __entry->len,
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400506 show_mflags(__entry->flags))
Theodore Ts'ob3a3ca82009-08-31 23:13:11 -0400507);
508
Theodore Ts'o20970ba2013-06-06 14:00:46 -0400509TRACE_EVENT(ext4_writepages_result,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400510 TP_PROTO(struct inode *inode, struct writeback_control *wbc,
511 int ret, int pages_written),
512
513 TP_ARGS(inode, wbc, ret, pages_written),
514
515 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400516 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400517 __field( ino_t, ino )
518 __field( int, ret )
519 __field( int, pages_written )
520 __field( long, pages_skipped )
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400521 __field( pgoff_t, writeback_index )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400522 __field( int, sync_mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400523 ),
524
525 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400526 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400527 __entry->ino = inode->i_ino;
528 __entry->ret = ret;
529 __entry->pages_written = pages_written;
530 __entry->pages_skipped = wbc->pages_skipped;
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400531 __entry->writeback_index = inode->i_mapping->writeback_index;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400532 __entry->sync_mode = wbc->sync_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400533 ),
534
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400535 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
Wu Fengguangb7a24412010-07-21 22:19:51 -0600536 "sync_mode %d writeback_index %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400537 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400538 (unsigned long) __entry->ino, __entry->ret,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400539 __entry->pages_written, __entry->pages_skipped,
Wu Fengguangb7a24412010-07-21 22:19:51 -0600540 __entry->sync_mode,
Theodore Ts'o55138e0b2009-09-29 13:31:31 -0400541 (unsigned long) __entry->writeback_index)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400542);
543
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400544DECLARE_EVENT_CLASS(ext4__page_op,
545 TP_PROTO(struct page *page),
546
547 TP_ARGS(page),
548
549 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400550 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400551 __field( ino_t, ino )
552 __field( pgoff_t, index )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400553
554 ),
555
556 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400557 __entry->dev = page->mapping->host->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400558 __entry->ino = page->mapping->host->i_ino;
559 __entry->index = page->index;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400560 ),
561
562 TP_printk("dev %d,%d ino %lu page_index %lu",
563 MAJOR(__entry->dev), MINOR(__entry->dev),
564 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400565 (unsigned long) __entry->index)
566);
567
568DEFINE_EVENT(ext4__page_op, ext4_writepage,
569
570 TP_PROTO(struct page *page),
571
572 TP_ARGS(page)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400573);
574
575DEFINE_EVENT(ext4__page_op, ext4_readpage,
576
577 TP_PROTO(struct page *page),
578
579 TP_ARGS(page)
580);
581
582DEFINE_EVENT(ext4__page_op, ext4_releasepage,
583
584 TP_PROTO(struct page *page),
585
586 TP_ARGS(page)
587);
588
Jan Kara4520fb32012-12-25 13:28:54 -0500589DECLARE_EVENT_CLASS(ext4_invalidatepage_op,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400590 TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400591
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400592 TP_ARGS(page, offset, length),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400593
594 TP_STRUCT__entry(
Anatol Pomozov210c0522012-08-17 09:50:17 -0400595 __field( dev_t, dev )
596 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400597 __field( pgoff_t, index )
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400598 __field( unsigned int, offset )
599 __field( unsigned int, length )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400600 ),
601
602 TP_fast_assign(
Anatol Pomozov210c0522012-08-17 09:50:17 -0400603 __entry->dev = page->mapping->host->i_sb->s_dev;
604 __entry->ino = page->mapping->host->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400605 __entry->index = page->index;
606 __entry->offset = offset;
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400607 __entry->length = length;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400608 ),
609
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400610 TP_printk("dev %d,%d ino %lu page_index %lu offset %u length %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400611 MAJOR(__entry->dev), MINOR(__entry->dev),
612 (unsigned long) __entry->ino,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400613 (unsigned long) __entry->index,
614 __entry->offset, __entry->length)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400615);
616
Jan Kara4520fb32012-12-25 13:28:54 -0500617DEFINE_EVENT(ext4_invalidatepage_op, ext4_invalidatepage,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400618 TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
Jan Kara4520fb32012-12-25 13:28:54 -0500619
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400620 TP_ARGS(page, offset, length)
Jan Kara4520fb32012-12-25 13:28:54 -0500621);
622
623DEFINE_EVENT(ext4_invalidatepage_op, ext4_journalled_invalidatepage,
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400624 TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
Jan Kara4520fb32012-12-25 13:28:54 -0500625
Lukas Czernerca99fdd2013-05-21 23:25:01 -0400626 TP_ARGS(page, offset, length)
Jan Kara4520fb32012-12-25 13:28:54 -0500627);
628
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400629TRACE_EVENT(ext4_discard_blocks,
630 TP_PROTO(struct super_block *sb, unsigned long long blk,
631 unsigned long long count),
632
633 TP_ARGS(sb, blk, count),
634
635 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400636 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400637 __field( __u64, blk )
638 __field( __u64, count )
639
640 ),
641
642 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400643 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400644 __entry->blk = blk;
645 __entry->count = count;
646 ),
647
Theodore Ts'oa2690292010-10-27 22:08:50 -0400648 TP_printk("dev %d,%d blk %llu count %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400649 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400650 __entry->blk, __entry->count)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400651);
652
Li Zefanf084db92010-05-17 04:00:00 -0400653DECLARE_EVENT_CLASS(ext4__mb_new_pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400654 TP_PROTO(struct ext4_allocation_context *ac,
655 struct ext4_prealloc_space *pa),
656
657 TP_ARGS(ac, pa),
658
659 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400660 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400661 __field( ino_t, ino )
662 __field( __u64, pa_pstart )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400663 __field( __u64, pa_lstart )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400664 __field( __u32, pa_len )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400665
666 ),
667
668 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400669 __entry->dev = ac->ac_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400670 __entry->ino = ac->ac_inode->i_ino;
671 __entry->pa_pstart = pa->pa_pstart;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400672 __entry->pa_lstart = pa->pa_lstart;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400673 __entry->pa_len = pa->pa_len;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400674 ),
675
Theodore Ts'oa2690292010-10-27 22:08:50 -0400676 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400677 MAJOR(__entry->dev), MINOR(__entry->dev),
678 (unsigned long) __entry->ino,
679 __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400680);
681
Li Zefanf084db92010-05-17 04:00:00 -0400682DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa,
683
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400684 TP_PROTO(struct ext4_allocation_context *ac,
685 struct ext4_prealloc_space *pa),
686
Li Zefanf084db92010-05-17 04:00:00 -0400687 TP_ARGS(ac, pa)
688);
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400689
Li Zefanf084db92010-05-17 04:00:00 -0400690DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400691
Li Zefanf084db92010-05-17 04:00:00 -0400692 TP_PROTO(struct ext4_allocation_context *ac,
693 struct ext4_prealloc_space *pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400694
Li Zefanf084db92010-05-17 04:00:00 -0400695 TP_ARGS(ac, pa)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400696);
697
698TRACE_EVENT(ext4_mb_release_inode_pa,
Lukas Czernera9c667f2011-06-06 09:51:52 -0400699 TP_PROTO(struct ext4_prealloc_space *pa,
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400700 unsigned long long block, unsigned int count),
701
Lukas Czernera9c667f2011-06-06 09:51:52 -0400702 TP_ARGS(pa, block, count),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400703
704 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400705 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400706 __field( ino_t, ino )
707 __field( __u64, block )
708 __field( __u32, count )
709
710 ),
711
712 TP_fast_assign(
Lukas Czernera9c667f2011-06-06 09:51:52 -0400713 __entry->dev = pa->pa_inode->i_sb->s_dev;
714 __entry->ino = pa->pa_inode->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400715 __entry->block = block;
716 __entry->count = count;
717 ),
718
Theodore Ts'oa2690292010-10-27 22:08:50 -0400719 TP_printk("dev %d,%d ino %lu block %llu count %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400720 MAJOR(__entry->dev), MINOR(__entry->dev),
721 (unsigned long) __entry->ino,
722 __entry->block, __entry->count)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400723);
724
725TRACE_EVENT(ext4_mb_release_group_pa,
Yongqiang Yang60e07cf2011-12-18 15:49:54 -0500726 TP_PROTO(struct super_block *sb, struct ext4_prealloc_space *pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400727
Yongqiang Yang60e07cf2011-12-18 15:49:54 -0500728 TP_ARGS(sb, pa),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400729
730 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400731 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400732 __field( __u64, pa_pstart )
733 __field( __u32, pa_len )
734
735 ),
736
737 TP_fast_assign(
Yongqiang Yang60e07cf2011-12-18 15:49:54 -0500738 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400739 __entry->pa_pstart = pa->pa_pstart;
740 __entry->pa_len = pa->pa_len;
741 ),
742
Theodore Ts'oa2690292010-10-27 22:08:50 -0400743 TP_printk("dev %d,%d pstart %llu len %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400744 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400745 __entry->pa_pstart, __entry->pa_len)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400746);
747
748TRACE_EVENT(ext4_discard_preallocations,
749 TP_PROTO(struct inode *inode),
750
751 TP_ARGS(inode),
752
753 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400754 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400755 __field( ino_t, ino )
756
757 ),
758
759 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400760 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400761 __entry->ino = inode->i_ino;
762 ),
763
Theodore Ts'oa2690292010-10-27 22:08:50 -0400764 TP_printk("dev %d,%d ino %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400765 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400766 (unsigned long) __entry->ino)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400767);
768
769TRACE_EVENT(ext4_mb_discard_preallocations,
770 TP_PROTO(struct super_block *sb, int needed),
771
772 TP_ARGS(sb, needed),
773
774 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400775 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400776 __field( int, needed )
777
778 ),
779
780 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400781 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400782 __entry->needed = needed;
783 ),
784
Theodore Ts'oa2690292010-10-27 22:08:50 -0400785 TP_printk("dev %d,%d needed %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400786 MAJOR(__entry->dev), MINOR(__entry->dev),
787 __entry->needed)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400788);
789
790TRACE_EVENT(ext4_request_blocks,
791 TP_PROTO(struct ext4_allocation_request *ar),
792
793 TP_ARGS(ar),
794
795 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400796 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400797 __field( ino_t, ino )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400798 __field( unsigned int, len )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400799 __field( __u32, logical )
800 __field( __u32, lleft )
801 __field( __u32, lright )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400802 __field( __u64, goal )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400803 __field( __u64, pleft )
804 __field( __u64, pright )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400805 __field( unsigned int, flags )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400806 ),
807
808 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400809 __entry->dev = ar->inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400810 __entry->ino = ar->inode->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400811 __entry->len = ar->len;
812 __entry->logical = ar->logical;
813 __entry->goal = ar->goal;
814 __entry->lleft = ar->lleft;
815 __entry->lright = ar->lright;
816 __entry->pleft = ar->pleft;
817 __entry->pright = ar->pright;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400818 __entry->flags = ar->flags;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400819 ),
820
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400821 TP_printk("dev %d,%d ino %lu flags %s len %u lblk %u goal %llu "
Lukas Czernera9c667f2011-06-06 09:51:52 -0400822 "lleft %u lright %u pleft %llu pright %llu ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400823 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400824 (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags),
Lukas Czernera9c667f2011-06-06 09:51:52 -0400825 __entry->len, __entry->logical, __entry->goal,
826 __entry->lleft, __entry->lright, __entry->pleft,
827 __entry->pright)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400828);
829
830TRACE_EVENT(ext4_allocate_blocks,
831 TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block),
832
833 TP_ARGS(ar, block),
834
835 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400836 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400837 __field( ino_t, ino )
838 __field( __u64, block )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400839 __field( unsigned int, len )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400840 __field( __u32, logical )
841 __field( __u32, lleft )
842 __field( __u32, lright )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400843 __field( __u64, goal )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400844 __field( __u64, pleft )
845 __field( __u64, pright )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400846 __field( unsigned int, flags )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400847 ),
848
849 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400850 __entry->dev = ar->inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400851 __entry->ino = ar->inode->i_ino;
852 __entry->block = block;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400853 __entry->len = ar->len;
854 __entry->logical = ar->logical;
855 __entry->goal = ar->goal;
856 __entry->lleft = ar->lleft;
857 __entry->lright = ar->lright;
858 __entry->pleft = ar->pleft;
859 __entry->pright = ar->pright;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400860 __entry->flags = ar->flags;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400861 ),
862
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400863 TP_printk("dev %d,%d ino %lu flags %s len %u block %llu lblk %u "
Lukas Czernera9c667f2011-06-06 09:51:52 -0400864 "goal %llu lleft %u lright %u pleft %llu pright %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400865 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400866 (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags),
Lukas Czernera9c667f2011-06-06 09:51:52 -0400867 __entry->len, __entry->block, __entry->logical,
868 __entry->goal, __entry->lleft, __entry->lright,
869 __entry->pleft, __entry->pright)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400870);
871
872TRACE_EVENT(ext4_free_blocks,
873 TP_PROTO(struct inode *inode, __u64 block, unsigned long count,
Theodore Ts'oe6362602009-11-23 07:17:05 -0500874 int flags),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400875
Theodore Ts'oe6362602009-11-23 07:17:05 -0500876 TP_ARGS(inode, block, count, flags),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400877
878 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400879 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400880 __field( ino_t, ino )
881 __field( __u64, block )
882 __field( unsigned long, count )
Lukas Czernera9c667f2011-06-06 09:51:52 -0400883 __field( int, flags )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400884 __field( __u16, mode )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400885 ),
886
887 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400888 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400889 __entry->ino = inode->i_ino;
890 __entry->block = block;
891 __entry->count = count;
Theodore Ts'oe6362602009-11-23 07:17:05 -0500892 __entry->flags = flags;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400893 __entry->mode = inode->i_mode;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400894 ),
895
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400896 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %s",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400897 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400898 (unsigned long) __entry->ino,
Theodore Ts'oe6362602009-11-23 07:17:05 -0500899 __entry->mode, __entry->block, __entry->count,
Theodore Ts'o21ddd562013-07-01 08:12:40 -0400900 show_free_flags(__entry->flags))
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400901);
902
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400903TRACE_EVENT(ext4_sync_file_enter,
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200904 TP_PROTO(struct file *file, int datasync),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400905
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200906 TP_ARGS(file, datasync),
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400907
908 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400909 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400910 __field( ino_t, ino )
911 __field( ino_t, parent )
912 __field( int, datasync )
913 ),
914
915 TP_fast_assign(
Christoph Hellwig7ea80852010-05-26 17:53:25 +0200916 struct dentry *dentry = file->f_path.dentry;
917
Al Virofc640052016-04-10 01:33:30 -0400918 __entry->dev = dentry->d_sb->s_dev;
David Howells2b0143b2015-03-17 22:25:59 +0000919 __entry->ino = d_inode(dentry)->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400920 __entry->datasync = datasync;
David Howells2b0143b2015-03-17 22:25:59 +0000921 __entry->parent = d_inode(dentry->d_parent)->i_ino;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400922 ),
923
Lukas Czernera9c667f2011-06-06 09:51:52 -0400924 TP_printk("dev %d,%d ino %lu parent %lu datasync %d ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400925 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400926 (unsigned long) __entry->ino,
Theodore Ts'oa3710fd2009-09-17 08:50:18 -0400927 (unsigned long) __entry->parent, __entry->datasync)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400928);
929
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400930TRACE_EVENT(ext4_sync_file_exit,
931 TP_PROTO(struct inode *inode, int ret),
932
933 TP_ARGS(inode, ret),
934
935 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400936 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -0400937 __field( ino_t, ino )
938 __field( int, ret )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400939 ),
940
941 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400942 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -0400943 __entry->ino = inode->i_ino;
944 __entry->ret = ret;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400945 ),
946
Lukas Czernera9c667f2011-06-06 09:51:52 -0400947 TP_printk("dev %d,%d ino %lu ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400948 MAJOR(__entry->dev), MINOR(__entry->dev),
949 (unsigned long) __entry->ino,
950 __entry->ret)
951);
952
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400953TRACE_EVENT(ext4_sync_fs,
954 TP_PROTO(struct super_block *sb, int wait),
955
956 TP_ARGS(sb, wait),
957
958 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400959 __field( dev_t, dev )
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400960 __field( int, wait )
961
962 ),
963
964 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400965 __entry->dev = sb->s_dev;
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400966 __entry->wait = wait;
967 ),
968
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400969 TP_printk("dev %d,%d wait %d",
970 MAJOR(__entry->dev), MINOR(__entry->dev),
971 __entry->wait)
Theodore Ts'o9bffad12009-06-17 11:48:11 -0400972);
973
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400974TRACE_EVENT(ext4_alloc_da_blocks,
975 TP_PROTO(struct inode *inode),
976
977 TP_ARGS(inode),
978
979 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400980 __field( dev_t, dev )
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400981 __field( ino_t, ino )
Eric Whitneya627b0a2017-07-30 22:30:11 -0400982 __field( unsigned int, data_blocks )
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400983 ),
984
985 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400986 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400987 __entry->ino = inode->i_ino;
988 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400989 ),
990
Eric Whitneya627b0a2017-07-30 22:30:11 -0400991 TP_printk("dev %d,%d ino %lu reserved_data_blocks %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -0400992 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -0400993 (unsigned long) __entry->ino,
Eric Whitneya627b0a2017-07-30 22:30:11 -0400994 __entry->data_blocks)
Theodore Ts'ofb40ba02009-09-16 19:30:40 -0400995);
996
Theodore Ts'o296c3552009-09-30 00:32:42 -0400997TRACE_EVENT(ext4_mballoc_alloc,
998 TP_PROTO(struct ext4_allocation_context *ac),
999
1000 TP_ARGS(ac),
1001
1002 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001003 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001004 __field( ino_t, ino )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001005 __field( __u32, orig_logical )
1006 __field( int, orig_start )
1007 __field( __u32, orig_group )
1008 __field( int, orig_len )
1009 __field( __u32, goal_logical )
1010 __field( int, goal_start )
1011 __field( __u32, goal_group )
1012 __field( int, goal_len )
1013 __field( __u32, result_logical )
1014 __field( int, result_start )
1015 __field( __u32, result_group )
1016 __field( int, result_len )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001017 __field( __u16, found )
1018 __field( __u16, groups )
1019 __field( __u16, buddy )
1020 __field( __u16, flags )
1021 __field( __u16, tail )
1022 __field( __u8, cr )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001023 ),
1024
1025 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001026 __entry->dev = ac->ac_inode->i_sb->s_dev;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001027 __entry->ino = ac->ac_inode->i_ino;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001028 __entry->orig_logical = ac->ac_o_ex.fe_logical;
1029 __entry->orig_start = ac->ac_o_ex.fe_start;
1030 __entry->orig_group = ac->ac_o_ex.fe_group;
1031 __entry->orig_len = ac->ac_o_ex.fe_len;
1032 __entry->goal_logical = ac->ac_g_ex.fe_logical;
1033 __entry->goal_start = ac->ac_g_ex.fe_start;
1034 __entry->goal_group = ac->ac_g_ex.fe_group;
1035 __entry->goal_len = ac->ac_g_ex.fe_len;
1036 __entry->result_logical = ac->ac_f_ex.fe_logical;
1037 __entry->result_start = ac->ac_f_ex.fe_start;
1038 __entry->result_group = ac->ac_f_ex.fe_group;
1039 __entry->result_len = ac->ac_f_ex.fe_len;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001040 __entry->found = ac->ac_found;
1041 __entry->flags = ac->ac_flags;
1042 __entry->groups = ac->ac_groups_scanned;
1043 __entry->buddy = ac->ac_buddy;
1044 __entry->tail = ac->ac_tail;
1045 __entry->cr = ac->ac_criteria;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001046 ),
1047
Theodore Ts'oa2690292010-10-27 22:08:50 -04001048 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 -04001049 "result %u/%d/%u@%u blks %u grps %u cr %u flags %s "
Theodore Ts'o296c3552009-09-30 00:32:42 -04001050 "tail %u broken %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001051 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001052 (unsigned long) __entry->ino,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001053 __entry->orig_group, __entry->orig_start,
1054 __entry->orig_len, __entry->orig_logical,
1055 __entry->goal_group, __entry->goal_start,
1056 __entry->goal_len, __entry->goal_logical,
1057 __entry->result_group, __entry->result_start,
1058 __entry->result_len, __entry->result_logical,
1059 __entry->found, __entry->groups, __entry->cr,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001060 show_mballoc_flags(__entry->flags), __entry->tail,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001061 __entry->buddy ? 1 << __entry->buddy : 0)
1062);
1063
1064TRACE_EVENT(ext4_mballoc_prealloc,
1065 TP_PROTO(struct ext4_allocation_context *ac),
1066
1067 TP_ARGS(ac),
1068
1069 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001070 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001071 __field( ino_t, ino )
1072 __field( __u32, orig_logical )
1073 __field( int, orig_start )
1074 __field( __u32, orig_group )
1075 __field( int, orig_len )
1076 __field( __u32, result_logical )
1077 __field( int, result_start )
1078 __field( __u32, result_group )
1079 __field( int, result_len )
1080 ),
1081
1082 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001083 __entry->dev = ac->ac_inode->i_sb->s_dev;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001084 __entry->ino = ac->ac_inode->i_ino;
1085 __entry->orig_logical = ac->ac_o_ex.fe_logical;
1086 __entry->orig_start = ac->ac_o_ex.fe_start;
1087 __entry->orig_group = ac->ac_o_ex.fe_group;
1088 __entry->orig_len = ac->ac_o_ex.fe_len;
1089 __entry->result_logical = ac->ac_b_ex.fe_logical;
1090 __entry->result_start = ac->ac_b_ex.fe_start;
1091 __entry->result_group = ac->ac_b_ex.fe_group;
1092 __entry->result_len = ac->ac_b_ex.fe_len;
1093 ),
1094
Theodore Ts'oa2690292010-10-27 22:08:50 -04001095 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001096 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001097 (unsigned long) __entry->ino,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001098 __entry->orig_group, __entry->orig_start,
1099 __entry->orig_len, __entry->orig_logical,
1100 __entry->result_group, __entry->result_start,
1101 __entry->result_len, __entry->result_logical)
1102);
1103
Li Zefanf084db92010-05-17 04:00:00 -04001104DECLARE_EVENT_CLASS(ext4__mballoc,
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001105 TP_PROTO(struct super_block *sb,
1106 struct inode *inode,
1107 ext4_group_t group,
1108 ext4_grpblk_t start,
1109 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001110
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001111 TP_ARGS(sb, inode, group, start, len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001112
1113 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001114 __field( dev_t, dev )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001115 __field( ino_t, ino )
Theodore Ts'o296c3552009-09-30 00:32:42 -04001116 __field( int, result_start )
1117 __field( __u32, result_group )
1118 __field( int, result_len )
1119 ),
1120
1121 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001122 __entry->dev = sb->s_dev;
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001123 __entry->ino = inode ? inode->i_ino : 0;
1124 __entry->result_start = start;
1125 __entry->result_group = group;
1126 __entry->result_len = len;
Theodore Ts'o296c3552009-09-30 00:32:42 -04001127 ),
1128
Lukas Czernera9c667f2011-06-06 09:51:52 -04001129 TP_printk("dev %d,%d inode %lu extent %u/%d/%d ",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001130 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001131 (unsigned long) __entry->ino,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001132 __entry->result_group, __entry->result_start,
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001133 __entry->result_len)
Theodore Ts'o296c3552009-09-30 00:32:42 -04001134);
1135
Li Zefanf084db92010-05-17 04:00:00 -04001136DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard,
1137
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001138 TP_PROTO(struct super_block *sb,
1139 struct inode *inode,
1140 ext4_group_t group,
1141 ext4_grpblk_t start,
1142 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001143
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001144 TP_ARGS(sb, inode, group, start, len)
Li Zefanf084db92010-05-17 04:00:00 -04001145);
Theodore Ts'o296c3552009-09-30 00:32:42 -04001146
Li Zefanf084db92010-05-17 04:00:00 -04001147DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free,
Theodore Ts'o296c3552009-09-30 00:32:42 -04001148
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001149 TP_PROTO(struct super_block *sb,
1150 struct inode *inode,
1151 ext4_group_t group,
1152 ext4_grpblk_t start,
1153 ext4_grpblk_t len),
Theodore Ts'o296c3552009-09-30 00:32:42 -04001154
Eric Sandeen3e1e5f52010-10-27 21:30:07 -04001155 TP_ARGS(sb, inode, group, start, len)
Theodore Ts'o296c3552009-09-30 00:32:42 -04001156);
1157
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001158TRACE_EVENT(ext4_forget,
1159 TP_PROTO(struct inode *inode, int is_metadata, __u64 block),
1160
1161 TP_ARGS(inode, is_metadata, block),
1162
1163 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001164 __field( dev_t, dev )
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001165 __field( ino_t, ino )
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001166 __field( __u64, block )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001167 __field( int, is_metadata )
1168 __field( __u16, mode )
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001169 ),
1170
1171 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001172 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001173 __entry->ino = inode->i_ino;
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001174 __entry->block = block;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001175 __entry->is_metadata = is_metadata;
1176 __entry->mode = inode->i_mode;
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001177 ),
1178
Theodore Ts'oa2690292010-10-27 22:08:50 -04001179 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001180 MAJOR(__entry->dev), MINOR(__entry->dev),
1181 (unsigned long) __entry->ino,
1182 __entry->mode, __entry->is_metadata, __entry->block)
Theodore Ts'obeac2da2009-11-23 07:25:08 -05001183);
1184
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001185TRACE_EVENT(ext4_da_update_reserve_space,
Aditya Kalid8990242011-09-09 19:18:51 -04001186 TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001187
Aditya Kalid8990242011-09-09 19:18:51 -04001188 TP_ARGS(inode, used_blocks, quota_claim),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001189
1190 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001191 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001192 __field( ino_t, ino )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001193 __field( __u64, i_blocks )
1194 __field( int, used_blocks )
1195 __field( int, reserved_data_blocks )
Aditya Kalid8990242011-09-09 19:18:51 -04001196 __field( int, quota_claim )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001197 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001198 ),
1199
1200 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001201 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001202 __entry->ino = inode->i_ino;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001203 __entry->i_blocks = inode->i_blocks;
1204 __entry->used_blocks = used_blocks;
Aditya Kalid8990242011-09-09 19:18:51 -04001205 __entry->reserved_data_blocks =
1206 EXT4_I(inode)->i_reserved_data_blocks;
Aditya Kalid8990242011-09-09 19:18:51 -04001207 __entry->quota_claim = quota_claim;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001208 __entry->mode = inode->i_mode;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001209 ),
1210
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001211 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
Eric Whitneya627b0a2017-07-30 22:30:11 -04001212 "reserved_data_blocks %d quota_claim %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001213 MAJOR(__entry->dev), MINOR(__entry->dev),
1214 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001215 __entry->mode, __entry->i_blocks,
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001216 __entry->used_blocks, __entry->reserved_data_blocks,
Aditya Kalid8990242011-09-09 19:18:51 -04001217 __entry->quota_claim)
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001218);
1219
1220TRACE_EVENT(ext4_da_reserve_space,
Eric Whitneyc27e43a2015-06-21 21:37:05 -04001221 TP_PROTO(struct inode *inode),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001222
Eric Whitneyc27e43a2015-06-21 21:37:05 -04001223 TP_ARGS(inode),
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001224
1225 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001226 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001227 __field( ino_t, ino )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001228 __field( __u64, i_blocks )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001229 __field( int, reserved_data_blocks )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001230 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001231 ),
1232
1233 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001234 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001235 __entry->ino = inode->i_ino;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001236 __entry->i_blocks = inode->i_blocks;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001237 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001238 __entry->mode = inode->i_mode;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001239 ),
1240
Eric Whitneyc27e43a2015-06-21 21:37:05 -04001241 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu "
Eric Whitneya627b0a2017-07-30 22:30:11 -04001242 "reserved_data_blocks %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001243 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001244 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001245 __entry->mode, __entry->i_blocks,
Eric Whitneya627b0a2017-07-30 22:30:11 -04001246 __entry->reserved_data_blocks)
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001247);
1248
1249TRACE_EVENT(ext4_da_release_space,
1250 TP_PROTO(struct inode *inode, int freed_blocks),
1251
1252 TP_ARGS(inode, freed_blocks),
1253
1254 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001255 __field( dev_t, dev )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001256 __field( ino_t, ino )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001257 __field( __u64, i_blocks )
1258 __field( int, freed_blocks )
1259 __field( int, reserved_data_blocks )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001260 __field( __u16, mode )
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001261 ),
1262
1263 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001264 __entry->dev = inode->i_sb->s_dev;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001265 __entry->ino = inode->i_ino;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001266 __entry->i_blocks = inode->i_blocks;
1267 __entry->freed_blocks = freed_blocks;
1268 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001269 __entry->mode = inode->i_mode;
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001270 ),
1271
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001272 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
Eric Whitneya627b0a2017-07-30 22:30:11 -04001273 "reserved_data_blocks %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001274 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'oa2690292010-10-27 22:08:50 -04001275 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001276 __entry->mode, __entry->i_blocks,
Eric Whitneya627b0a2017-07-30 22:30:11 -04001277 __entry->freed_blocks, __entry->reserved_data_blocks)
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001278);
1279
Theodore Ts'of3073332010-05-17 03:00:00 -04001280DECLARE_EVENT_CLASS(ext4__bitmap_load,
1281 TP_PROTO(struct super_block *sb, unsigned long group),
1282
1283 TP_ARGS(sb, group),
1284
1285 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001286 __field( dev_t, dev )
Theodore Ts'of3073332010-05-17 03:00:00 -04001287 __field( __u32, group )
1288
1289 ),
1290
1291 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001292 __entry->dev = sb->s_dev;
Theodore Ts'of3073332010-05-17 03:00:00 -04001293 __entry->group = group;
1294 ),
1295
Theodore Ts'oa2690292010-10-27 22:08:50 -04001296 TP_printk("dev %d,%d group %u",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001297 MAJOR(__entry->dev), MINOR(__entry->dev),
1298 __entry->group)
Theodore Ts'of3073332010-05-17 03:00:00 -04001299);
1300
1301DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
1302
1303 TP_PROTO(struct super_block *sb, unsigned long group),
1304
1305 TP_ARGS(sb, group)
1306);
1307
1308DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
1309
1310 TP_PROTO(struct super_block *sb, unsigned long group),
1311
1312 TP_ARGS(sb, group)
1313);
Theodore Ts'of8ec9d62010-01-01 01:00:21 -05001314
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001315DEFINE_EVENT(ext4__bitmap_load, ext4_read_block_bitmap_load,
1316
1317 TP_PROTO(struct super_block *sb, unsigned long group),
1318
1319 TP_ARGS(sb, group)
1320);
1321
1322DEFINE_EVENT(ext4__bitmap_load, ext4_load_inode_bitmap,
1323
1324 TP_PROTO(struct super_block *sb, unsigned long group),
1325
1326 TP_ARGS(sb, group)
1327);
1328
1329TRACE_EVENT(ext4_direct_IO_enter,
1330 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
1331
1332 TP_ARGS(inode, offset, len, rw),
1333
1334 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001335 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001336 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001337 __field( loff_t, pos )
1338 __field( unsigned long, len )
1339 __field( int, rw )
1340 ),
1341
1342 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001343 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001344 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001345 __entry->pos = offset;
1346 __entry->len = len;
1347 __entry->rw = rw;
1348 ),
1349
Lukas Czernera9c667f2011-06-06 09:51:52 -04001350 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001351 MAJOR(__entry->dev), MINOR(__entry->dev),
1352 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001353 __entry->pos, __entry->len, __entry->rw)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001354);
1355
1356TRACE_EVENT(ext4_direct_IO_exit,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001357 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
1358 int rw, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001359
1360 TP_ARGS(inode, offset, len, rw, ret),
1361
1362 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001363 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001364 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001365 __field( loff_t, pos )
1366 __field( unsigned long, len )
1367 __field( int, rw )
1368 __field( int, ret )
1369 ),
1370
1371 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001372 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001373 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001374 __entry->pos = offset;
1375 __entry->len = len;
1376 __entry->rw = rw;
1377 __entry->ret = ret;
1378 ),
1379
Lukas Czernera9c667f2011-06-06 09:51:52 -04001380 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001381 MAJOR(__entry->dev), MINOR(__entry->dev),
1382 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001383 __entry->pos, __entry->len,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001384 __entry->rw, __entry->ret)
1385);
1386
Lukas Czernerb8a86842014-03-18 18:05:35 -04001387DECLARE_EVENT_CLASS(ext4__fallocate_mode,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001388 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1389
1390 TP_ARGS(inode, offset, len, mode),
1391
1392 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001393 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001394 __field( ino_t, ino )
Lukas Czernerb8a86842014-03-18 18:05:35 -04001395 __field( loff_t, offset )
1396 __field( loff_t, len )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001397 __field( int, mode )
1398 ),
1399
1400 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001401 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001402 __entry->ino = inode->i_ino;
Lukas Czernerb8a86842014-03-18 18:05:35 -04001403 __entry->offset = offset;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001404 __entry->len = len;
1405 __entry->mode = mode;
1406 ),
1407
Lukas Czernerb8a86842014-03-18 18:05:35 -04001408 TP_printk("dev %d,%d ino %lu offset %lld len %lld mode %s",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001409 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernerb8a86842014-03-18 18:05:35 -04001410 (unsigned long) __entry->ino,
1411 __entry->offset, __entry->len,
1412 show_falloc_mode(__entry->mode))
1413);
1414
1415DEFINE_EVENT(ext4__fallocate_mode, ext4_fallocate_enter,
1416
1417 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1418
1419 TP_ARGS(inode, offset, len, mode)
1420);
1421
1422DEFINE_EVENT(ext4__fallocate_mode, ext4_punch_hole,
1423
1424 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1425
1426 TP_ARGS(inode, offset, len, mode)
1427);
1428
1429DEFINE_EVENT(ext4__fallocate_mode, ext4_zero_range,
1430
1431 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1432
1433 TP_ARGS(inode, offset, len, mode)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001434);
1435
1436TRACE_EVENT(ext4_fallocate_exit,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001437 TP_PROTO(struct inode *inode, loff_t offset,
1438 unsigned int max_blocks, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001439
1440 TP_ARGS(inode, offset, max_blocks, ret),
1441
1442 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001443 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001444 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001445 __field( loff_t, pos )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001446 __field( unsigned int, blocks )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001447 __field( int, ret )
1448 ),
1449
1450 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001451 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001452 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001453 __entry->pos = offset;
1454 __entry->blocks = max_blocks;
1455 __entry->ret = ret;
1456 ),
1457
Lukas Czernera9c667f2011-06-06 09:51:52 -04001458 TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001459 MAJOR(__entry->dev), MINOR(__entry->dev),
1460 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001461 __entry->pos, __entry->blocks,
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001462 __entry->ret)
1463);
1464
1465TRACE_EVENT(ext4_unlink_enter,
1466 TP_PROTO(struct inode *parent, struct dentry *dentry),
1467
1468 TP_ARGS(parent, dentry),
1469
1470 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001471 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001472 __field( ino_t, ino )
1473 __field( ino_t, parent )
1474 __field( loff_t, size )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001475 ),
1476
1477 TP_fast_assign(
Al Virofc640052016-04-10 01:33:30 -04001478 __entry->dev = dentry->d_sb->s_dev;
David Howells2b0143b2015-03-17 22:25:59 +00001479 __entry->ino = d_inode(dentry)->i_ino;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001480 __entry->parent = parent->i_ino;
David Howells2b0143b2015-03-17 22:25:59 +00001481 __entry->size = d_inode(dentry)->i_size;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001482 ),
1483
Lukas Czernera9c667f2011-06-06 09:51:52 -04001484 TP_printk("dev %d,%d ino %lu size %lld parent %lu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001485 MAJOR(__entry->dev), MINOR(__entry->dev),
1486 (unsigned long) __entry->ino, __entry->size,
1487 (unsigned long) __entry->parent)
1488);
1489
1490TRACE_EVENT(ext4_unlink_exit,
1491 TP_PROTO(struct dentry *dentry, int ret),
1492
1493 TP_ARGS(dentry, ret),
1494
1495 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001496 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001497 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001498 __field( int, ret )
1499 ),
1500
1501 TP_fast_assign(
Al Virofc640052016-04-10 01:33:30 -04001502 __entry->dev = dentry->d_sb->s_dev;
David Howells2b0143b2015-03-17 22:25:59 +00001503 __entry->ino = d_inode(dentry)->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001504 __entry->ret = ret;
1505 ),
1506
Lukas Czernera9c667f2011-06-06 09:51:52 -04001507 TP_printk("dev %d,%d ino %lu ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001508 MAJOR(__entry->dev), MINOR(__entry->dev),
1509 (unsigned long) __entry->ino,
1510 __entry->ret)
1511);
1512
1513DECLARE_EVENT_CLASS(ext4__truncate,
1514 TP_PROTO(struct inode *inode),
1515
1516 TP_ARGS(inode),
1517
1518 TP_STRUCT__entry(
Anatol Pomozov210c0522012-08-17 09:50:17 -04001519 __field( dev_t, dev )
1520 __field( ino_t, ino )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001521 __field( __u64, blocks )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001522 ),
1523
1524 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001525 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001526 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001527 __entry->blocks = inode->i_blocks;
1528 ),
1529
Lukas Czernera9c667f2011-06-06 09:51:52 -04001530 TP_printk("dev %d,%d ino %lu blocks %llu",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001531 MAJOR(__entry->dev), MINOR(__entry->dev),
Lukas Czernera9c667f2011-06-06 09:51:52 -04001532 (unsigned long) __entry->ino, __entry->blocks)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001533);
1534
1535DEFINE_EVENT(ext4__truncate, ext4_truncate_enter,
1536
1537 TP_PROTO(struct inode *inode),
1538
1539 TP_ARGS(inode)
1540);
1541
1542DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
1543
1544 TP_PROTO(struct inode *inode),
1545
1546 TP_ARGS(inode)
1547);
1548
Lukas Czerner556615d2014-04-20 23:45:47 -04001549/* 'ux' is the unwritten extent. */
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001550TRACE_EVENT(ext4_ext_convert_to_initialized_enter,
1551 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1552 struct ext4_extent *ux),
1553
1554 TP_ARGS(inode, map, ux),
1555
1556 TP_STRUCT__entry(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001557 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001558 __field( ino_t, ino )
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001559 __field( ext4_lblk_t, m_lblk )
1560 __field( unsigned, m_len )
1561 __field( ext4_lblk_t, u_lblk )
1562 __field( unsigned, u_len )
1563 __field( ext4_fsblk_t, u_pblk )
1564 ),
1565
1566 TP_fast_assign(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001567 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001568 __entry->ino = inode->i_ino;
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001569 __entry->m_lblk = map->m_lblk;
1570 __entry->m_len = map->m_len;
1571 __entry->u_lblk = le32_to_cpu(ux->ee_block);
1572 __entry->u_len = ext4_ext_get_actual_len(ux);
1573 __entry->u_pblk = ext4_ext_pblock(ux);
1574 ),
1575
1576 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u u_lblk %u u_len %u "
1577 "u_pblk %llu",
1578 MAJOR(__entry->dev), MINOR(__entry->dev),
1579 (unsigned long) __entry->ino,
1580 __entry->m_lblk, __entry->m_len,
1581 __entry->u_lblk, __entry->u_len, __entry->u_pblk)
1582);
1583
1584/*
Lukas Czerner556615d2014-04-20 23:45:47 -04001585 * 'ux' is the unwritten extent.
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001586 * 'ix' is the initialized extent to which blocks are transferred.
1587 */
1588TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath,
1589 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1590 struct ext4_extent *ux, struct ext4_extent *ix),
1591
1592 TP_ARGS(inode, map, ux, ix),
1593
1594 TP_STRUCT__entry(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001595 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001596 __field( ino_t, ino )
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001597 __field( ext4_lblk_t, m_lblk )
1598 __field( unsigned, m_len )
1599 __field( ext4_lblk_t, u_lblk )
1600 __field( unsigned, u_len )
1601 __field( ext4_fsblk_t, u_pblk )
1602 __field( ext4_lblk_t, i_lblk )
1603 __field( unsigned, i_len )
1604 __field( ext4_fsblk_t, i_pblk )
1605 ),
1606
1607 TP_fast_assign(
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001608 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001609 __entry->ino = inode->i_ino;
Eric Gouriou6f91bc52011-10-27 11:43:23 -04001610 __entry->m_lblk = map->m_lblk;
1611 __entry->m_len = map->m_len;
1612 __entry->u_lblk = le32_to_cpu(ux->ee_block);
1613 __entry->u_len = ext4_ext_get_actual_len(ux);
1614 __entry->u_pblk = ext4_ext_pblock(ux);
1615 __entry->i_lblk = le32_to_cpu(ix->ee_block);
1616 __entry->i_len = ext4_ext_get_actual_len(ix);
1617 __entry->i_pblk = ext4_ext_pblock(ix);
1618 ),
1619
1620 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u "
1621 "u_lblk %u u_len %u u_pblk %llu "
1622 "i_lblk %u i_len %u i_pblk %llu ",
1623 MAJOR(__entry->dev), MINOR(__entry->dev),
1624 (unsigned long) __entry->ino,
1625 __entry->m_lblk, __entry->m_len,
1626 __entry->u_lblk, __entry->u_len, __entry->u_pblk,
1627 __entry->i_lblk, __entry->i_len, __entry->i_pblk)
1628);
1629
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001630DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1631 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001632 unsigned int len, unsigned int flags),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001633
1634 TP_ARGS(inode, lblk, len, flags),
1635
1636 TP_STRUCT__entry(
Anatol Pomozov210c0522012-08-17 09:50:17 -04001637 __field( dev_t, dev )
1638 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001639 __field( ext4_lblk_t, lblk )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001640 __field( unsigned int, len )
1641 __field( unsigned int, flags )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001642 ),
1643
1644 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001645 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001646 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001647 __entry->lblk = lblk;
1648 __entry->len = len;
1649 __entry->flags = flags;
1650 ),
1651
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001652 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %s",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001653 MAJOR(__entry->dev), MINOR(__entry->dev),
1654 (unsigned long) __entry->ino,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001655 __entry->lblk, __entry->len, show_map_flags(__entry->flags))
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001656);
1657
1658DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter,
1659 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1660 unsigned len, unsigned flags),
1661
1662 TP_ARGS(inode, lblk, len, flags)
1663);
1664
1665DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter,
1666 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1667 unsigned len, unsigned flags),
1668
1669 TP_ARGS(inode, lblk, len, flags)
1670);
1671
1672DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001673 TP_PROTO(struct inode *inode, unsigned flags, struct ext4_map_blocks *map,
1674 int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001675
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001676 TP_ARGS(inode, flags, map, ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001677
1678 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001679 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001680 __field( ino_t, ino )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001681 __field( unsigned int, flags )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001682 __field( ext4_fsblk_t, pblk )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001683 __field( ext4_lblk_t, lblk )
Lukas Czernera9c667f2011-06-06 09:51:52 -04001684 __field( unsigned int, len )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001685 __field( unsigned int, mflags )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001686 __field( int, ret )
1687 ),
1688
1689 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001690 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001691 __entry->ino = inode->i_ino;
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001692 __entry->flags = flags;
Zheng Liu19b303d2012-11-08 14:34:04 -05001693 __entry->pblk = map->m_pblk;
1694 __entry->lblk = map->m_lblk;
1695 __entry->len = map->m_len;
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001696 __entry->mflags = map->m_flags;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001697 __entry->ret = ret;
1698 ),
1699
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001700 TP_printk("dev %d,%d ino %lu flags %s lblk %u pblk %llu len %u "
1701 "mflags %s ret %d",
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001702 MAJOR(__entry->dev), MINOR(__entry->dev),
1703 (unsigned long) __entry->ino,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001704 show_map_flags(__entry->flags), __entry->lblk, __entry->pblk,
1705 __entry->len, show_mflags(__entry->mflags), __entry->ret)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001706);
1707
1708DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001709 TP_PROTO(struct inode *inode, unsigned flags,
1710 struct ext4_map_blocks *map, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001711
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001712 TP_ARGS(inode, flags, map, ret)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001713);
1714
1715DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001716 TP_PROTO(struct inode *inode, unsigned flags,
1717 struct ext4_map_blocks *map, int ret),
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001718
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001719 TP_ARGS(inode, flags, map, ret)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001720);
1721
1722TRACE_EVENT(ext4_ext_load_extent,
1723 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk),
1724
1725 TP_ARGS(inode, lblk, pblk),
1726
1727 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001728 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001729 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001730 __field( ext4_fsblk_t, pblk )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001731 __field( ext4_lblk_t, lblk )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001732 ),
1733
1734 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001735 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001736 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001737 __entry->pblk = pblk;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001738 __entry->lblk = lblk;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001739 ),
1740
1741 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1742 MAJOR(__entry->dev), MINOR(__entry->dev),
1743 (unsigned long) __entry->ino,
Lukas Czernera9c667f2011-06-06 09:51:52 -04001744 __entry->lblk, __entry->pblk)
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001745);
1746
1747TRACE_EVENT(ext4_load_inode,
1748 TP_PROTO(struct inode *inode),
1749
1750 TP_ARGS(inode),
1751
1752 TP_STRUCT__entry(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001753 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001754 __field( ino_t, ino )
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001755 ),
1756
1757 TP_fast_assign(
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001758 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001759 __entry->ino = inode->i_ino;
Jiaying Zhang0562e0b2011-03-21 21:38:05 -04001760 ),
1761
1762 TP_printk("dev %d,%d ino %ld",
1763 MAJOR(__entry->dev), MINOR(__entry->dev),
1764 (unsigned long) __entry->ino)
1765);
1766
Theodore Ts'o12706392011-07-10 22:37:50 -04001767TRACE_EVENT(ext4_journal_start,
Jan Kara5fe2fe82013-06-04 12:37:50 -04001768 TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks,
Jan Kara83448bd2019-11-05 17:44:29 +01001769 int revoke_creds, unsigned long IP),
Theodore Ts'o12706392011-07-10 22:37:50 -04001770
Jan Kara83448bd2019-11-05 17:44:29 +01001771 TP_ARGS(sb, blocks, rsv_blocks, revoke_creds, IP),
Theodore Ts'o12706392011-07-10 22:37:50 -04001772
1773 TP_STRUCT__entry(
1774 __field( dev_t, dev )
Theodore Ts'o12706392011-07-10 22:37:50 -04001775 __field(unsigned long, ip )
Jan Kara5fe2fe82013-06-04 12:37:50 -04001776 __field( int, blocks )
1777 __field( int, rsv_blocks )
Jan Kara83448bd2019-11-05 17:44:29 +01001778 __field( int, revoke_creds )
Theodore Ts'o12706392011-07-10 22:37:50 -04001779 ),
1780
1781 TP_fast_assign(
Jan Kara5fe2fe82013-06-04 12:37:50 -04001782 __entry->dev = sb->s_dev;
1783 __entry->ip = IP;
1784 __entry->blocks = blocks;
1785 __entry->rsv_blocks = rsv_blocks;
Jan Kara83448bd2019-11-05 17:44:29 +01001786 __entry->revoke_creds = revoke_creds;
Theodore Ts'o12706392011-07-10 22:37:50 -04001787 ),
1788
Jan Kara83448bd2019-11-05 17:44:29 +01001789 TP_printk("dev %d,%d blocks %d, rsv_blocks %d, revoke_creds %d, "
1790 "caller %pS", MAJOR(__entry->dev), MINOR(__entry->dev),
1791 __entry->blocks, __entry->rsv_blocks, __entry->revoke_creds,
1792 (void *)__entry->ip)
Jan Kara5fe2fe82013-06-04 12:37:50 -04001793);
1794
1795TRACE_EVENT(ext4_journal_start_reserved,
1796 TP_PROTO(struct super_block *sb, int blocks, unsigned long IP),
1797
1798 TP_ARGS(sb, blocks, IP),
1799
1800 TP_STRUCT__entry(
1801 __field( dev_t, dev )
1802 __field(unsigned long, ip )
1803 __field( int, blocks )
1804 ),
1805
1806 TP_fast_assign(
1807 __entry->dev = sb->s_dev;
1808 __entry->ip = IP;
1809 __entry->blocks = blocks;
1810 ),
1811
Scott Woodbbedb172015-03-11 22:13:57 -05001812 TP_printk("dev %d,%d blocks, %d caller %pS",
Jan Kara5fe2fe82013-06-04 12:37:50 -04001813 MAJOR(__entry->dev), MINOR(__entry->dev),
1814 __entry->blocks, (void *)__entry->ip)
Theodore Ts'o12706392011-07-10 22:37:50 -04001815);
1816
Tao Mab3d4c2b2011-07-11 00:01:52 -04001817DECLARE_EVENT_CLASS(ext4__trim,
1818 TP_PROTO(struct super_block *sb,
1819 ext4_group_t group,
1820 ext4_grpblk_t start,
1821 ext4_grpblk_t len),
1822
1823 TP_ARGS(sb, group, start, len),
1824
1825 TP_STRUCT__entry(
1826 __field( int, dev_major )
1827 __field( int, dev_minor )
1828 __field( __u32, group )
1829 __field( int, start )
1830 __field( int, len )
1831 ),
1832
1833 TP_fast_assign(
1834 __entry->dev_major = MAJOR(sb->s_dev);
1835 __entry->dev_minor = MINOR(sb->s_dev);
1836 __entry->group = group;
1837 __entry->start = start;
1838 __entry->len = len;
1839 ),
1840
1841 TP_printk("dev %d,%d group %u, start %d, len %d",
1842 __entry->dev_major, __entry->dev_minor,
1843 __entry->group, __entry->start, __entry->len)
1844);
1845
1846DEFINE_EVENT(ext4__trim, ext4_trim_extent,
1847
1848 TP_PROTO(struct super_block *sb,
1849 ext4_group_t group,
1850 ext4_grpblk_t start,
1851 ext4_grpblk_t len),
1852
1853 TP_ARGS(sb, group, start, len)
1854);
1855
1856DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
1857
1858 TP_PROTO(struct super_block *sb,
1859 ext4_group_t group,
1860 ext4_grpblk_t start,
1861 ext4_grpblk_t len),
1862
1863 TP_ARGS(sb, group, start, len)
1864);
1865
Lukas Czerner556615d2014-04-20 23:45:47 -04001866TRACE_EVENT(ext4_ext_handle_unwritten_extents,
Zheng Liub5645532012-11-08 14:33:43 -05001867 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int flags,
Aditya Kalid8990242011-09-09 19:18:51 -04001868 unsigned int allocated, ext4_fsblk_t newblock),
1869
Zheng Liub5645532012-11-08 14:33:43 -05001870 TP_ARGS(inode, map, flags, allocated, newblock),
Aditya Kalid8990242011-09-09 19:18:51 -04001871
1872 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001873 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001874 __field( ino_t, ino )
1875 __field( int, flags )
Aditya Kalid8990242011-09-09 19:18:51 -04001876 __field( ext4_lblk_t, lblk )
1877 __field( ext4_fsblk_t, pblk )
1878 __field( unsigned int, len )
Aditya Kalid8990242011-09-09 19:18:51 -04001879 __field( unsigned int, allocated )
1880 __field( ext4_fsblk_t, newblk )
1881 ),
1882
1883 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001884 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001885 __entry->ino = inode->i_ino;
Zheng Liub5645532012-11-08 14:33:43 -05001886 __entry->flags = flags;
Aditya Kalid8990242011-09-09 19:18:51 -04001887 __entry->lblk = map->m_lblk;
1888 __entry->pblk = map->m_pblk;
1889 __entry->len = map->m_len;
Aditya Kalid8990242011-09-09 19:18:51 -04001890 __entry->allocated = allocated;
1891 __entry->newblk = newblock;
1892 ),
1893
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001894 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 -04001895 "allocated %d newblock %llu",
1896 MAJOR(__entry->dev), MINOR(__entry->dev),
1897 (unsigned long) __entry->ino,
1898 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001899 __entry->len, show_map_flags(__entry->flags),
Aditya Kalid8990242011-09-09 19:18:51 -04001900 (unsigned int) __entry->allocated,
1901 (unsigned long long) __entry->newblk)
1902);
1903
1904TRACE_EVENT(ext4_get_implied_cluster_alloc_exit,
1905 TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret),
1906
1907 TP_ARGS(sb, map, ret),
1908
1909 TP_STRUCT__entry(
1910 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001911 __field( unsigned int, flags )
Aditya Kalid8990242011-09-09 19:18:51 -04001912 __field( ext4_lblk_t, lblk )
1913 __field( ext4_fsblk_t, pblk )
1914 __field( unsigned int, len )
Aditya Kalid8990242011-09-09 19:18:51 -04001915 __field( int, ret )
1916 ),
1917
1918 TP_fast_assign(
1919 __entry->dev = sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001920 __entry->flags = map->m_flags;
Aditya Kalid8990242011-09-09 19:18:51 -04001921 __entry->lblk = map->m_lblk;
1922 __entry->pblk = map->m_pblk;
1923 __entry->len = map->m_len;
Aditya Kalid8990242011-09-09 19:18:51 -04001924 __entry->ret = ret;
1925 ),
1926
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001927 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 -04001928 MAJOR(__entry->dev), MINOR(__entry->dev),
1929 __entry->lblk, (unsigned long long) __entry->pblk,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04001930 __entry->len, show_mflags(__entry->flags), __entry->ret)
Aditya Kalid8990242011-09-09 19:18:51 -04001931);
1932
1933TRACE_EVENT(ext4_ext_put_in_cache,
1934 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len,
1935 ext4_fsblk_t start),
1936
1937 TP_ARGS(inode, lblk, len, start),
1938
1939 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001940 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001941 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04001942 __field( ext4_lblk_t, lblk )
1943 __field( unsigned int, len )
1944 __field( ext4_fsblk_t, start )
1945 ),
1946
1947 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001948 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001949 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04001950 __entry->lblk = lblk;
1951 __entry->len = len;
1952 __entry->start = start;
1953 ),
1954
1955 TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu",
1956 MAJOR(__entry->dev), MINOR(__entry->dev),
1957 (unsigned long) __entry->ino,
1958 (unsigned) __entry->lblk,
1959 __entry->len,
1960 (unsigned long long) __entry->start)
1961);
1962
1963TRACE_EVENT(ext4_ext_in_cache,
1964 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret),
1965
1966 TP_ARGS(inode, lblk, ret),
1967
1968 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001969 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001970 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04001971 __field( ext4_lblk_t, lblk )
1972 __field( int, ret )
1973 ),
1974
1975 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04001976 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04001977 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04001978 __entry->lblk = lblk;
1979 __entry->ret = ret;
1980 ),
1981
1982 TP_printk("dev %d,%d ino %lu lblk %u ret %d",
1983 MAJOR(__entry->dev), MINOR(__entry->dev),
1984 (unsigned long) __entry->ino,
1985 (unsigned) __entry->lblk,
1986 __entry->ret)
1987
1988);
1989
1990TRACE_EVENT(ext4_find_delalloc_range,
1991 TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to,
1992 int reverse, int found, ext4_lblk_t found_blk),
1993
1994 TP_ARGS(inode, from, to, reverse, found, found_blk),
1995
1996 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04001997 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04001998 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04001999 __field( ext4_lblk_t, from )
2000 __field( ext4_lblk_t, to )
2001 __field( int, reverse )
2002 __field( int, found )
2003 __field( ext4_lblk_t, found_blk )
2004 ),
2005
2006 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002007 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002008 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002009 __entry->from = from;
2010 __entry->to = to;
2011 __entry->reverse = reverse;
2012 __entry->found = found;
2013 __entry->found_blk = found_blk;
2014 ),
2015
2016 TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d "
2017 "(blk = %u)",
2018 MAJOR(__entry->dev), MINOR(__entry->dev),
2019 (unsigned long) __entry->ino,
2020 (unsigned) __entry->from, (unsigned) __entry->to,
2021 __entry->reverse, __entry->found,
2022 (unsigned) __entry->found_blk)
2023);
2024
2025TRACE_EVENT(ext4_get_reserved_cluster_alloc,
2026 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len),
2027
2028 TP_ARGS(inode, lblk, len),
2029
2030 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002031 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002032 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002033 __field( ext4_lblk_t, lblk )
2034 __field( unsigned int, len )
2035 ),
2036
2037 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002038 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002039 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002040 __entry->lblk = lblk;
2041 __entry->len = len;
2042 ),
2043
2044 TP_printk("dev %d,%d ino %lu lblk %u len %u",
2045 MAJOR(__entry->dev), MINOR(__entry->dev),
2046 (unsigned long) __entry->ino,
2047 (unsigned) __entry->lblk,
2048 __entry->len)
2049);
2050
2051TRACE_EVENT(ext4_ext_show_extent,
2052 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk,
2053 unsigned short len),
2054
2055 TP_ARGS(inode, lblk, pblk, len),
2056
2057 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002058 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002059 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002060 __field( ext4_fsblk_t, pblk )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002061 __field( ext4_lblk_t, lblk )
Aditya Kalid8990242011-09-09 19:18:51 -04002062 __field( unsigned short, len )
2063 ),
2064
2065 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002066 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002067 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002068 __entry->pblk = pblk;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002069 __entry->lblk = lblk;
Aditya Kalid8990242011-09-09 19:18:51 -04002070 __entry->len = len;
2071 ),
2072
2073 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u",
2074 MAJOR(__entry->dev), MINOR(__entry->dev),
2075 (unsigned long) __entry->ino,
2076 (unsigned) __entry->lblk,
2077 (unsigned long long) __entry->pblk,
2078 (unsigned short) __entry->len)
2079);
2080
2081TRACE_EVENT(ext4_remove_blocks,
Eric Whitney9fe67142018-10-01 14:25:08 -04002082 TP_PROTO(struct inode *inode, struct ext4_extent *ex,
2083 ext4_lblk_t from, ext4_fsblk_t to,
2084 struct partial_cluster *pc),
Aditya Kalid8990242011-09-09 19:18:51 -04002085
Eric Whitney9fe67142018-10-01 14:25:08 -04002086 TP_ARGS(inode, ex, from, to, pc),
Aditya Kalid8990242011-09-09 19:18:51 -04002087
2088 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002089 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002090 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002091 __field( ext4_lblk_t, from )
2092 __field( ext4_lblk_t, to )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002093 __field( ext4_fsblk_t, ee_pblk )
2094 __field( ext4_lblk_t, ee_lblk )
2095 __field( unsigned short, ee_len )
Eric Whitney9fe67142018-10-01 14:25:08 -04002096 __field( ext4_fsblk_t, pc_pclu )
2097 __field( ext4_lblk_t, pc_lblk )
2098 __field( int, pc_state)
Aditya Kalid8990242011-09-09 19:18:51 -04002099 ),
2100
2101 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002102 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002103 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002104 __entry->from = from;
2105 __entry->to = to;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002106 __entry->ee_pblk = ext4_ext_pblock(ex);
Theodore Ts'od6a77102013-04-09 23:59:55 -04002107 __entry->ee_lblk = le32_to_cpu(ex->ee_block);
Anatol Pomozov210c0522012-08-17 09:50:17 -04002108 __entry->ee_len = ext4_ext_get_actual_len(ex);
Eric Whitney9fe67142018-10-01 14:25:08 -04002109 __entry->pc_pclu = pc->pclu;
2110 __entry->pc_lblk = pc->lblk;
2111 __entry->pc_state = pc->state;
Aditya Kalid8990242011-09-09 19:18:51 -04002112 ),
2113
2114 TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
Eric Whitney9fe67142018-10-01 14:25:08 -04002115 "from %u to %u partial [pclu %lld lblk %u state %d]",
Aditya Kalid8990242011-09-09 19:18:51 -04002116 MAJOR(__entry->dev), MINOR(__entry->dev),
2117 (unsigned long) __entry->ino,
2118 (unsigned) __entry->ee_lblk,
2119 (unsigned long long) __entry->ee_pblk,
2120 (unsigned short) __entry->ee_len,
2121 (unsigned) __entry->from,
2122 (unsigned) __entry->to,
Eric Whitney9fe67142018-10-01 14:25:08 -04002123 (long long) __entry->pc_pclu,
2124 (unsigned int) __entry->pc_lblk,
2125 (int) __entry->pc_state)
Aditya Kalid8990242011-09-09 19:18:51 -04002126);
2127
2128TRACE_EVENT(ext4_ext_rm_leaf,
2129 TP_PROTO(struct inode *inode, ext4_lblk_t start,
Lukas Czernerd23142c2013-05-27 23:33:35 -04002130 struct ext4_extent *ex,
Eric Whitney9fe67142018-10-01 14:25:08 -04002131 struct partial_cluster *pc),
Aditya Kalid8990242011-09-09 19:18:51 -04002132
Eric Whitney9fe67142018-10-01 14:25:08 -04002133 TP_ARGS(inode, start, ex, pc),
Aditya Kalid8990242011-09-09 19:18:51 -04002134
2135 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002136 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002137 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002138 __field( ext4_lblk_t, start )
2139 __field( ext4_lblk_t, ee_lblk )
2140 __field( ext4_fsblk_t, ee_pblk )
2141 __field( short, ee_len )
Eric Whitney9fe67142018-10-01 14:25:08 -04002142 __field( ext4_fsblk_t, pc_pclu )
2143 __field( ext4_lblk_t, pc_lblk )
2144 __field( int, pc_state)
Aditya Kalid8990242011-09-09 19:18:51 -04002145 ),
2146
2147 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002148 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002149 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002150 __entry->start = start;
2151 __entry->ee_lblk = le32_to_cpu(ex->ee_block);
2152 __entry->ee_pblk = ext4_ext_pblock(ex);
2153 __entry->ee_len = ext4_ext_get_actual_len(ex);
Eric Whitney9fe67142018-10-01 14:25:08 -04002154 __entry->pc_pclu = pc->pclu;
2155 __entry->pc_lblk = pc->lblk;
2156 __entry->pc_state = pc->state;
Aditya Kalid8990242011-09-09 19:18:51 -04002157 ),
2158
2159 TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
Eric Whitney9fe67142018-10-01 14:25:08 -04002160 "partial [pclu %lld lblk %u state %d]",
Aditya Kalid8990242011-09-09 19:18:51 -04002161 MAJOR(__entry->dev), MINOR(__entry->dev),
2162 (unsigned long) __entry->ino,
2163 (unsigned) __entry->start,
2164 (unsigned) __entry->ee_lblk,
2165 (unsigned long long) __entry->ee_pblk,
2166 (unsigned short) __entry->ee_len,
Eric Whitney9fe67142018-10-01 14:25:08 -04002167 (long long) __entry->pc_pclu,
2168 (unsigned int) __entry->pc_lblk,
2169 (int) __entry->pc_state)
Aditya Kalid8990242011-09-09 19:18:51 -04002170);
2171
2172TRACE_EVENT(ext4_ext_rm_idx,
2173 TP_PROTO(struct inode *inode, ext4_fsblk_t pblk),
2174
2175 TP_ARGS(inode, pblk),
2176
2177 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002178 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002179 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002180 __field( ext4_fsblk_t, pblk )
2181 ),
2182
2183 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002184 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002185 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002186 __entry->pblk = pblk;
2187 ),
2188
2189 TP_printk("dev %d,%d ino %lu index_pblk %llu",
2190 MAJOR(__entry->dev), MINOR(__entry->dev),
2191 (unsigned long) __entry->ino,
2192 (unsigned long long) __entry->pblk)
2193);
2194
2195TRACE_EVENT(ext4_ext_remove_space,
Lukas Czerner61801322013-05-27 23:32:35 -04002196 TP_PROTO(struct inode *inode, ext4_lblk_t start,
2197 ext4_lblk_t end, int depth),
Aditya Kalid8990242011-09-09 19:18:51 -04002198
Lukas Czerner61801322013-05-27 23:32:35 -04002199 TP_ARGS(inode, start, end, depth),
Aditya Kalid8990242011-09-09 19:18:51 -04002200
2201 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002202 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002203 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002204 __field( ext4_lblk_t, start )
Lukas Czerner61801322013-05-27 23:32:35 -04002205 __field( ext4_lblk_t, end )
Aditya Kalid8990242011-09-09 19:18:51 -04002206 __field( int, depth )
2207 ),
2208
2209 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002210 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002211 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002212 __entry->start = start;
Lukas Czerner61801322013-05-27 23:32:35 -04002213 __entry->end = end;
Aditya Kalid8990242011-09-09 19:18:51 -04002214 __entry->depth = depth;
2215 ),
2216
Lukas Czerner61801322013-05-27 23:32:35 -04002217 TP_printk("dev %d,%d ino %lu since %u end %u depth %d",
Aditya Kalid8990242011-09-09 19:18:51 -04002218 MAJOR(__entry->dev), MINOR(__entry->dev),
2219 (unsigned long) __entry->ino,
2220 (unsigned) __entry->start,
Lukas Czerner61801322013-05-27 23:32:35 -04002221 (unsigned) __entry->end,
Aditya Kalid8990242011-09-09 19:18:51 -04002222 __entry->depth)
2223);
2224
2225TRACE_EVENT(ext4_ext_remove_space_done,
Lukas Czerner61801322013-05-27 23:32:35 -04002226 TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end,
Eric Whitney9fe67142018-10-01 14:25:08 -04002227 int depth, struct partial_cluster *pc, __le16 eh_entries),
Aditya Kalid8990242011-09-09 19:18:51 -04002228
Eric Whitney9fe67142018-10-01 14:25:08 -04002229 TP_ARGS(inode, start, end, depth, pc, eh_entries),
Aditya Kalid8990242011-09-09 19:18:51 -04002230
2231 TP_STRUCT__entry(
Aditya Kalid8990242011-09-09 19:18:51 -04002232 __field( dev_t, dev )
Anatol Pomozov210c0522012-08-17 09:50:17 -04002233 __field( ino_t, ino )
Aditya Kalid8990242011-09-09 19:18:51 -04002234 __field( ext4_lblk_t, start )
Lukas Czerner61801322013-05-27 23:32:35 -04002235 __field( ext4_lblk_t, end )
Aditya Kalid8990242011-09-09 19:18:51 -04002236 __field( int, depth )
Eric Whitney9fe67142018-10-01 14:25:08 -04002237 __field( ext4_fsblk_t, pc_pclu )
2238 __field( ext4_lblk_t, pc_lblk )
2239 __field( int, pc_state )
Aditya Kalid8990242011-09-09 19:18:51 -04002240 __field( unsigned short, eh_entries )
2241 ),
2242
2243 TP_fast_assign(
Aditya Kalid8990242011-09-09 19:18:51 -04002244 __entry->dev = inode->i_sb->s_dev;
Anatol Pomozov210c0522012-08-17 09:50:17 -04002245 __entry->ino = inode->i_ino;
Aditya Kalid8990242011-09-09 19:18:51 -04002246 __entry->start = start;
Lukas Czerner61801322013-05-27 23:32:35 -04002247 __entry->end = end;
Aditya Kalid8990242011-09-09 19:18:51 -04002248 __entry->depth = depth;
Eric Whitney9fe67142018-10-01 14:25:08 -04002249 __entry->pc_pclu = pc->pclu;
2250 __entry->pc_lblk = pc->lblk;
2251 __entry->pc_state = pc->state;
Theodore Ts'od6a77102013-04-09 23:59:55 -04002252 __entry->eh_entries = le16_to_cpu(eh_entries);
Aditya Kalid8990242011-09-09 19:18:51 -04002253 ),
2254
Eric Whitney9fe67142018-10-01 14:25:08 -04002255 TP_printk("dev %d,%d ino %lu since %u end %u depth %d "
2256 "partial [pclu %lld lblk %u state %d] "
Aditya Kalid8990242011-09-09 19:18:51 -04002257 "remaining_entries %u",
2258 MAJOR(__entry->dev), MINOR(__entry->dev),
2259 (unsigned long) __entry->ino,
2260 (unsigned) __entry->start,
Lukas Czerner61801322013-05-27 23:32:35 -04002261 (unsigned) __entry->end,
Aditya Kalid8990242011-09-09 19:18:51 -04002262 __entry->depth,
Eric Whitney9fe67142018-10-01 14:25:08 -04002263 (long long) __entry->pc_pclu,
2264 (unsigned int) __entry->pc_lblk,
2265 (int) __entry->pc_state,
Aditya Kalid8990242011-09-09 19:18:51 -04002266 (unsigned short) __entry->eh_entries)
2267);
2268
Theodore Ts'o107a7bd2013-08-16 21:23:41 -04002269DECLARE_EVENT_CLASS(ext4__es_extent,
Zheng Liufdc02122013-02-18 00:26:51 -05002270 TP_PROTO(struct inode *inode, struct extent_status *es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002271
Zheng Liufdc02122013-02-18 00:26:51 -05002272 TP_ARGS(inode, es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002273
2274 TP_STRUCT__entry(
Zheng Liufdc02122013-02-18 00:26:51 -05002275 __field( dev_t, dev )
2276 __field( ino_t, ino )
2277 __field( ext4_lblk_t, lblk )
2278 __field( ext4_lblk_t, len )
2279 __field( ext4_fsblk_t, pblk )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002280 __field( char, status )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002281 ),
2282
2283 TP_fast_assign(
2284 __entry->dev = inode->i_sb->s_dev;
2285 __entry->ino = inode->i_ino;
Zheng Liufdc02122013-02-18 00:26:51 -05002286 __entry->lblk = es->es_lblk;
2287 __entry->len = es->es_len;
Dmitry Monakhov52144d82019-11-14 20:01:47 +00002288 __entry->pblk = ext4_es_show_pblock(es);
Theodore Ts'o3be78c72013-08-16 21:22:41 -04002289 __entry->status = ext4_es_status(es);
Zheng Liu992e9fd2012-11-08 21:57:33 -05002290 ),
2291
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002292 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
Zheng Liu992e9fd2012-11-08 21:57:33 -05002293 MAJOR(__entry->dev), MINOR(__entry->dev),
2294 (unsigned long) __entry->ino,
Zheng Liufdc02122013-02-18 00:26:51 -05002295 __entry->lblk, __entry->len,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002296 __entry->pblk, show_extent_status(__entry->status))
Zheng Liu992e9fd2012-11-08 21:57:33 -05002297);
2298
Theodore Ts'o107a7bd2013-08-16 21:23:41 -04002299DEFINE_EVENT(ext4__es_extent, ext4_es_insert_extent,
2300 TP_PROTO(struct inode *inode, struct extent_status *es),
2301
2302 TP_ARGS(inode, es)
2303);
2304
2305DEFINE_EVENT(ext4__es_extent, ext4_es_cache_extent,
2306 TP_PROTO(struct inode *inode, struct extent_status *es),
2307
2308 TP_ARGS(inode, es)
2309);
2310
Zheng Liu992e9fd2012-11-08 21:57:33 -05002311TRACE_EVENT(ext4_es_remove_extent,
Zheng Liu06b0c882013-02-18 00:26:51 -05002312 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002313
Zheng Liu06b0c882013-02-18 00:26:51 -05002314 TP_ARGS(inode, lblk, len),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002315
2316 TP_STRUCT__entry(
2317 __field( dev_t, dev )
2318 __field( ino_t, ino )
Zheng Liu06b0c882013-02-18 00:26:51 -05002319 __field( loff_t, lblk )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002320 __field( loff_t, len )
2321 ),
2322
2323 TP_fast_assign(
2324 __entry->dev = inode->i_sb->s_dev;
2325 __entry->ino = inode->i_ino;
Zheng Liu06b0c882013-02-18 00:26:51 -05002326 __entry->lblk = lblk;
Zheng Liu992e9fd2012-11-08 21:57:33 -05002327 __entry->len = len;
2328 ),
2329
2330 TP_printk("dev %d,%d ino %lu es [%lld/%lld)",
2331 MAJOR(__entry->dev), MINOR(__entry->dev),
2332 (unsigned long) __entry->ino,
Zheng Liu06b0c882013-02-18 00:26:51 -05002333 __entry->lblk, __entry->len)
Zheng Liu992e9fd2012-11-08 21:57:33 -05002334);
2335
Eric Whitneyad431022018-10-01 14:10:39 -04002336TRACE_EVENT(ext4_es_find_extent_range_enter,
Zheng Liu06b0c882013-02-18 00:26:51 -05002337 TP_PROTO(struct inode *inode, ext4_lblk_t lblk),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002338
Zheng Liu06b0c882013-02-18 00:26:51 -05002339 TP_ARGS(inode, lblk),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002340
2341 TP_STRUCT__entry(
2342 __field( dev_t, dev )
2343 __field( ino_t, ino )
Zheng Liu06b0c882013-02-18 00:26:51 -05002344 __field( ext4_lblk_t, lblk )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002345 ),
2346
2347 TP_fast_assign(
2348 __entry->dev = inode->i_sb->s_dev;
2349 __entry->ino = inode->i_ino;
Zheng Liu06b0c882013-02-18 00:26:51 -05002350 __entry->lblk = lblk;
Zheng Liu992e9fd2012-11-08 21:57:33 -05002351 ),
2352
Zheng Liu06b0c882013-02-18 00:26:51 -05002353 TP_printk("dev %d,%d ino %lu lblk %u",
Zheng Liu992e9fd2012-11-08 21:57:33 -05002354 MAJOR(__entry->dev), MINOR(__entry->dev),
Zheng Liu06b0c882013-02-18 00:26:51 -05002355 (unsigned long) __entry->ino, __entry->lblk)
Zheng Liu992e9fd2012-11-08 21:57:33 -05002356);
2357
Eric Whitneyad431022018-10-01 14:10:39 -04002358TRACE_EVENT(ext4_es_find_extent_range_exit,
Zheng Liube401362013-02-18 00:27:26 -05002359 TP_PROTO(struct inode *inode, struct extent_status *es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002360
Zheng Liube401362013-02-18 00:27:26 -05002361 TP_ARGS(inode, es),
Zheng Liu992e9fd2012-11-08 21:57:33 -05002362
2363 TP_STRUCT__entry(
2364 __field( dev_t, dev )
2365 __field( ino_t, ino )
Zheng Liu06b0c882013-02-18 00:26:51 -05002366 __field( ext4_lblk_t, lblk )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002367 __field( ext4_lblk_t, len )
Zheng Liufdc02122013-02-18 00:26:51 -05002368 __field( ext4_fsblk_t, pblk )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002369 __field( char, status )
Zheng Liu992e9fd2012-11-08 21:57:33 -05002370 ),
2371
2372 TP_fast_assign(
2373 __entry->dev = inode->i_sb->s_dev;
2374 __entry->ino = inode->i_ino;
Zheng Liu06b0c882013-02-18 00:26:51 -05002375 __entry->lblk = es->es_lblk;
2376 __entry->len = es->es_len;
Dmitry Monakhov52144d82019-11-14 20:01:47 +00002377 __entry->pblk = ext4_es_show_pblock(es);
Theodore Ts'o3be78c72013-08-16 21:22:41 -04002378 __entry->status = ext4_es_status(es);
Zheng Liu992e9fd2012-11-08 21:57:33 -05002379 ),
2380
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002381 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
Zheng Liu992e9fd2012-11-08 21:57:33 -05002382 MAJOR(__entry->dev), MINOR(__entry->dev),
2383 (unsigned long) __entry->ino,
Zheng Liufdc02122013-02-18 00:26:51 -05002384 __entry->lblk, __entry->len,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002385 __entry->pblk, show_extent_status(__entry->status))
Zheng Liu992e9fd2012-11-08 21:57:33 -05002386);
2387
Zheng Liud100eef2013-02-18 00:29:59 -05002388TRACE_EVENT(ext4_es_lookup_extent_enter,
2389 TP_PROTO(struct inode *inode, ext4_lblk_t lblk),
2390
2391 TP_ARGS(inode, lblk),
2392
2393 TP_STRUCT__entry(
2394 __field( dev_t, dev )
2395 __field( ino_t, ino )
2396 __field( ext4_lblk_t, lblk )
2397 ),
2398
2399 TP_fast_assign(
2400 __entry->dev = inode->i_sb->s_dev;
2401 __entry->ino = inode->i_ino;
2402 __entry->lblk = lblk;
2403 ),
2404
2405 TP_printk("dev %d,%d ino %lu lblk %u",
2406 MAJOR(__entry->dev), MINOR(__entry->dev),
2407 (unsigned long) __entry->ino, __entry->lblk)
2408);
2409
2410TRACE_EVENT(ext4_es_lookup_extent_exit,
2411 TP_PROTO(struct inode *inode, struct extent_status *es,
2412 int found),
2413
2414 TP_ARGS(inode, es, found),
2415
2416 TP_STRUCT__entry(
2417 __field( dev_t, dev )
2418 __field( ino_t, ino )
2419 __field( ext4_lblk_t, lblk )
2420 __field( ext4_lblk_t, len )
2421 __field( ext4_fsblk_t, pblk )
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002422 __field( char, status )
Zheng Liud100eef2013-02-18 00:29:59 -05002423 __field( int, found )
2424 ),
2425
2426 TP_fast_assign(
2427 __entry->dev = inode->i_sb->s_dev;
2428 __entry->ino = inode->i_ino;
2429 __entry->lblk = es->es_lblk;
2430 __entry->len = es->es_len;
Dmitry Monakhov52144d82019-11-14 20:01:47 +00002431 __entry->pblk = ext4_es_show_pblock(es);
Theodore Ts'o3be78c72013-08-16 21:22:41 -04002432 __entry->status = ext4_es_status(es);
Zheng Liud100eef2013-02-18 00:29:59 -05002433 __entry->found = found;
2434 ),
2435
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002436 TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %s",
Zheng Liud100eef2013-02-18 00:29:59 -05002437 MAJOR(__entry->dev), MINOR(__entry->dev),
2438 (unsigned long) __entry->ino, __entry->found,
2439 __entry->lblk, __entry->len,
2440 __entry->found ? __entry->pblk : 0,
Theodore Ts'o21ddd562013-07-01 08:12:40 -04002441 show_extent_status(__entry->found ? __entry->status : 0))
Zheng Liud100eef2013-02-18 00:29:59 -05002442);
2443
Zheng Liue963bb12014-09-01 22:22:13 -04002444DECLARE_EVENT_CLASS(ext4__es_shrink_enter,
Theodore Ts'o24630772013-02-28 23:58:56 -05002445 TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002446
Theodore Ts'o24630772013-02-28 23:58:56 -05002447 TP_ARGS(sb, nr_to_scan, cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002448
2449 TP_STRUCT__entry(
2450 __field( dev_t, dev )
2451 __field( int, nr_to_scan )
Theodore Ts'o24630772013-02-28 23:58:56 -05002452 __field( int, cache_cnt )
Zheng Liu74cd15c2013-02-18 00:32:55 -05002453 ),
2454
2455 TP_fast_assign(
2456 __entry->dev = sb->s_dev;
2457 __entry->nr_to_scan = nr_to_scan;
Theodore Ts'o24630772013-02-28 23:58:56 -05002458 __entry->cache_cnt = cache_cnt;
Zheng Liu74cd15c2013-02-18 00:32:55 -05002459 ),
2460
Theodore Ts'o24630772013-02-28 23:58:56 -05002461 TP_printk("dev %d,%d nr_to_scan %d cache_cnt %d",
Zheng Liu74cd15c2013-02-18 00:32:55 -05002462 MAJOR(__entry->dev), MINOR(__entry->dev),
Theodore Ts'o24630772013-02-28 23:58:56 -05002463 __entry->nr_to_scan, __entry->cache_cnt)
Zheng Liu74cd15c2013-02-18 00:32:55 -05002464);
2465
Zheng Liue963bb12014-09-01 22:22:13 -04002466DEFINE_EVENT(ext4__es_shrink_enter, ext4_es_shrink_count,
2467 TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002468
Zheng Liue963bb12014-09-01 22:22:13 -04002469 TP_ARGS(sb, nr_to_scan, cache_cnt)
2470);
2471
2472DEFINE_EVENT(ext4__es_shrink_enter, ext4_es_shrink_scan_enter,
2473 TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt),
2474
2475 TP_ARGS(sb, nr_to_scan, cache_cnt)
2476);
2477
2478TRACE_EVENT(ext4_es_shrink_scan_exit,
2479 TP_PROTO(struct super_block *sb, int nr_shrunk, int cache_cnt),
2480
2481 TP_ARGS(sb, nr_shrunk, cache_cnt),
Zheng Liu74cd15c2013-02-18 00:32:55 -05002482
2483 TP_STRUCT__entry(
2484 __field( dev_t, dev )
Zheng Liue963bb12014-09-01 22:22:13 -04002485 __field( int, nr_shrunk )
Theodore Ts'o24630772013-02-28 23:58:56 -05002486 __field( int, cache_cnt )
Zheng Liu74cd15c2013-02-18 00:32:55 -05002487 ),
2488
2489 TP_fast_assign(
2490 __entry->dev = sb->s_dev;
Zheng Liue963bb12014-09-01 22:22:13 -04002491 __entry->nr_shrunk = nr_shrunk;
Theodore Ts'o24630772013-02-28 23:58:56 -05002492 __entry->cache_cnt = cache_cnt;
Zheng Liu74cd15c2013-02-18 00:32:55 -05002493 ),
2494
Zheng Liue963bb12014-09-01 22:22:13 -04002495 TP_printk("dev %d,%d nr_shrunk %d cache_cnt %d",
Zheng Liu74cd15c2013-02-18 00:32:55 -05002496 MAJOR(__entry->dev), MINOR(__entry->dev),
Zheng Liue963bb12014-09-01 22:22:13 -04002497 __entry->nr_shrunk, __entry->cache_cnt)
Zheng Liu74cd15c2013-02-18 00:32:55 -05002498);
2499
Namjae Jeon9eb79482014-02-23 15:18:59 -05002500TRACE_EVENT(ext4_collapse_range,
2501 TP_PROTO(struct inode *inode, loff_t offset, loff_t len),
2502
2503 TP_ARGS(inode, offset, len),
2504
2505 TP_STRUCT__entry(
2506 __field(dev_t, dev)
2507 __field(ino_t, ino)
2508 __field(loff_t, offset)
2509 __field(loff_t, len)
2510 ),
2511
2512 TP_fast_assign(
2513 __entry->dev = inode->i_sb->s_dev;
2514 __entry->ino = inode->i_ino;
2515 __entry->offset = offset;
2516 __entry->len = len;
2517 ),
2518
2519 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2520 MAJOR(__entry->dev), MINOR(__entry->dev),
2521 (unsigned long) __entry->ino,
2522 __entry->offset, __entry->len)
2523);
2524
Namjae Jeon331573f2015-06-09 01:55:03 -04002525TRACE_EVENT(ext4_insert_range,
2526 TP_PROTO(struct inode *inode, loff_t offset, loff_t len),
2527
2528 TP_ARGS(inode, offset, len),
2529
2530 TP_STRUCT__entry(
2531 __field(dev_t, dev)
2532 __field(ino_t, ino)
2533 __field(loff_t, offset)
2534 __field(loff_t, len)
2535 ),
2536
2537 TP_fast_assign(
2538 __entry->dev = inode->i_sb->s_dev;
2539 __entry->ino = inode->i_ino;
2540 __entry->offset = offset;
2541 __entry->len = len;
2542 ),
2543
2544 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2545 MAJOR(__entry->dev), MINOR(__entry->dev),
2546 (unsigned long) __entry->ino,
2547 __entry->offset, __entry->len)
2548);
2549
Zheng Liueb68d0e2014-09-01 22:26:49 -04002550TRACE_EVENT(ext4_es_shrink,
2551 TP_PROTO(struct super_block *sb, int nr_shrunk, u64 scan_time,
Zheng Liuedaa53c2014-11-25 11:45:37 -05002552 int nr_skipped, int retried),
Zheng Liueb68d0e2014-09-01 22:26:49 -04002553
Zheng Liuedaa53c2014-11-25 11:45:37 -05002554 TP_ARGS(sb, nr_shrunk, scan_time, nr_skipped, retried),
Zheng Liueb68d0e2014-09-01 22:26:49 -04002555
2556 TP_STRUCT__entry(
2557 __field( dev_t, dev )
2558 __field( int, nr_shrunk )
2559 __field( unsigned long long, scan_time )
Zheng Liueb68d0e2014-09-01 22:26:49 -04002560 __field( int, nr_skipped )
2561 __field( int, retried )
2562 ),
2563
2564 TP_fast_assign(
2565 __entry->dev = sb->s_dev;
2566 __entry->nr_shrunk = nr_shrunk;
2567 __entry->scan_time = div_u64(scan_time, 1000);
Zheng Liueb68d0e2014-09-01 22:26:49 -04002568 __entry->nr_skipped = nr_skipped;
2569 __entry->retried = retried;
2570 ),
2571
Zheng Liuedaa53c2014-11-25 11:45:37 -05002572 TP_printk("dev %d,%d nr_shrunk %d, scan_time %llu "
Zheng Liueb68d0e2014-09-01 22:26:49 -04002573 "nr_skipped %d retried %d",
2574 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->nr_shrunk,
Zheng Liuedaa53c2014-11-25 11:45:37 -05002575 __entry->scan_time, __entry->nr_skipped, __entry->retried)
Zheng Liueb68d0e2014-09-01 22:26:49 -04002576);
2577
Eric Whitney0b02f4c2018-10-01 14:19:37 -04002578TRACE_EVENT(ext4_es_insert_delayed_block,
2579 TP_PROTO(struct inode *inode, struct extent_status *es,
2580 bool allocated),
2581
2582 TP_ARGS(inode, es, allocated),
2583
2584 TP_STRUCT__entry(
2585 __field( dev_t, dev )
2586 __field( ino_t, ino )
2587 __field( ext4_lblk_t, lblk )
2588 __field( ext4_lblk_t, len )
2589 __field( ext4_fsblk_t, pblk )
2590 __field( char, status )
2591 __field( bool, allocated )
2592 ),
2593
2594 TP_fast_assign(
2595 __entry->dev = inode->i_sb->s_dev;
2596 __entry->ino = inode->i_ino;
2597 __entry->lblk = es->es_lblk;
2598 __entry->len = es->es_len;
Dmitry Monakhov52144d82019-11-14 20:01:47 +00002599 __entry->pblk = ext4_es_show_pblock(es);
Eric Whitney0b02f4c2018-10-01 14:19:37 -04002600 __entry->status = ext4_es_status(es);
2601 __entry->allocated = allocated;
2602 ),
2603
2604 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s "
2605 "allocated %d",
2606 MAJOR(__entry->dev), MINOR(__entry->dev),
2607 (unsigned long) __entry->ino,
2608 __entry->lblk, __entry->len,
2609 __entry->pblk, show_extent_status(__entry->status),
2610 __entry->allocated)
2611);
2612
Darrick J. Wong0c9ec4b2017-04-30 00:36:53 -04002613/* fsmap traces */
2614DECLARE_EVENT_CLASS(ext4_fsmap_class,
2615 TP_PROTO(struct super_block *sb, u32 keydev, u32 agno, u64 bno, u64 len,
2616 u64 owner),
2617 TP_ARGS(sb, keydev, agno, bno, len, owner),
2618 TP_STRUCT__entry(
2619 __field(dev_t, dev)
2620 __field(dev_t, keydev)
2621 __field(u32, agno)
2622 __field(u64, bno)
2623 __field(u64, len)
2624 __field(u64, owner)
2625 ),
2626 TP_fast_assign(
2627 __entry->dev = sb->s_bdev->bd_dev;
2628 __entry->keydev = new_decode_dev(keydev);
2629 __entry->agno = agno;
2630 __entry->bno = bno;
2631 __entry->len = len;
2632 __entry->owner = owner;
2633 ),
2634 TP_printk("dev %d:%d keydev %d:%d agno %u bno %llu len %llu owner %lld\n",
2635 MAJOR(__entry->dev), MINOR(__entry->dev),
2636 MAJOR(__entry->keydev), MINOR(__entry->keydev),
2637 __entry->agno,
2638 __entry->bno,
2639 __entry->len,
2640 __entry->owner)
2641)
2642#define DEFINE_FSMAP_EVENT(name) \
2643DEFINE_EVENT(ext4_fsmap_class, name, \
2644 TP_PROTO(struct super_block *sb, u32 keydev, u32 agno, u64 bno, u64 len, \
2645 u64 owner), \
2646 TP_ARGS(sb, keydev, agno, bno, len, owner))
2647DEFINE_FSMAP_EVENT(ext4_fsmap_low_key);
2648DEFINE_FSMAP_EVENT(ext4_fsmap_high_key);
2649DEFINE_FSMAP_EVENT(ext4_fsmap_mapping);
2650
2651DECLARE_EVENT_CLASS(ext4_getfsmap_class,
2652 TP_PROTO(struct super_block *sb, struct ext4_fsmap *fsmap),
2653 TP_ARGS(sb, fsmap),
2654 TP_STRUCT__entry(
2655 __field(dev_t, dev)
2656 __field(dev_t, keydev)
2657 __field(u64, block)
2658 __field(u64, len)
2659 __field(u64, owner)
2660 __field(u64, flags)
2661 ),
2662 TP_fast_assign(
2663 __entry->dev = sb->s_bdev->bd_dev;
2664 __entry->keydev = new_decode_dev(fsmap->fmr_device);
2665 __entry->block = fsmap->fmr_physical;
2666 __entry->len = fsmap->fmr_length;
2667 __entry->owner = fsmap->fmr_owner;
2668 __entry->flags = fsmap->fmr_flags;
2669 ),
2670 TP_printk("dev %d:%d keydev %d:%d block %llu len %llu owner %lld flags 0x%llx\n",
2671 MAJOR(__entry->dev), MINOR(__entry->dev),
2672 MAJOR(__entry->keydev), MINOR(__entry->keydev),
2673 __entry->block,
2674 __entry->len,
2675 __entry->owner,
2676 __entry->flags)
2677)
2678#define DEFINE_GETFSMAP_EVENT(name) \
2679DEFINE_EVENT(ext4_getfsmap_class, name, \
2680 TP_PROTO(struct super_block *sb, struct ext4_fsmap *fsmap), \
2681 TP_ARGS(sb, fsmap))
2682DEFINE_GETFSMAP_EVENT(ext4_getfsmap_low_key);
2683DEFINE_GETFSMAP_EVENT(ext4_getfsmap_high_key);
2684DEFINE_GETFSMAP_EVENT(ext4_getfsmap_mapping);
2685
Theodore Ts'occf0f322018-02-18 20:53:23 -05002686TRACE_EVENT(ext4_shutdown,
2687 TP_PROTO(struct super_block *sb, unsigned long flags),
2688
2689 TP_ARGS(sb, flags),
2690
2691 TP_STRUCT__entry(
2692 __field( dev_t, dev )
2693 __field( unsigned, flags )
2694 ),
2695
2696 TP_fast_assign(
2697 __entry->dev = sb->s_dev;
2698 __entry->flags = flags;
2699 ),
2700
2701 TP_printk("dev %d,%d flags %u",
2702 MAJOR(__entry->dev), MINOR(__entry->dev),
2703 __entry->flags)
2704);
2705
2706TRACE_EVENT(ext4_error,
2707 TP_PROTO(struct super_block *sb, const char *function,
2708 unsigned int line),
2709
2710 TP_ARGS(sb, function, line),
2711
2712 TP_STRUCT__entry(
2713 __field( dev_t, dev )
2714 __field( const char *, function )
2715 __field( unsigned, line )
2716 ),
2717
2718 TP_fast_assign(
2719 __entry->dev = sb->s_dev;
2720 __entry->function = function;
2721 __entry->line = line;
2722 ),
2723
2724 TP_printk("dev %d,%d function %s line %u",
2725 MAJOR(__entry->dev), MINOR(__entry->dev),
2726 __entry->function, __entry->line)
2727);
2728
Theodore Ts'o9bffad12009-06-17 11:48:11 -04002729#endif /* _TRACE_EXT4_H */
2730
2731/* This part must be outside protection */
2732#include <trace/define_trace.h>