blob: e68d4d9e5e4d62121551423a83560949afd34f4e [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09002#undef TRACE_SYSTEM
3#define TRACE_SYSTEM f2fs
4
5#if !defined(_TRACE_F2FS_H) || defined(TRACE_HEADER_MULTI_READ)
6#define _TRACE_F2FS_H
7
8#include <linux/tracepoint.h>
9
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -080010#define show_dev(dev) MAJOR(dev), MINOR(dev)
11#define show_dev_ino(entry) show_dev(entry->dev), (unsigned long)entry->ino
Namjae Jeon6ec178d2013-04-23 17:51:43 +090012
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040013TRACE_DEFINE_ENUM(NODE);
14TRACE_DEFINE_ENUM(DATA);
15TRACE_DEFINE_ENUM(META);
16TRACE_DEFINE_ENUM(META_FLUSH);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070017TRACE_DEFINE_ENUM(INMEM);
18TRACE_DEFINE_ENUM(INMEM_DROP);
Jaegeuk Kim8c242db2017-03-17 09:55:52 +080019TRACE_DEFINE_ENUM(INMEM_INVALIDATE);
Chao Yua58f2442017-03-17 18:46:14 +080020TRACE_DEFINE_ENUM(INMEM_REVOKE);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070021TRACE_DEFINE_ENUM(IPU);
22TRACE_DEFINE_ENUM(OPU);
Jaegeuk Kima912b542017-05-10 11:18:25 -070023TRACE_DEFINE_ENUM(HOT);
24TRACE_DEFINE_ENUM(WARM);
25TRACE_DEFINE_ENUM(COLD);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040026TRACE_DEFINE_ENUM(CURSEG_HOT_DATA);
27TRACE_DEFINE_ENUM(CURSEG_WARM_DATA);
28TRACE_DEFINE_ENUM(CURSEG_COLD_DATA);
29TRACE_DEFINE_ENUM(CURSEG_HOT_NODE);
30TRACE_DEFINE_ENUM(CURSEG_WARM_NODE);
31TRACE_DEFINE_ENUM(CURSEG_COLD_NODE);
32TRACE_DEFINE_ENUM(NO_CHECK_TYPE);
33TRACE_DEFINE_ENUM(GC_GREEDY);
34TRACE_DEFINE_ENUM(GC_CB);
35TRACE_DEFINE_ENUM(FG_GC);
36TRACE_DEFINE_ENUM(BG_GC);
37TRACE_DEFINE_ENUM(LFS);
38TRACE_DEFINE_ENUM(SSR);
39TRACE_DEFINE_ENUM(__REQ_RAHEAD);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040040TRACE_DEFINE_ENUM(__REQ_SYNC);
Christoph Hellwiga2b80962016-11-01 07:40:09 -060041TRACE_DEFINE_ENUM(__REQ_IDLE);
Mike Christie28a8f0d2016-06-05 14:32:25 -050042TRACE_DEFINE_ENUM(__REQ_PREFLUSH);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040043TRACE_DEFINE_ENUM(__REQ_FUA);
44TRACE_DEFINE_ENUM(__REQ_PRIO);
45TRACE_DEFINE_ENUM(__REQ_META);
46TRACE_DEFINE_ENUM(CP_UMOUNT);
47TRACE_DEFINE_ENUM(CP_FASTBOOT);
48TRACE_DEFINE_ENUM(CP_SYNC);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070049TRACE_DEFINE_ENUM(CP_RECOVERY);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040050TRACE_DEFINE_ENUM(CP_DISCARD);
Chao Yu1f43e2a2017-04-28 13:56:08 +080051TRACE_DEFINE_ENUM(CP_TRIMMED);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040052
Namjae Jeon6ec178d2013-04-23 17:51:43 +090053#define show_block_type(type) \
54 __print_symbolic(type, \
55 { NODE, "NODE" }, \
56 { DATA, "DATA" }, \
57 { META, "META" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070058 { META_FLUSH, "META_FLUSH" }, \
59 { INMEM, "INMEM" }, \
60 { INMEM_DROP, "INMEM_DROP" }, \
Jaegeuk Kim8c242db2017-03-17 09:55:52 +080061 { INMEM_INVALIDATE, "INMEM_INVALIDATE" }, \
Chao Yu28bc1062016-02-06 14:40:34 +080062 { INMEM_REVOKE, "INMEM_REVOKE" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070063 { IPU, "IN-PLACE" }, \
64 { OPU, "OUT-OF-PLACE" })
Namjae Jeon6ec178d2013-04-23 17:51:43 +090065
Jaegeuk Kima912b542017-05-10 11:18:25 -070066#define show_block_temp(temp) \
67 __print_symbolic(temp, \
68 { HOT, "HOT" }, \
69 { WARM, "WARM" }, \
70 { COLD, "COLD" })
71
Chao Yubaaabbb2017-05-04 09:35:43 +080072#define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_META | REQ_PRIO | \
73 REQ_PREFLUSH | REQ_FUA)
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080074#define F2FS_BIO_FLAG_MASK(t) (t & F2FS_OP_FLAGS)
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090075
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080076#define show_bio_type(op,op_flags) show_bio_op(op), \
77 show_bio_op_flags(op_flags)
78
Chaitanya Kulkarni0ce35372019-06-20 10:59:19 -070079#define show_bio_op(op) blk_op_str(op)
Mike Christie04d328d2016-06-05 14:31:55 -050080
81#define show_bio_op_flags(flags) \
Chao Yubaaabbb2017-05-04 09:35:43 +080082 __print_flags(F2FS_BIO_FLAG_MASK(flags), "|", \
83 { REQ_RAHEAD, "R" }, \
84 { REQ_SYNC, "S" }, \
85 { REQ_META, "M" }, \
86 { REQ_PRIO, "P" }, \
87 { REQ_PREFLUSH, "PF" }, \
88 { REQ_FUA, "FUA" })
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090089
Namjae Jeon8e46b3e2013-04-23 16:42:53 +090090#define show_data_type(type) \
91 __print_symbolic(type, \
92 { CURSEG_HOT_DATA, "Hot DATA" }, \
93 { CURSEG_WARM_DATA, "Warm DATA" }, \
94 { CURSEG_COLD_DATA, "Cold DATA" }, \
95 { CURSEG_HOT_NODE, "Hot NODE" }, \
96 { CURSEG_WARM_NODE, "Warm NODE" }, \
97 { CURSEG_COLD_NODE, "Cold NODE" }, \
98 { NO_CHECK_TYPE, "No TYPE" })
99
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900100#define show_file_type(type) \
101 __print_symbolic(type, \
102 { 0, "FILE" }, \
103 { 1, "DIR" })
104
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900105#define show_gc_type(type) \
106 __print_symbolic(type, \
107 { FG_GC, "Foreground GC" }, \
108 { BG_GC, "Background GC" })
109
110#define show_alloc_mode(type) \
111 __print_symbolic(type, \
112 { LFS, "LFS-mode" }, \
113 { SSR, "SSR-mode" })
114
115#define show_victim_policy(type) \
116 __print_symbolic(type, \
117 { GC_GREEDY, "Greedy" }, \
118 { GC_CB, "Cost-Benefit" })
119
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700120#define show_cpreason(type) \
Chao Yubaaabbb2017-05-04 09:35:43 +0800121 __print_flags(type, "|", \
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700122 { CP_UMOUNT, "Umount" }, \
Jaegeuk Kim119ee912015-01-29 11:45:33 -0800123 { CP_FASTBOOT, "Fastboot" }, \
Jaegeuk Kim4b2fecc2014-09-20 22:06:39 -0700124 { CP_SYNC, "Sync" }, \
Jaegeuk Kim10027552015-04-09 17:03:53 -0700125 { CP_RECOVERY, "Recovery" }, \
Chao Yu1f43e2a2017-04-28 13:56:08 +0800126 { CP_DISCARD, "Discard" }, \
Chao Yubaaabbb2017-05-04 09:35:43 +0800127 { CP_UMOUNT, "Umount" }, \
128 { CP_TRIMMED, "Trimmed" })
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700129
Chao Yua5fd5052017-11-06 22:51:45 +0800130#define show_fsync_cpreason(type) \
131 __print_symbolic(type, \
132 { CP_NO_NEEDED, "no needed" }, \
133 { CP_NON_REGULAR, "non regular" }, \
Chao Yu4c8ff702019-11-01 18:07:14 +0800134 { CP_COMPRESSED, "compreesed" }, \
Chao Yua5fd5052017-11-06 22:51:45 +0800135 { CP_HARDLINK, "hardlink" }, \
136 { CP_SB_NEED_CP, "sb needs cp" }, \
137 { CP_WRONG_PINO, "wrong pino" }, \
138 { CP_NO_SPC_ROLL, "no space roll forward" }, \
139 { CP_NODE_NEED_CP, "node needs cp" }, \
140 { CP_FASTBOOT_MODE, "fastboot mode" }, \
Jaegeuk Kim0a007b972017-12-28 08:09:44 -0800141 { CP_SPEC_LOG_NUM, "log type is 2" }, \
142 { CP_RECOVER_DIR, "dir needs recovery" })
Chao Yua5fd5052017-11-06 22:51:45 +0800143
Chao Yu559e87c2019-02-26 19:01:15 +0800144#define show_shutdown_mode(type) \
145 __print_symbolic(type, \
146 { F2FS_GOING_DOWN_FULLSYNC, "full sync" }, \
147 { F2FS_GOING_DOWN_METASYNC, "meta sync" }, \
148 { F2FS_GOING_DOWN_NOSYNC, "no sync" }, \
149 { F2FS_GOING_DOWN_METAFLUSH, "meta flush" }, \
150 { F2FS_GOING_DOWN_NEED_FSCK, "need fsck" })
151
Chao Yu4c8ff702019-11-01 18:07:14 +0800152#define show_compress_algorithm(type) \
153 __print_symbolic(type, \
154 { COMPRESS_LZO, "LZO" }, \
155 { COMPRESS_LZ4, "LZ4" })
156
Zhikang Zhang539cd352019-01-03 20:06:38 +0800157struct f2fs_sb_info;
158struct f2fs_io_info;
159struct extent_info;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900160struct victim_sel_policy;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700161struct f2fs_map_blocks;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900162
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900163DECLARE_EVENT_CLASS(f2fs__inode,
164
165 TP_PROTO(struct inode *inode),
166
167 TP_ARGS(inode),
168
169 TP_STRUCT__entry(
170 __field(dev_t, dev)
171 __field(ino_t, ino)
172 __field(ino_t, pino)
173 __field(umode_t, mode)
174 __field(loff_t, size)
175 __field(unsigned int, nlink)
176 __field(blkcnt_t, blocks)
177 __field(__u8, advise)
178 ),
179
180 TP_fast_assign(
181 __entry->dev = inode->i_sb->s_dev;
182 __entry->ino = inode->i_ino;
183 __entry->pino = F2FS_I(inode)->i_pino;
184 __entry->mode = inode->i_mode;
185 __entry->nlink = inode->i_nlink;
186 __entry->size = inode->i_size;
187 __entry->blocks = inode->i_blocks;
188 __entry->advise = F2FS_I(inode)->i_advise;
189 ),
190
191 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
192 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
193 show_dev_ino(__entry),
194 (unsigned long)__entry->pino,
195 __entry->mode,
196 __entry->size,
197 (unsigned int)__entry->nlink,
198 (unsigned long long)__entry->blocks,
199 (unsigned char)__entry->advise)
200);
201
202DECLARE_EVENT_CLASS(f2fs__inode_exit,
203
204 TP_PROTO(struct inode *inode, int ret),
205
206 TP_ARGS(inode, ret),
207
208 TP_STRUCT__entry(
209 __field(dev_t, dev)
210 __field(ino_t, ino)
211 __field(int, ret)
212 ),
213
214 TP_fast_assign(
215 __entry->dev = inode->i_sb->s_dev;
216 __entry->ino = inode->i_ino;
217 __entry->ret = ret;
218 ),
219
220 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
221 show_dev_ino(__entry),
222 __entry->ret)
223);
224
225DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
226
227 TP_PROTO(struct inode *inode),
228
229 TP_ARGS(inode)
230);
231
232TRACE_EVENT(f2fs_sync_file_exit,
233
Chao Yua5fd5052017-11-06 22:51:45 +0800234 TP_PROTO(struct inode *inode, int cp_reason, int datasync, int ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900235
Chao Yua5fd5052017-11-06 22:51:45 +0800236 TP_ARGS(inode, cp_reason, datasync, ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900237
238 TP_STRUCT__entry(
239 __field(dev_t, dev)
240 __field(ino_t, ino)
Chao Yua5fd5052017-11-06 22:51:45 +0800241 __field(int, cp_reason)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900242 __field(int, datasync)
243 __field(int, ret)
244 ),
245
246 TP_fast_assign(
247 __entry->dev = inode->i_sb->s_dev;
248 __entry->ino = inode->i_ino;
Chao Yua5fd5052017-11-06 22:51:45 +0800249 __entry->cp_reason = cp_reason;
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900250 __entry->datasync = datasync;
251 __entry->ret = ret;
252 ),
253
Chao Yua5fd5052017-11-06 22:51:45 +0800254 TP_printk("dev = (%d,%d), ino = %lu, cp_reason: %s, "
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900255 "datasync = %d, ret = %d",
256 show_dev_ino(__entry),
Chao Yua5fd5052017-11-06 22:51:45 +0800257 show_fsync_cpreason(__entry->cp_reason),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900258 __entry->datasync,
259 __entry->ret)
260);
261
262TRACE_EVENT(f2fs_sync_fs,
263
264 TP_PROTO(struct super_block *sb, int wait),
265
266 TP_ARGS(sb, wait),
267
268 TP_STRUCT__entry(
269 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800270 __field(int, dirty)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900271 __field(int, wait)
272 ),
273
274 TP_fast_assign(
275 __entry->dev = sb->s_dev;
Chao Yucaf00472015-01-28 17:48:42 +0800276 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900277 __entry->wait = wait;
278 ),
279
280 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800281 show_dev(__entry->dev),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900282 __entry->dirty ? "dirty" : "not dirty",
283 __entry->wait)
284);
285
286DEFINE_EVENT(f2fs__inode, f2fs_iget,
287
288 TP_PROTO(struct inode *inode),
289
290 TP_ARGS(inode)
291);
292
293DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
294
295 TP_PROTO(struct inode *inode, int ret),
296
297 TP_ARGS(inode, ret)
298);
299
300DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
301
302 TP_PROTO(struct inode *inode),
303
304 TP_ARGS(inode)
305);
306
Jaegeuk Kimd70b4f52013-04-25 13:24:33 +0900307DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
308
309 TP_PROTO(struct inode *inode, int ret),
310
311 TP_ARGS(inode, ret)
312);
313
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900314TRACE_EVENT(f2fs_unlink_enter,
315
316 TP_PROTO(struct inode *dir, struct dentry *dentry),
317
318 TP_ARGS(dir, dentry),
319
320 TP_STRUCT__entry(
321 __field(dev_t, dev)
322 __field(ino_t, ino)
323 __field(loff_t, size)
324 __field(blkcnt_t, blocks)
325 __field(const char *, name)
326 ),
327
328 TP_fast_assign(
329 __entry->dev = dir->i_sb->s_dev;
330 __entry->ino = dir->i_ino;
331 __entry->size = dir->i_size;
332 __entry->blocks = dir->i_blocks;
333 __entry->name = dentry->d_name.name;
334 ),
335
336 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
337 "i_blocks = %llu, name = %s",
338 show_dev_ino(__entry),
339 __entry->size,
340 (unsigned long long)__entry->blocks,
341 __entry->name)
342);
343
344DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
345
346 TP_PROTO(struct inode *inode, int ret),
347
348 TP_ARGS(inode, ret)
349);
Namjae Jeon51dd6242013-04-20 01:28:52 +0900350
Hou Pengyangb8d96a32017-02-27 13:02:58 +0000351DEFINE_EVENT(f2fs__inode_exit, f2fs_drop_inode,
352
353 TP_PROTO(struct inode *inode, int ret),
354
355 TP_ARGS(inode, ret)
356);
357
Namjae Jeon51dd6242013-04-20 01:28:52 +0900358DEFINE_EVENT(f2fs__inode, f2fs_truncate,
359
360 TP_PROTO(struct inode *inode),
361
362 TP_ARGS(inode)
363);
364
365TRACE_EVENT(f2fs_truncate_data_blocks_range,
366
367 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
368
369 TP_ARGS(inode, nid, ofs, free),
370
371 TP_STRUCT__entry(
372 __field(dev_t, dev)
373 __field(ino_t, ino)
374 __field(nid_t, nid)
375 __field(unsigned int, ofs)
376 __field(int, free)
377 ),
378
379 TP_fast_assign(
380 __entry->dev = inode->i_sb->s_dev;
381 __entry->ino = inode->i_ino;
382 __entry->nid = nid;
383 __entry->ofs = ofs;
384 __entry->free = free;
385 ),
386
387 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
388 show_dev_ino(__entry),
389 (unsigned int)__entry->nid,
390 __entry->ofs,
391 __entry->free)
392);
393
394DECLARE_EVENT_CLASS(f2fs__truncate_op,
395
396 TP_PROTO(struct inode *inode, u64 from),
397
398 TP_ARGS(inode, from),
399
400 TP_STRUCT__entry(
401 __field(dev_t, dev)
402 __field(ino_t, ino)
403 __field(loff_t, size)
404 __field(blkcnt_t, blocks)
405 __field(u64, from)
406 ),
407
408 TP_fast_assign(
409 __entry->dev = inode->i_sb->s_dev;
410 __entry->ino = inode->i_ino;
411 __entry->size = inode->i_size;
412 __entry->blocks = inode->i_blocks;
413 __entry->from = from;
414 ),
415
416 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
417 "start file offset = %llu",
418 show_dev_ino(__entry),
419 __entry->size,
420 (unsigned long long)__entry->blocks,
421 (unsigned long long)__entry->from)
422);
423
424DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
425
426 TP_PROTO(struct inode *inode, u64 from),
427
428 TP_ARGS(inode, from)
429);
430
431DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
432
433 TP_PROTO(struct inode *inode, int ret),
434
435 TP_ARGS(inode, ret)
436);
437
438DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
439
440 TP_PROTO(struct inode *inode, u64 from),
441
442 TP_ARGS(inode, from)
443);
444
445DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
446
447 TP_PROTO(struct inode *inode, int ret),
448
449 TP_ARGS(inode, ret)
450);
451
452DECLARE_EVENT_CLASS(f2fs__truncate_node,
453
454 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
455
456 TP_ARGS(inode, nid, blk_addr),
457
458 TP_STRUCT__entry(
459 __field(dev_t, dev)
460 __field(ino_t, ino)
461 __field(nid_t, nid)
462 __field(block_t, blk_addr)
463 ),
464
465 TP_fast_assign(
466 __entry->dev = inode->i_sb->s_dev;
467 __entry->ino = inode->i_ino;
468 __entry->nid = nid;
469 __entry->blk_addr = blk_addr;
470 ),
471
472 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
473 show_dev_ino(__entry),
474 (unsigned int)__entry->nid,
475 (unsigned long long)__entry->blk_addr)
476);
477
478DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
479
480 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
481
482 TP_ARGS(inode, nid, blk_addr)
483);
484
485DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
486
487 TP_PROTO(struct inode *inode, int ret),
488
489 TP_ARGS(inode, ret)
490);
491
492DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
493
494 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
495
496 TP_ARGS(inode, nid, blk_addr)
497);
498
499TRACE_EVENT(f2fs_truncate_partial_nodes,
500
Alexei Starovoitovc1055472018-03-28 12:05:32 -0700501 TP_PROTO(struct inode *inode, nid_t *nid, int depth, int err),
Namjae Jeon51dd6242013-04-20 01:28:52 +0900502
503 TP_ARGS(inode, nid, depth, err),
504
505 TP_STRUCT__entry(
506 __field(dev_t, dev)
507 __field(ino_t, ino)
508 __field(nid_t, nid[3])
509 __field(int, depth)
510 __field(int, err)
511 ),
512
513 TP_fast_assign(
514 __entry->dev = inode->i_sb->s_dev;
515 __entry->ino = inode->i_ino;
516 __entry->nid[0] = nid[0];
517 __entry->nid[1] = nid[1];
518 __entry->nid[2] = nid[2];
519 __entry->depth = depth;
520 __entry->err = err;
521 ),
522
523 TP_printk("dev = (%d,%d), ino = %lu, "
524 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
525 show_dev_ino(__entry),
526 (unsigned int)__entry->nid[0],
527 (unsigned int)__entry->nid[1],
528 (unsigned int)__entry->nid[2],
529 __entry->depth,
530 __entry->err)
531);
532
Chao Yu126ce722019-04-02 18:52:22 +0800533TRACE_EVENT(f2fs_file_write_iter,
534
535 TP_PROTO(struct inode *inode, unsigned long offset,
536 unsigned long length, int ret),
537
538 TP_ARGS(inode, offset, length, ret),
539
540 TP_STRUCT__entry(
541 __field(dev_t, dev)
542 __field(ino_t, ino)
543 __field(unsigned long, offset)
544 __field(unsigned long, length)
545 __field(int, ret)
546 ),
547
548 TP_fast_assign(
549 __entry->dev = inode->i_sb->s_dev;
550 __entry->ino = inode->i_ino;
551 __entry->offset = offset;
552 __entry->length = length;
553 __entry->ret = ret;
554 ),
555
556 TP_printk("dev = (%d,%d), ino = %lu, "
557 "offset = %lu, length = %lu, written(err) = %d",
558 show_dev_ino(__entry),
559 __entry->offset,
560 __entry->length,
561 __entry->ret)
562);
563
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700564TRACE_EVENT(f2fs_map_blocks,
565 TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900566
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700567 TP_ARGS(inode, map, ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900568
569 TP_STRUCT__entry(
570 __field(dev_t, dev)
571 __field(ino_t, ino)
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700572 __field(block_t, m_lblk)
573 __field(block_t, m_pblk)
574 __field(unsigned int, m_len)
Chao Yu76630f22019-02-26 19:01:16 +0800575 __field(unsigned int, m_flags)
576 __field(int, m_seg_type)
577 __field(bool, m_may_create)
Namjae Jeon848753a2013-04-23 16:38:02 +0900578 __field(int, ret)
579 ),
580
581 TP_fast_assign(
582 __entry->dev = inode->i_sb->s_dev;
583 __entry->ino = inode->i_ino;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700584 __entry->m_lblk = map->m_lblk;
585 __entry->m_pblk = map->m_pblk;
586 __entry->m_len = map->m_len;
Chao Yu76630f22019-02-26 19:01:16 +0800587 __entry->m_flags = map->m_flags;
588 __entry->m_seg_type = map->m_seg_type;
589 __entry->m_may_create = map->m_may_create;
Namjae Jeon848753a2013-04-23 16:38:02 +0900590 __entry->ret = ret;
591 ),
592
593 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
Chao Yu76630f22019-02-26 19:01:16 +0800594 "start blkaddr = 0x%llx, len = 0x%llx, flags = %u,"
595 "seg_type = %d, may_create = %d, err = %d",
Namjae Jeon848753a2013-04-23 16:38:02 +0900596 show_dev_ino(__entry),
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700597 (unsigned long long)__entry->m_lblk,
598 (unsigned long long)__entry->m_pblk,
599 (unsigned long long)__entry->m_len,
Chao Yu76630f22019-02-26 19:01:16 +0800600 __entry->m_flags,
601 __entry->m_seg_type,
602 __entry->m_may_create,
Namjae Jeon848753a2013-04-23 16:38:02 +0900603 __entry->ret)
604);
605
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700606TRACE_EVENT(f2fs_background_gc,
607
Chao Yub8c502b2017-08-07 23:12:46 +0800608 TP_PROTO(struct super_block *sb, unsigned int wait_ms,
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700609 unsigned int prefree, unsigned int free),
610
611 TP_ARGS(sb, wait_ms, prefree, free),
612
613 TP_STRUCT__entry(
614 __field(dev_t, dev)
Chao Yub8c502b2017-08-07 23:12:46 +0800615 __field(unsigned int, wait_ms)
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700616 __field(unsigned int, prefree)
617 __field(unsigned int, free)
618 ),
619
620 TP_fast_assign(
621 __entry->dev = sb->s_dev;
622 __entry->wait_ms = wait_ms;
623 __entry->prefree = prefree;
624 __entry->free = free;
625 ),
626
Chao Yub8c502b2017-08-07 23:12:46 +0800627 TP_printk("dev = (%d,%d), wait_ms = %u, prefree = %u, free = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800628 show_dev(__entry->dev),
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700629 __entry->wait_ms,
630 __entry->prefree,
631 __entry->free)
632);
633
Chao Yuc56f16d2017-08-11 18:00:15 +0800634TRACE_EVENT(f2fs_gc_begin,
635
636 TP_PROTO(struct super_block *sb, bool sync, bool background,
637 long long dirty_nodes, long long dirty_dents,
638 long long dirty_imeta, unsigned int free_sec,
639 unsigned int free_seg, int reserved_seg,
640 unsigned int prefree_seg),
641
642 TP_ARGS(sb, sync, background, dirty_nodes, dirty_dents, dirty_imeta,
643 free_sec, free_seg, reserved_seg, prefree_seg),
644
645 TP_STRUCT__entry(
646 __field(dev_t, dev)
647 __field(bool, sync)
648 __field(bool, background)
649 __field(long long, dirty_nodes)
650 __field(long long, dirty_dents)
651 __field(long long, dirty_imeta)
652 __field(unsigned int, free_sec)
653 __field(unsigned int, free_seg)
654 __field(int, reserved_seg)
655 __field(unsigned int, prefree_seg)
656 ),
657
658 TP_fast_assign(
659 __entry->dev = sb->s_dev;
660 __entry->sync = sync;
661 __entry->background = background;
662 __entry->dirty_nodes = dirty_nodes;
663 __entry->dirty_dents = dirty_dents;
664 __entry->dirty_imeta = dirty_imeta;
665 __entry->free_sec = free_sec;
666 __entry->free_seg = free_seg;
667 __entry->reserved_seg = reserved_seg;
668 __entry->prefree_seg = prefree_seg;
669 ),
670
671 TP_printk("dev = (%d,%d), sync = %d, background = %d, nodes = %lld, "
672 "dents = %lld, imeta = %lld, free_sec:%u, free_seg:%u, "
673 "rsv_seg:%d, prefree_seg:%u",
674 show_dev(__entry->dev),
675 __entry->sync,
676 __entry->background,
677 __entry->dirty_nodes,
678 __entry->dirty_dents,
679 __entry->dirty_imeta,
680 __entry->free_sec,
681 __entry->free_seg,
682 __entry->reserved_seg,
683 __entry->prefree_seg)
684);
685
686TRACE_EVENT(f2fs_gc_end,
687
688 TP_PROTO(struct super_block *sb, int ret, int seg_freed,
689 int sec_freed, long long dirty_nodes,
690 long long dirty_dents, long long dirty_imeta,
691 unsigned int free_sec, unsigned int free_seg,
692 int reserved_seg, unsigned int prefree_seg),
693
694 TP_ARGS(sb, ret, seg_freed, sec_freed, dirty_nodes, dirty_dents,
695 dirty_imeta, free_sec, free_seg, reserved_seg, prefree_seg),
696
697 TP_STRUCT__entry(
698 __field(dev_t, dev)
699 __field(int, ret)
700 __field(int, seg_freed)
701 __field(int, sec_freed)
702 __field(long long, dirty_nodes)
703 __field(long long, dirty_dents)
704 __field(long long, dirty_imeta)
705 __field(unsigned int, free_sec)
706 __field(unsigned int, free_seg)
707 __field(int, reserved_seg)
708 __field(unsigned int, prefree_seg)
709 ),
710
711 TP_fast_assign(
712 __entry->dev = sb->s_dev;
713 __entry->ret = ret;
714 __entry->seg_freed = seg_freed;
715 __entry->sec_freed = sec_freed;
716 __entry->dirty_nodes = dirty_nodes;
717 __entry->dirty_dents = dirty_dents;
718 __entry->dirty_imeta = dirty_imeta;
719 __entry->free_sec = free_sec;
720 __entry->free_seg = free_seg;
721 __entry->reserved_seg = reserved_seg;
722 __entry->prefree_seg = prefree_seg;
723 ),
724
725 TP_printk("dev = (%d,%d), ret = %d, seg_freed = %d, sec_freed = %d, "
726 "nodes = %lld, dents = %lld, imeta = %lld, free_sec:%u, "
727 "free_seg:%u, rsv_seg:%d, prefree_seg:%u",
728 show_dev(__entry->dev),
729 __entry->ret,
730 __entry->seg_freed,
731 __entry->sec_freed,
732 __entry->dirty_nodes,
733 __entry->dirty_dents,
734 __entry->dirty_imeta,
735 __entry->free_sec,
736 __entry->free_seg,
737 __entry->reserved_seg,
738 __entry->prefree_seg)
739);
740
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900741TRACE_EVENT(f2fs_get_victim,
742
743 TP_PROTO(struct super_block *sb, int type, int gc_type,
744 struct victim_sel_policy *p, unsigned int pre_victim,
745 unsigned int prefree, unsigned int free),
746
747 TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
748
749 TP_STRUCT__entry(
750 __field(dev_t, dev)
751 __field(int, type)
752 __field(int, gc_type)
753 __field(int, alloc_mode)
754 __field(int, gc_mode)
755 __field(unsigned int, victim)
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800756 __field(unsigned int, cost)
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900757 __field(unsigned int, ofs_unit)
758 __field(unsigned int, pre_victim)
759 __field(unsigned int, prefree)
760 __field(unsigned int, free)
761 ),
762
763 TP_fast_assign(
764 __entry->dev = sb->s_dev;
765 __entry->type = type;
766 __entry->gc_type = gc_type;
767 __entry->alloc_mode = p->alloc_mode;
768 __entry->gc_mode = p->gc_mode;
769 __entry->victim = p->min_segno;
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800770 __entry->cost = p->min_cost;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900771 __entry->ofs_unit = p->ofs_unit;
772 __entry->pre_victim = pre_victim;
773 __entry->prefree = prefree;
774 __entry->free = free;
775 ),
776
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800777 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), "
778 "victim = %u, cost = %u, ofs_unit = %u, "
779 "pre_victim_secno = %d, prefree = %u, free = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800780 show_dev(__entry->dev),
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900781 show_data_type(__entry->type),
782 show_gc_type(__entry->gc_type),
783 show_alloc_mode(__entry->alloc_mode),
784 show_victim_policy(__entry->gc_mode),
785 __entry->victim,
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800786 __entry->cost,
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900787 __entry->ofs_unit,
788 (int)__entry->pre_victim,
789 __entry->prefree,
790 __entry->free)
791);
792
Chao Yu0c5e36d2017-10-17 17:33:41 +0800793TRACE_EVENT(f2fs_lookup_start,
794
795 TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags),
796
797 TP_ARGS(dir, dentry, flags),
798
799 TP_STRUCT__entry(
800 __field(dev_t, dev)
801 __field(ino_t, ino)
802 __field(const char *, name)
803 __field(unsigned int, flags)
804 ),
805
806 TP_fast_assign(
807 __entry->dev = dir->i_sb->s_dev;
808 __entry->ino = dir->i_ino;
809 __entry->name = dentry->d_name.name;
810 __entry->flags = flags;
811 ),
812
813 TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u",
814 show_dev_ino(__entry),
815 __entry->name,
816 __entry->flags)
817);
818
819TRACE_EVENT(f2fs_lookup_end,
820
821 TP_PROTO(struct inode *dir, struct dentry *dentry, nid_t ino,
822 int err),
823
824 TP_ARGS(dir, dentry, ino, err),
825
826 TP_STRUCT__entry(
827 __field(dev_t, dev)
828 __field(ino_t, ino)
829 __field(const char *, name)
830 __field(nid_t, cino)
831 __field(int, err)
832 ),
833
834 TP_fast_assign(
835 __entry->dev = dir->i_sb->s_dev;
836 __entry->ino = dir->i_ino;
837 __entry->name = dentry->d_name.name;
838 __entry->cino = ino;
839 __entry->err = err;
840 ),
841
842 TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d",
843 show_dev_ino(__entry),
844 __entry->name,
845 __entry->cino,
846 __entry->err)
847);
848
Chao Yue97a3c42017-10-13 18:01:33 +0800849TRACE_EVENT(f2fs_readdir,
850
851 TP_PROTO(struct inode *dir, loff_t start_pos, loff_t end_pos, int err),
852
853 TP_ARGS(dir, start_pos, end_pos, err),
854
855 TP_STRUCT__entry(
856 __field(dev_t, dev)
857 __field(ino_t, ino)
858 __field(loff_t, start)
859 __field(loff_t, end)
860 __field(int, err)
861 ),
862
863 TP_fast_assign(
864 __entry->dev = dir->i_sb->s_dev;
865 __entry->ino = dir->i_ino;
866 __entry->start = start_pos;
867 __entry->end = end_pos;
868 __entry->err = err;
869 ),
870
871 TP_printk("dev = (%d,%d), ino = %lu, start_pos:%llu, end_pos:%llu, err:%d",
872 show_dev_ino(__entry),
873 __entry->start,
874 __entry->end,
875 __entry->err)
876);
877
Namjae Jeonc01e2852013-04-23 17:00:52 +0900878TRACE_EVENT(f2fs_fallocate,
879
880 TP_PROTO(struct inode *inode, int mode,
881 loff_t offset, loff_t len, int ret),
882
883 TP_ARGS(inode, mode, offset, len, ret),
884
885 TP_STRUCT__entry(
886 __field(dev_t, dev)
887 __field(ino_t, ino)
888 __field(int, mode)
889 __field(loff_t, offset)
890 __field(loff_t, len)
891 __field(loff_t, size)
892 __field(blkcnt_t, blocks)
893 __field(int, ret)
894 ),
895
896 TP_fast_assign(
897 __entry->dev = inode->i_sb->s_dev;
898 __entry->ino = inode->i_ino;
899 __entry->mode = mode;
900 __entry->offset = offset;
901 __entry->len = len;
902 __entry->size = inode->i_size;
903 __entry->blocks = inode->i_blocks;
904 __entry->ret = ret;
905 ),
906
907 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
908 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
909 show_dev_ino(__entry),
910 __entry->mode,
911 (unsigned long long)__entry->offset,
912 (unsigned long long)__entry->len,
913 (unsigned long long)__entry->size,
914 (unsigned long long)__entry->blocks,
915 __entry->ret)
916);
917
Chao Yu70407fa2014-07-31 21:11:22 +0800918TRACE_EVENT(f2fs_direct_IO_enter,
919
920 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
921
922 TP_ARGS(inode, offset, len, rw),
923
924 TP_STRUCT__entry(
925 __field(dev_t, dev)
926 __field(ino_t, ino)
927 __field(loff_t, pos)
928 __field(unsigned long, len)
929 __field(int, rw)
930 ),
931
932 TP_fast_assign(
933 __entry->dev = inode->i_sb->s_dev;
934 __entry->ino = inode->i_ino;
935 __entry->pos = offset;
936 __entry->len = len;
937 __entry->rw = rw;
938 ),
939
940 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
941 show_dev_ino(__entry),
942 __entry->pos,
943 __entry->len,
944 __entry->rw)
945);
946
947TRACE_EVENT(f2fs_direct_IO_exit,
948
949 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
950 int rw, int ret),
951
952 TP_ARGS(inode, offset, len, rw, ret),
953
954 TP_STRUCT__entry(
955 __field(dev_t, dev)
956 __field(ino_t, ino)
957 __field(loff_t, pos)
958 __field(unsigned long, len)
959 __field(int, rw)
960 __field(int, ret)
961 ),
962
963 TP_fast_assign(
964 __entry->dev = inode->i_sb->s_dev;
965 __entry->ino = inode->i_ino;
966 __entry->pos = offset;
967 __entry->len = len;
968 __entry->rw = rw;
969 __entry->ret = ret;
970 ),
971
972 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
973 "rw = %d ret = %d",
974 show_dev_ino(__entry),
975 __entry->pos,
976 __entry->len,
977 __entry->rw,
978 __entry->ret)
979);
980
Chao Yu46008c62016-05-09 19:56:30 +0800981TRACE_EVENT(f2fs_reserve_new_blocks,
Namjae Jeonc01e2852013-04-23 17:00:52 +0900982
Chao Yu46008c62016-05-09 19:56:30 +0800983 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node,
984 blkcnt_t count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900985
Chao Yu46008c62016-05-09 19:56:30 +0800986 TP_ARGS(inode, nid, ofs_in_node, count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900987
988 TP_STRUCT__entry(
989 __field(dev_t, dev)
990 __field(nid_t, nid)
991 __field(unsigned int, ofs_in_node)
Chao Yu46008c62016-05-09 19:56:30 +0800992 __field(blkcnt_t, count)
Namjae Jeonc01e2852013-04-23 17:00:52 +0900993 ),
994
995 TP_fast_assign(
996 __entry->dev = inode->i_sb->s_dev;
997 __entry->nid = nid;
998 __entry->ofs_in_node = ofs_in_node;
Chao Yu46008c62016-05-09 19:56:30 +0800999 __entry->count = count;
Namjae Jeonc01e2852013-04-23 17:00:52 +09001000 ),
1001
Chao Yu46008c62016-05-09 19:56:30 +08001002 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001003 show_dev(__entry->dev),
Namjae Jeonc01e2852013-04-23 17:00:52 +09001004 (unsigned int)__entry->nid,
Chao Yu46008c62016-05-09 19:56:30 +08001005 __entry->ofs_in_node,
1006 (unsigned long long)__entry->count)
Namjae Jeonc01e2852013-04-23 17:00:52 +09001007);
1008
Chao Yu3e1c8f12014-12-23 16:35:21 +08001009DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
1010
Chao Yu2ace38e2014-12-24 16:08:14 +08001011 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001012
Chao Yu2ace38e2014-12-24 16:08:14 +08001013 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001014
1015 TP_STRUCT__entry(
1016 __field(dev_t, dev)
1017 __field(ino_t, ino)
1018 __field(pgoff_t, index)
Chao Yu7a9d7542016-02-22 18:36:38 +08001019 __field(block_t, old_blkaddr)
1020 __field(block_t, new_blkaddr)
Mike Christie04d328d2016-06-05 14:31:55 -05001021 __field(int, op)
1022 __field(int, op_flags)
Jaegeuk Kima912b542017-05-10 11:18:25 -07001023 __field(int, temp)
Chao Yu3e1c8f12014-12-23 16:35:21 +08001024 __field(int, type)
1025 ),
1026
1027 TP_fast_assign(
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001028 __entry->dev = page_file_mapping(page)->host->i_sb->s_dev;
1029 __entry->ino = page_file_mapping(page)->host->i_ino;
Chao Yu3e1c8f12014-12-23 16:35:21 +08001030 __entry->index = page->index;
Chao Yu7a9d7542016-02-22 18:36:38 +08001031 __entry->old_blkaddr = fio->old_blkaddr;
1032 __entry->new_blkaddr = fio->new_blkaddr;
Mike Christie04d328d2016-06-05 14:31:55 -05001033 __entry->op = fio->op;
1034 __entry->op_flags = fio->op_flags;
Jaegeuk Kima912b542017-05-10 11:18:25 -07001035 __entry->temp = fio->temp;
Chao Yu2ace38e2014-12-24 16:08:14 +08001036 __entry->type = fio->type;
Chao Yu3e1c8f12014-12-23 16:35:21 +08001037 ),
1038
1039 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
Jaegeuk Kima912b542017-05-10 11:18:25 -07001040 "oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s",
Chao Yu3e1c8f12014-12-23 16:35:21 +08001041 show_dev_ino(__entry),
1042 (unsigned long)__entry->index,
Chao Yu7a9d7542016-02-22 18:36:38 +08001043 (unsigned long long)__entry->old_blkaddr,
1044 (unsigned long long)__entry->new_blkaddr,
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -08001045 show_bio_type(__entry->op, __entry->op_flags),
Jaegeuk Kima912b542017-05-10 11:18:25 -07001046 show_block_temp(__entry->temp),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001047 show_block_type(__entry->type))
1048);
1049
1050DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
1051
Chao Yu2ace38e2014-12-24 16:08:14 +08001052 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001053
Chao Yu2ace38e2014-12-24 16:08:14 +08001054 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001055
1056 TP_CONDITION(page->mapping)
1057);
1058
Jaegeuk Kimb9109b02017-05-10 11:28:38 -07001059DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_write,
Chao Yu3e1c8f12014-12-23 16:35:21 +08001060
Chao Yu2ace38e2014-12-24 16:08:14 +08001061 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001062
Chao Yu2ace38e2014-12-24 16:08:14 +08001063 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001064
1065 TP_CONDITION(page->mapping)
1066);
1067
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001068DECLARE_EVENT_CLASS(f2fs__bio,
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001069
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001070 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001071
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001072 TP_ARGS(sb, type, bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001073
1074 TP_STRUCT__entry(
1075 __field(dev_t, dev)
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001076 __field(dev_t, target)
Mike Christie04d328d2016-06-05 14:31:55 -05001077 __field(int, op)
1078 __field(int, op_flags)
Chao Yud4d288b2013-11-24 12:36:42 +09001079 __field(int, type)
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001080 __field(sector_t, sector)
1081 __field(unsigned int, size)
1082 ),
1083
1084 TP_fast_assign(
1085 __entry->dev = sb->s_dev;
Christoph Hellwig74d46992017-08-23 19:10:32 +02001086 __entry->target = bio_dev(bio);
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001087 __entry->op = bio_op(bio);
1088 __entry->op_flags = bio->bi_opf;
1089 __entry->type = type;
Kent Overstreet4f024f32013-10-11 15:44:27 -07001090 __entry->sector = bio->bi_iter.bi_sector;
1091 __entry->size = bio->bi_iter.bi_size;
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001092 ),
1093
Chao Yubaaabbb2017-05-04 09:35:43 +08001094 TP_printk("dev = (%d,%d)/(%d,%d), rw = %s(%s), %s, sector = %lld, size = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001095 show_dev(__entry->target),
1096 show_dev(__entry->dev),
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -08001097 show_bio_type(__entry->op, __entry->op_flags),
Chao Yud4d288b2013-11-24 12:36:42 +09001098 show_block_type(__entry->type),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001099 (unsigned long long)__entry->sector,
1100 __entry->size)
1101);
1102
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001103DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio,
Chao Yud4d288b2013-11-24 12:36:42 +09001104
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001105 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +09001106
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001107 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +09001108
1109 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +09001110);
1111
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001112DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio,
Chao Yud4d288b2013-11-24 12:36:42 +09001113
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001114 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +09001115
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001116 TP_ARGS(sb, type, bio),
1117
1118 TP_CONDITION(bio)
1119);
1120
1121DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_read_bio,
1122
1123 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1124
1125 TP_ARGS(sb, type, bio),
1126
1127 TP_CONDITION(bio)
1128);
1129
1130DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio,
1131
1132 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1133
1134 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +09001135
1136 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +09001137);
1138
Chao Yu62aed042014-05-06 16:46:04 +08001139TRACE_EVENT(f2fs_write_begin,
1140
1141 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1142 unsigned int flags),
1143
1144 TP_ARGS(inode, pos, len, flags),
1145
1146 TP_STRUCT__entry(
1147 __field(dev_t, dev)
1148 __field(ino_t, ino)
1149 __field(loff_t, pos)
1150 __field(unsigned int, len)
1151 __field(unsigned int, flags)
1152 ),
1153
1154 TP_fast_assign(
1155 __entry->dev = inode->i_sb->s_dev;
1156 __entry->ino = inode->i_ino;
1157 __entry->pos = pos;
1158 __entry->len = len;
1159 __entry->flags = flags;
1160 ),
1161
1162 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
1163 show_dev_ino(__entry),
1164 (unsigned long long)__entry->pos,
1165 __entry->len,
1166 __entry->flags)
1167);
1168
Chao Yudfb2bf32014-05-06 16:47:23 +08001169TRACE_EVENT(f2fs_write_end,
1170
1171 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1172 unsigned int copied),
1173
1174 TP_ARGS(inode, pos, len, copied),
1175
1176 TP_STRUCT__entry(
1177 __field(dev_t, dev)
1178 __field(ino_t, ino)
1179 __field(loff_t, pos)
1180 __field(unsigned int, len)
1181 __field(unsigned int, copied)
1182 ),
1183
1184 TP_fast_assign(
1185 __entry->dev = inode->i_sb->s_dev;
1186 __entry->ino = inode->i_ino;
1187 __entry->pos = pos;
1188 __entry->len = len;
1189 __entry->copied = copied;
1190 ),
1191
1192 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
1193 show_dev_ino(__entry),
1194 (unsigned long long)__entry->pos,
1195 __entry->len,
1196 __entry->copied)
1197);
1198
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001199DECLARE_EVENT_CLASS(f2fs__page,
1200
1201 TP_PROTO(struct page *page, int type),
1202
1203 TP_ARGS(page, type),
1204
1205 TP_STRUCT__entry(
1206 __field(dev_t, dev)
1207 __field(ino_t, ino)
1208 __field(int, type)
1209 __field(int, dir)
1210 __field(pgoff_t, index)
1211 __field(int, dirty)
Chao Yuc20e89c2014-05-06 16:53:08 +08001212 __field(int, uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001213 ),
1214
1215 TP_fast_assign(
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001216 __entry->dev = page_file_mapping(page)->host->i_sb->s_dev;
1217 __entry->ino = page_file_mapping(page)->host->i_ino;
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001218 __entry->type = type;
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001219 __entry->dir =
1220 S_ISDIR(page_file_mapping(page)->host->i_mode);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001221 __entry->index = page->index;
1222 __entry->dirty = PageDirty(page);
Chao Yuc20e89c2014-05-06 16:53:08 +08001223 __entry->uptodate = PageUptodate(page);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001224 ),
1225
Chao Yuc20e89c2014-05-06 16:53:08 +08001226 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
1227 "dirty = %d, uptodate = %d",
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001228 show_dev_ino(__entry),
1229 show_block_type(__entry->type),
1230 show_file_type(__entry->dir),
1231 (unsigned long)__entry->index,
Chao Yuc20e89c2014-05-06 16:53:08 +08001232 __entry->dirty,
1233 __entry->uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001234);
1235
Chao Yuecda0de2014-05-06 16:48:26 +08001236DEFINE_EVENT(f2fs__page, f2fs_writepage,
1237
1238 TP_PROTO(struct page *page, int type),
1239
1240 TP_ARGS(page, type)
1241);
1242
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -07001243DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
1244
1245 TP_PROTO(struct page *page, int type),
1246
1247 TP_ARGS(page, type)
1248);
1249
Chao Yuc20e89c2014-05-06 16:53:08 +08001250DEFINE_EVENT(f2fs__page, f2fs_readpage,
1251
1252 TP_PROTO(struct page *page, int type),
1253
1254 TP_ARGS(page, type)
1255);
1256
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001257DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
1258
1259 TP_PROTO(struct page *page, int type),
1260
1261 TP_ARGS(page, type)
1262);
1263
Jaegeuk Kime943a102013-10-25 14:26:31 +09001264DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
1265
1266 TP_PROTO(struct page *page, int type),
1267
1268 TP_ARGS(page, type)
1269);
1270
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -07001271DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
1272
1273 TP_PROTO(struct page *page, int type),
1274
1275 TP_ARGS(page, type)
1276);
1277
1278DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
1279
1280 TP_PROTO(struct page *page, int type),
1281
1282 TP_ARGS(page, type)
1283);
1284
Chao Yud7648342019-04-15 15:22:19 +08001285TRACE_EVENT(f2fs_filemap_fault,
1286
1287 TP_PROTO(struct inode *inode, pgoff_t index, unsigned long ret),
1288
1289 TP_ARGS(inode, index, ret),
1290
1291 TP_STRUCT__entry(
1292 __field(dev_t, dev)
1293 __field(ino_t, ino)
1294 __field(pgoff_t, index)
1295 __field(unsigned long, ret)
1296 ),
1297
1298 TP_fast_assign(
1299 __entry->dev = inode->i_sb->s_dev;
1300 __entry->ino = inode->i_ino;
1301 __entry->index = index;
1302 __entry->ret = ret;
1303 ),
1304
1305 TP_printk("dev = (%d,%d), ino = %lu, index = %lu, ret = %lx",
1306 show_dev_ino(__entry),
1307 (unsigned long)__entry->index,
1308 __entry->ret)
1309);
1310
Chao Yue5748432014-05-06 16:51:24 +08001311TRACE_EVENT(f2fs_writepages,
1312
1313 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
1314
1315 TP_ARGS(inode, wbc, type),
1316
1317 TP_STRUCT__entry(
1318 __field(dev_t, dev)
1319 __field(ino_t, ino)
1320 __field(int, type)
1321 __field(int, dir)
1322 __field(long, nr_to_write)
1323 __field(long, pages_skipped)
1324 __field(loff_t, range_start)
1325 __field(loff_t, range_end)
1326 __field(pgoff_t, writeback_index)
1327 __field(int, sync_mode)
1328 __field(char, for_kupdate)
1329 __field(char, for_background)
1330 __field(char, tagged_writepages)
1331 __field(char, for_reclaim)
1332 __field(char, range_cyclic)
1333 __field(char, for_sync)
1334 ),
1335
1336 TP_fast_assign(
1337 __entry->dev = inode->i_sb->s_dev;
1338 __entry->ino = inode->i_ino;
1339 __entry->type = type;
1340 __entry->dir = S_ISDIR(inode->i_mode);
1341 __entry->nr_to_write = wbc->nr_to_write;
1342 __entry->pages_skipped = wbc->pages_skipped;
1343 __entry->range_start = wbc->range_start;
1344 __entry->range_end = wbc->range_end;
1345 __entry->writeback_index = inode->i_mapping->writeback_index;
1346 __entry->sync_mode = wbc->sync_mode;
1347 __entry->for_kupdate = wbc->for_kupdate;
1348 __entry->for_background = wbc->for_background;
1349 __entry->tagged_writepages = wbc->tagged_writepages;
1350 __entry->for_reclaim = wbc->for_reclaim;
1351 __entry->range_cyclic = wbc->range_cyclic;
1352 __entry->for_sync = wbc->for_sync;
1353 ),
1354
1355 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1356 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1357 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1358 show_dev_ino(__entry),
1359 show_block_type(__entry->type),
1360 show_file_type(__entry->dir),
1361 __entry->nr_to_write,
1362 __entry->pages_skipped,
1363 __entry->range_start,
1364 __entry->range_end,
1365 (unsigned long)__entry->writeback_index,
1366 __entry->sync_mode,
1367 __entry->for_kupdate,
1368 __entry->for_background,
1369 __entry->tagged_writepages,
1370 __entry->for_reclaim,
1371 __entry->range_cyclic,
1372 __entry->for_sync)
1373);
1374
Chao Yub8c29402015-10-12 17:02:26 +08001375TRACE_EVENT(f2fs_readpages,
1376
1377 TP_PROTO(struct inode *inode, struct page *page, unsigned int nrpage),
1378
1379 TP_ARGS(inode, page, nrpage),
1380
1381 TP_STRUCT__entry(
1382 __field(dev_t, dev)
1383 __field(ino_t, ino)
1384 __field(pgoff_t, start)
1385 __field(unsigned int, nrpage)
1386 ),
1387
1388 TP_fast_assign(
1389 __entry->dev = inode->i_sb->s_dev;
1390 __entry->ino = inode->i_ino;
1391 __entry->start = page->index;
1392 __entry->nrpage = nrpage;
1393 ),
1394
1395 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1396 show_dev_ino(__entry),
1397 (unsigned long)__entry->start,
1398 __entry->nrpage)
1399);
1400
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001401TRACE_EVENT(f2fs_write_checkpoint,
1402
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001403 TP_PROTO(struct super_block *sb, int reason, char *msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001404
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001405 TP_ARGS(sb, reason, msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001406
1407 TP_STRUCT__entry(
1408 __field(dev_t, dev)
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001409 __field(int, reason)
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001410 __field(char *, msg)
1411 ),
1412
1413 TP_fast_assign(
1414 __entry->dev = sb->s_dev;
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001415 __entry->reason = reason;
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001416 __entry->msg = msg;
1417 ),
1418
1419 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001420 show_dev(__entry->dev),
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001421 show_cpreason(__entry->reason),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001422 __entry->msg)
1423);
1424
Chao Yu0243a5f2017-04-15 14:09:38 +08001425DECLARE_EVENT_CLASS(f2fs_discard,
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001426
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001427 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001428
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001429 TP_ARGS(dev, blkstart, blklen),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001430
1431 TP_STRUCT__entry(
1432 __field(dev_t, dev)
1433 __field(block_t, blkstart)
1434 __field(block_t, blklen)
1435 ),
1436
1437 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001438 __entry->dev = dev->bd_dev;
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001439 __entry->blkstart = blkstart;
1440 __entry->blklen = blklen;
1441 ),
1442
1443 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001444 show_dev(__entry->dev),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001445 (unsigned long long)__entry->blkstart,
1446 (unsigned long long)__entry->blklen)
1447);
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001448
Chao Yu0243a5f2017-04-15 14:09:38 +08001449DEFINE_EVENT(f2fs_discard, f2fs_queue_discard,
1450
1451 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1452
1453 TP_ARGS(dev, blkstart, blklen)
1454);
1455
1456DEFINE_EVENT(f2fs_discard, f2fs_issue_discard,
1457
1458 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1459
1460 TP_ARGS(dev, blkstart, blklen)
1461);
1462
Chao Yu2ec6f2e2017-10-04 09:08:36 +08001463DEFINE_EVENT(f2fs_discard, f2fs_remove_discard,
1464
1465 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1466
1467 TP_ARGS(dev, blkstart, blklen)
1468);
1469
Damien Le Moal126606c2016-10-28 17:45:07 +09001470TRACE_EVENT(f2fs_issue_reset_zone,
1471
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001472 TP_PROTO(struct block_device *dev, block_t blkstart),
Damien Le Moal126606c2016-10-28 17:45:07 +09001473
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001474 TP_ARGS(dev, blkstart),
Damien Le Moal126606c2016-10-28 17:45:07 +09001475
1476 TP_STRUCT__entry(
1477 __field(dev_t, dev)
1478 __field(block_t, blkstart)
1479 ),
1480
1481 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001482 __entry->dev = dev->bd_dev;
Damien Le Moal126606c2016-10-28 17:45:07 +09001483 __entry->blkstart = blkstart;
1484 ),
1485
1486 TP_printk("dev = (%d,%d), reset zone at block = 0x%llx",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001487 show_dev(__entry->dev),
Damien Le Moal126606c2016-10-28 17:45:07 +09001488 (unsigned long long)__entry->blkstart)
1489);
1490
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001491TRACE_EVENT(f2fs_issue_flush,
1492
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001493 TP_PROTO(struct block_device *dev, unsigned int nobarrier,
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001494 unsigned int flush_merge, int ret),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001495
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001496 TP_ARGS(dev, nobarrier, flush_merge, ret),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001497
1498 TP_STRUCT__entry(
1499 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -08001500 __field(unsigned int, nobarrier)
1501 __field(unsigned int, flush_merge)
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001502 __field(int, ret)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001503 ),
1504
1505 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001506 __entry->dev = dev->bd_dev;
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001507 __entry->nobarrier = nobarrier;
1508 __entry->flush_merge = flush_merge;
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001509 __entry->ret = ret;
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001510 ),
1511
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001512 TP_printk("dev = (%d,%d), %s %s, ret = %d",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001513 show_dev(__entry->dev),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001514 __entry->nobarrier ? "skip (nobarrier)" : "issue",
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001515 __entry->flush_merge ? " with flush_merge" : "",
1516 __entry->ret)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001517);
Chao Yu1ec46102015-02-05 17:59:59 +08001518
1519TRACE_EVENT(f2fs_lookup_extent_tree_start,
1520
1521 TP_PROTO(struct inode *inode, unsigned int pgofs),
1522
1523 TP_ARGS(inode, pgofs),
1524
1525 TP_STRUCT__entry(
1526 __field(dev_t, dev)
1527 __field(ino_t, ino)
1528 __field(unsigned int, pgofs)
1529 ),
1530
1531 TP_fast_assign(
1532 __entry->dev = inode->i_sb->s_dev;
1533 __entry->ino = inode->i_ino;
1534 __entry->pgofs = pgofs;
1535 ),
1536
1537 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1538 show_dev_ino(__entry),
1539 __entry->pgofs)
1540);
1541
1542TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1543
1544 TP_PROTO(struct inode *inode, unsigned int pgofs,
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001545 struct extent_info *ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001546
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001547 TP_ARGS(inode, pgofs, ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001548
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001549 TP_CONDITION(ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001550
1551 TP_STRUCT__entry(
1552 __field(dev_t, dev)
1553 __field(ino_t, ino)
1554 __field(unsigned int, pgofs)
1555 __field(unsigned int, fofs)
1556 __field(u32, blk)
1557 __field(unsigned int, len)
1558 ),
1559
1560 TP_fast_assign(
1561 __entry->dev = inode->i_sb->s_dev;
1562 __entry->ino = inode->i_ino;
1563 __entry->pgofs = pgofs;
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001564 __entry->fofs = ei->fofs;
1565 __entry->blk = ei->blk;
1566 __entry->len = ei->len;
Chao Yu1ec46102015-02-05 17:59:59 +08001567 ),
1568
1569 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1570 "ext_info(fofs: %u, blk: %u, len: %u)",
1571 show_dev_ino(__entry),
1572 __entry->pgofs,
1573 __entry->fofs,
1574 __entry->blk,
1575 __entry->len)
1576);
1577
Chao Yu744288c2015-09-06 17:50:13 +08001578TRACE_EVENT(f2fs_update_extent_tree_range,
Chao Yu1ec46102015-02-05 17:59:59 +08001579
Chao Yu744288c2015-09-06 17:50:13 +08001580 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1581 unsigned int len),
Chao Yu1ec46102015-02-05 17:59:59 +08001582
Chao Yu744288c2015-09-06 17:50:13 +08001583 TP_ARGS(inode, pgofs, blkaddr, len),
Chao Yu1ec46102015-02-05 17:59:59 +08001584
1585 TP_STRUCT__entry(
1586 __field(dev_t, dev)
1587 __field(ino_t, ino)
1588 __field(unsigned int, pgofs)
1589 __field(u32, blk)
Chao Yu744288c2015-09-06 17:50:13 +08001590 __field(unsigned int, len)
Chao Yu1ec46102015-02-05 17:59:59 +08001591 ),
1592
1593 TP_fast_assign(
1594 __entry->dev = inode->i_sb->s_dev;
1595 __entry->ino = inode->i_ino;
1596 __entry->pgofs = pgofs;
1597 __entry->blk = blkaddr;
Chao Yu744288c2015-09-06 17:50:13 +08001598 __entry->len = len;
Chao Yu1ec46102015-02-05 17:59:59 +08001599 ),
1600
Chao Yu744288c2015-09-06 17:50:13 +08001601 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1602 "blkaddr = %u, len = %u",
Chao Yu1ec46102015-02-05 17:59:59 +08001603 show_dev_ino(__entry),
1604 __entry->pgofs,
Chao Yu744288c2015-09-06 17:50:13 +08001605 __entry->blk,
1606 __entry->len)
Chao Yu1ec46102015-02-05 17:59:59 +08001607);
1608
1609TRACE_EVENT(f2fs_shrink_extent_tree,
1610
1611 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1612 unsigned int tree_cnt),
1613
1614 TP_ARGS(sbi, node_cnt, tree_cnt),
1615
1616 TP_STRUCT__entry(
1617 __field(dev_t, dev)
1618 __field(unsigned int, node_cnt)
1619 __field(unsigned int, tree_cnt)
1620 ),
1621
1622 TP_fast_assign(
1623 __entry->dev = sbi->sb->s_dev;
1624 __entry->node_cnt = node_cnt;
1625 __entry->tree_cnt = tree_cnt;
1626 ),
1627
1628 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001629 show_dev(__entry->dev),
Chao Yu1ec46102015-02-05 17:59:59 +08001630 __entry->node_cnt,
1631 __entry->tree_cnt)
1632);
1633
1634TRACE_EVENT(f2fs_destroy_extent_tree,
1635
1636 TP_PROTO(struct inode *inode, unsigned int node_cnt),
1637
1638 TP_ARGS(inode, node_cnt),
1639
1640 TP_STRUCT__entry(
1641 __field(dev_t, dev)
1642 __field(ino_t, ino)
1643 __field(unsigned int, node_cnt)
1644 ),
1645
1646 TP_fast_assign(
1647 __entry->dev = inode->i_sb->s_dev;
1648 __entry->ino = inode->i_ino;
1649 __entry->node_cnt = node_cnt;
1650 ),
1651
1652 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1653 show_dev_ino(__entry),
1654 __entry->node_cnt)
1655);
1656
Chao Yu4cf18532015-12-17 17:17:16 +08001657DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
1658
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001659 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001660
1661 TP_ARGS(sb, type, count),
1662
1663 TP_STRUCT__entry(
1664 __field(dev_t, dev)
1665 __field(int, type)
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001666 __field(s64, count)
Chao Yu4cf18532015-12-17 17:17:16 +08001667 ),
1668
1669 TP_fast_assign(
1670 __entry->dev = sb->s_dev;
1671 __entry->type = type;
1672 __entry->count = count;
1673 ),
1674
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001675 TP_printk("dev = (%d,%d), %s, dirty count = %lld",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001676 show_dev(__entry->dev),
Chao Yu4cf18532015-12-17 17:17:16 +08001677 show_file_type(__entry->type),
1678 __entry->count)
1679);
1680
1681DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
1682
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001683 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001684
1685 TP_ARGS(sb, type, count)
1686);
1687
1688DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
1689
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001690 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001691
1692 TP_ARGS(sb, type, count)
1693);
1694
Chao Yu559e87c2019-02-26 19:01:15 +08001695TRACE_EVENT(f2fs_shutdown,
1696
1697 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int mode, int ret),
1698
1699 TP_ARGS(sbi, mode, ret),
1700
1701 TP_STRUCT__entry(
1702 __field(dev_t, dev)
1703 __field(unsigned int, mode)
1704 __field(int, ret)
1705 ),
1706
1707 TP_fast_assign(
1708 __entry->dev = sbi->sb->s_dev;
1709 __entry->mode = mode;
1710 __entry->ret = ret;
1711 ),
1712
1713 TP_printk("dev = (%d,%d), mode: %s, ret:%d",
1714 show_dev(__entry->dev),
1715 show_shutdown_mode(__entry->mode),
1716 __entry->ret)
1717);
1718
Chao Yu4c8ff702019-11-01 18:07:14 +08001719DECLARE_EVENT_CLASS(f2fs_zip_start,
1720
1721 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1722 unsigned int cluster_size, unsigned char algtype),
1723
1724 TP_ARGS(inode, cluster_idx, cluster_size, algtype),
1725
1726 TP_STRUCT__entry(
1727 __field(dev_t, dev)
1728 __field(ino_t, ino)
1729 __field(pgoff_t, idx)
1730 __field(unsigned int, size)
1731 __field(unsigned int, algtype)
1732 ),
1733
1734 TP_fast_assign(
1735 __entry->dev = inode->i_sb->s_dev;
1736 __entry->ino = inode->i_ino;
1737 __entry->idx = cluster_idx;
1738 __entry->size = cluster_size;
1739 __entry->algtype = algtype;
1740 ),
1741
1742 TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
1743 "cluster_size = %u, algorithm = %s",
1744 show_dev_ino(__entry),
1745 __entry->idx,
1746 __entry->size,
1747 show_compress_algorithm(__entry->algtype))
1748);
1749
1750DECLARE_EVENT_CLASS(f2fs_zip_end,
1751
1752 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1753 unsigned int compressed_size, int ret),
1754
1755 TP_ARGS(inode, cluster_idx, compressed_size, ret),
1756
1757 TP_STRUCT__entry(
1758 __field(dev_t, dev)
1759 __field(ino_t, ino)
1760 __field(pgoff_t, idx)
1761 __field(unsigned int, size)
1762 __field(unsigned int, ret)
1763 ),
1764
1765 TP_fast_assign(
1766 __entry->dev = inode->i_sb->s_dev;
1767 __entry->ino = inode->i_ino;
1768 __entry->idx = cluster_idx;
1769 __entry->size = compressed_size;
1770 __entry->ret = ret;
1771 ),
1772
1773 TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
1774 "compressed_size = %u, ret = %d",
1775 show_dev_ino(__entry),
1776 __entry->idx,
1777 __entry->size,
1778 __entry->ret)
1779);
1780
1781DEFINE_EVENT(f2fs_zip_start, f2fs_compress_pages_start,
1782
1783 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1784 unsigned int cluster_size, unsigned char algtype),
1785
1786 TP_ARGS(inode, cluster_idx, cluster_size, algtype)
1787);
1788
1789DEFINE_EVENT(f2fs_zip_start, f2fs_decompress_pages_start,
1790
1791 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1792 unsigned int cluster_size, unsigned char algtype),
1793
1794 TP_ARGS(inode, cluster_idx, cluster_size, algtype)
1795);
1796
1797DEFINE_EVENT(f2fs_zip_end, f2fs_compress_pages_end,
1798
1799 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1800 unsigned int compressed_size, int ret),
1801
1802 TP_ARGS(inode, cluster_idx, compressed_size, ret)
1803);
1804
1805DEFINE_EVENT(f2fs_zip_end, f2fs_decompress_pages_end,
1806
1807 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1808 unsigned int compressed_size, int ret),
1809
1810 TP_ARGS(inode, cluster_idx, compressed_size, ret)
1811);
1812
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09001813#endif /* _TRACE_F2FS_H */
1814
1815 /* This part must be outside protection */
1816#include <trace/define_trace.h>