blob: 24c2557c37f020559afbd2fc05a39b51899e0200 [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);
Sahitya Tummalafad5fbc2020-01-03 08:49:28 +053052TRACE_DEFINE_ENUM(CP_PAUSE);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040053
Namjae Jeon6ec178d2013-04-23 17:51:43 +090054#define show_block_type(type) \
55 __print_symbolic(type, \
56 { NODE, "NODE" }, \
57 { DATA, "DATA" }, \
58 { META, "META" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070059 { META_FLUSH, "META_FLUSH" }, \
60 { INMEM, "INMEM" }, \
61 { INMEM_DROP, "INMEM_DROP" }, \
Jaegeuk Kim8c242db2017-03-17 09:55:52 +080062 { INMEM_INVALIDATE, "INMEM_INVALIDATE" }, \
Chao Yu28bc1062016-02-06 14:40:34 +080063 { INMEM_REVOKE, "INMEM_REVOKE" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070064 { IPU, "IN-PLACE" }, \
65 { OPU, "OUT-OF-PLACE" })
Namjae Jeon6ec178d2013-04-23 17:51:43 +090066
Jaegeuk Kima912b542017-05-10 11:18:25 -070067#define show_block_temp(temp) \
68 __print_symbolic(temp, \
69 { HOT, "HOT" }, \
70 { WARM, "WARM" }, \
71 { COLD, "COLD" })
72
Chao Yubaaabbb2017-05-04 09:35:43 +080073#define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_META | REQ_PRIO | \
74 REQ_PREFLUSH | REQ_FUA)
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080075#define F2FS_BIO_FLAG_MASK(t) (t & F2FS_OP_FLAGS)
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090076
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080077#define show_bio_type(op,op_flags) show_bio_op(op), \
78 show_bio_op_flags(op_flags)
79
Chaitanya Kulkarni0ce35372019-06-20 10:59:19 -070080#define show_bio_op(op) blk_op_str(op)
Mike Christie04d328d2016-06-05 14:31:55 -050081
82#define show_bio_op_flags(flags) \
Chao Yubaaabbb2017-05-04 09:35:43 +080083 __print_flags(F2FS_BIO_FLAG_MASK(flags), "|", \
84 { REQ_RAHEAD, "R" }, \
85 { REQ_SYNC, "S" }, \
86 { REQ_META, "M" }, \
87 { REQ_PRIO, "P" }, \
88 { REQ_PREFLUSH, "PF" }, \
89 { REQ_FUA, "FUA" })
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090090
Namjae Jeon8e46b3e2013-04-23 16:42:53 +090091#define show_data_type(type) \
92 __print_symbolic(type, \
93 { CURSEG_HOT_DATA, "Hot DATA" }, \
94 { CURSEG_WARM_DATA, "Warm DATA" }, \
95 { CURSEG_COLD_DATA, "Cold DATA" }, \
96 { CURSEG_HOT_NODE, "Hot NODE" }, \
97 { CURSEG_WARM_NODE, "Warm NODE" }, \
98 { CURSEG_COLD_NODE, "Cold NODE" }, \
99 { NO_CHECK_TYPE, "No TYPE" })
100
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900101#define show_file_type(type) \
102 __print_symbolic(type, \
103 { 0, "FILE" }, \
104 { 1, "DIR" })
105
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900106#define show_gc_type(type) \
107 __print_symbolic(type, \
108 { FG_GC, "Foreground GC" }, \
109 { BG_GC, "Background GC" })
110
111#define show_alloc_mode(type) \
112 __print_symbolic(type, \
113 { LFS, "LFS-mode" }, \
114 { SSR, "SSR-mode" })
115
116#define show_victim_policy(type) \
117 __print_symbolic(type, \
118 { GC_GREEDY, "Greedy" }, \
119 { GC_CB, "Cost-Benefit" })
120
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700121#define show_cpreason(type) \
Chao Yubaaabbb2017-05-04 09:35:43 +0800122 __print_flags(type, "|", \
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700123 { CP_UMOUNT, "Umount" }, \
Jaegeuk Kim119ee912015-01-29 11:45:33 -0800124 { CP_FASTBOOT, "Fastboot" }, \
Jaegeuk Kim4b2fecc2014-09-20 22:06:39 -0700125 { CP_SYNC, "Sync" }, \
Jaegeuk Kim10027552015-04-09 17:03:53 -0700126 { CP_RECOVERY, "Recovery" }, \
Chao Yu1f43e2a2017-04-28 13:56:08 +0800127 { CP_DISCARD, "Discard" }, \
Sahitya Tummalafad5fbc2020-01-03 08:49:28 +0530128 { CP_PAUSE, "Pause" }, \
Chao Yubaaabbb2017-05-04 09:35:43 +0800129 { CP_TRIMMED, "Trimmed" })
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700130
Chao Yua5fd5052017-11-06 22:51:45 +0800131#define show_fsync_cpreason(type) \
132 __print_symbolic(type, \
133 { CP_NO_NEEDED, "no needed" }, \
134 { CP_NON_REGULAR, "non regular" }, \
Chao Yu4c8ff702019-11-01 18:07:14 +0800135 { CP_COMPRESSED, "compreesed" }, \
Chao Yua5fd5052017-11-06 22:51:45 +0800136 { CP_HARDLINK, "hardlink" }, \
137 { CP_SB_NEED_CP, "sb needs cp" }, \
138 { CP_WRONG_PINO, "wrong pino" }, \
139 { CP_NO_SPC_ROLL, "no space roll forward" }, \
140 { CP_NODE_NEED_CP, "node needs cp" }, \
141 { CP_FASTBOOT_MODE, "fastboot mode" }, \
Jaegeuk Kim0a007b972017-12-28 08:09:44 -0800142 { CP_SPEC_LOG_NUM, "log type is 2" }, \
143 { CP_RECOVER_DIR, "dir needs recovery" })
Chao Yua5fd5052017-11-06 22:51:45 +0800144
Chao Yu559e87c2019-02-26 19:01:15 +0800145#define show_shutdown_mode(type) \
146 __print_symbolic(type, \
147 { F2FS_GOING_DOWN_FULLSYNC, "full sync" }, \
148 { F2FS_GOING_DOWN_METASYNC, "meta sync" }, \
149 { F2FS_GOING_DOWN_NOSYNC, "no sync" }, \
150 { F2FS_GOING_DOWN_METAFLUSH, "meta flush" }, \
151 { F2FS_GOING_DOWN_NEED_FSCK, "need fsck" })
152
Chao Yu4c8ff702019-11-01 18:07:14 +0800153#define show_compress_algorithm(type) \
154 __print_symbolic(type, \
155 { COMPRESS_LZO, "LZO" }, \
Chao Yu50cfa662020-03-03 17:46:02 +0800156 { COMPRESS_LZ4, "LZ4" }, \
157 { COMPRESS_ZSTD, "ZSTD" })
Chao Yu4c8ff702019-11-01 18:07:14 +0800158
Zhikang Zhang539cd352019-01-03 20:06:38 +0800159struct f2fs_sb_info;
160struct f2fs_io_info;
161struct extent_info;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900162struct victim_sel_policy;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700163struct f2fs_map_blocks;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900164
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900165DECLARE_EVENT_CLASS(f2fs__inode,
166
167 TP_PROTO(struct inode *inode),
168
169 TP_ARGS(inode),
170
171 TP_STRUCT__entry(
172 __field(dev_t, dev)
173 __field(ino_t, ino)
174 __field(ino_t, pino)
175 __field(umode_t, mode)
176 __field(loff_t, size)
177 __field(unsigned int, nlink)
178 __field(blkcnt_t, blocks)
179 __field(__u8, advise)
180 ),
181
182 TP_fast_assign(
183 __entry->dev = inode->i_sb->s_dev;
184 __entry->ino = inode->i_ino;
185 __entry->pino = F2FS_I(inode)->i_pino;
186 __entry->mode = inode->i_mode;
187 __entry->nlink = inode->i_nlink;
188 __entry->size = inode->i_size;
189 __entry->blocks = inode->i_blocks;
190 __entry->advise = F2FS_I(inode)->i_advise;
191 ),
192
193 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
194 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
195 show_dev_ino(__entry),
196 (unsigned long)__entry->pino,
197 __entry->mode,
198 __entry->size,
199 (unsigned int)__entry->nlink,
200 (unsigned long long)__entry->blocks,
201 (unsigned char)__entry->advise)
202);
203
204DECLARE_EVENT_CLASS(f2fs__inode_exit,
205
206 TP_PROTO(struct inode *inode, int ret),
207
208 TP_ARGS(inode, ret),
209
210 TP_STRUCT__entry(
211 __field(dev_t, dev)
212 __field(ino_t, ino)
213 __field(int, ret)
214 ),
215
216 TP_fast_assign(
217 __entry->dev = inode->i_sb->s_dev;
218 __entry->ino = inode->i_ino;
219 __entry->ret = ret;
220 ),
221
222 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
223 show_dev_ino(__entry),
224 __entry->ret)
225);
226
227DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
228
229 TP_PROTO(struct inode *inode),
230
231 TP_ARGS(inode)
232);
233
234TRACE_EVENT(f2fs_sync_file_exit,
235
Chao Yua5fd5052017-11-06 22:51:45 +0800236 TP_PROTO(struct inode *inode, int cp_reason, int datasync, int ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900237
Chao Yua5fd5052017-11-06 22:51:45 +0800238 TP_ARGS(inode, cp_reason, datasync, ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900239
240 TP_STRUCT__entry(
241 __field(dev_t, dev)
242 __field(ino_t, ino)
Chao Yua5fd5052017-11-06 22:51:45 +0800243 __field(int, cp_reason)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900244 __field(int, datasync)
245 __field(int, ret)
246 ),
247
248 TP_fast_assign(
249 __entry->dev = inode->i_sb->s_dev;
250 __entry->ino = inode->i_ino;
Chao Yua5fd5052017-11-06 22:51:45 +0800251 __entry->cp_reason = cp_reason;
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900252 __entry->datasync = datasync;
253 __entry->ret = ret;
254 ),
255
Chao Yua5fd5052017-11-06 22:51:45 +0800256 TP_printk("dev = (%d,%d), ino = %lu, cp_reason: %s, "
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900257 "datasync = %d, ret = %d",
258 show_dev_ino(__entry),
Chao Yua5fd5052017-11-06 22:51:45 +0800259 show_fsync_cpreason(__entry->cp_reason),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900260 __entry->datasync,
261 __entry->ret)
262);
263
264TRACE_EVENT(f2fs_sync_fs,
265
266 TP_PROTO(struct super_block *sb, int wait),
267
268 TP_ARGS(sb, wait),
269
270 TP_STRUCT__entry(
271 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800272 __field(int, dirty)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900273 __field(int, wait)
274 ),
275
276 TP_fast_assign(
277 __entry->dev = sb->s_dev;
Chao Yucaf00472015-01-28 17:48:42 +0800278 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900279 __entry->wait = wait;
280 ),
281
282 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800283 show_dev(__entry->dev),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900284 __entry->dirty ? "dirty" : "not dirty",
285 __entry->wait)
286);
287
288DEFINE_EVENT(f2fs__inode, f2fs_iget,
289
290 TP_PROTO(struct inode *inode),
291
292 TP_ARGS(inode)
293);
294
295DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
296
297 TP_PROTO(struct inode *inode, int ret),
298
299 TP_ARGS(inode, ret)
300);
301
302DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
303
304 TP_PROTO(struct inode *inode),
305
306 TP_ARGS(inode)
307);
308
Jaegeuk Kimd70b4f52013-04-25 13:24:33 +0900309DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
310
311 TP_PROTO(struct inode *inode, int ret),
312
313 TP_ARGS(inode, ret)
314);
315
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900316TRACE_EVENT(f2fs_unlink_enter,
317
318 TP_PROTO(struct inode *dir, struct dentry *dentry),
319
320 TP_ARGS(dir, dentry),
321
322 TP_STRUCT__entry(
323 __field(dev_t, dev)
324 __field(ino_t, ino)
325 __field(loff_t, size)
326 __field(blkcnt_t, blocks)
327 __field(const char *, name)
328 ),
329
330 TP_fast_assign(
331 __entry->dev = dir->i_sb->s_dev;
332 __entry->ino = dir->i_ino;
333 __entry->size = dir->i_size;
334 __entry->blocks = dir->i_blocks;
335 __entry->name = dentry->d_name.name;
336 ),
337
338 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
339 "i_blocks = %llu, name = %s",
340 show_dev_ino(__entry),
341 __entry->size,
342 (unsigned long long)__entry->blocks,
343 __entry->name)
344);
345
346DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
347
348 TP_PROTO(struct inode *inode, int ret),
349
350 TP_ARGS(inode, ret)
351);
Namjae Jeon51dd6242013-04-20 01:28:52 +0900352
Hou Pengyangb8d96a32017-02-27 13:02:58 +0000353DEFINE_EVENT(f2fs__inode_exit, f2fs_drop_inode,
354
355 TP_PROTO(struct inode *inode, int ret),
356
357 TP_ARGS(inode, ret)
358);
359
Namjae Jeon51dd6242013-04-20 01:28:52 +0900360DEFINE_EVENT(f2fs__inode, f2fs_truncate,
361
362 TP_PROTO(struct inode *inode),
363
364 TP_ARGS(inode)
365);
366
367TRACE_EVENT(f2fs_truncate_data_blocks_range,
368
369 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
370
371 TP_ARGS(inode, nid, ofs, free),
372
373 TP_STRUCT__entry(
374 __field(dev_t, dev)
375 __field(ino_t, ino)
376 __field(nid_t, nid)
377 __field(unsigned int, ofs)
378 __field(int, free)
379 ),
380
381 TP_fast_assign(
382 __entry->dev = inode->i_sb->s_dev;
383 __entry->ino = inode->i_ino;
384 __entry->nid = nid;
385 __entry->ofs = ofs;
386 __entry->free = free;
387 ),
388
389 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
390 show_dev_ino(__entry),
391 (unsigned int)__entry->nid,
392 __entry->ofs,
393 __entry->free)
394);
395
396DECLARE_EVENT_CLASS(f2fs__truncate_op,
397
398 TP_PROTO(struct inode *inode, u64 from),
399
400 TP_ARGS(inode, from),
401
402 TP_STRUCT__entry(
403 __field(dev_t, dev)
404 __field(ino_t, ino)
405 __field(loff_t, size)
406 __field(blkcnt_t, blocks)
407 __field(u64, from)
408 ),
409
410 TP_fast_assign(
411 __entry->dev = inode->i_sb->s_dev;
412 __entry->ino = inode->i_ino;
413 __entry->size = inode->i_size;
414 __entry->blocks = inode->i_blocks;
415 __entry->from = from;
416 ),
417
418 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
419 "start file offset = %llu",
420 show_dev_ino(__entry),
421 __entry->size,
422 (unsigned long long)__entry->blocks,
423 (unsigned long long)__entry->from)
424);
425
426DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
427
428 TP_PROTO(struct inode *inode, u64 from),
429
430 TP_ARGS(inode, from)
431);
432
433DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
434
435 TP_PROTO(struct inode *inode, int ret),
436
437 TP_ARGS(inode, ret)
438);
439
440DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
441
442 TP_PROTO(struct inode *inode, u64 from),
443
444 TP_ARGS(inode, from)
445);
446
447DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
448
449 TP_PROTO(struct inode *inode, int ret),
450
451 TP_ARGS(inode, ret)
452);
453
454DECLARE_EVENT_CLASS(f2fs__truncate_node,
455
456 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
457
458 TP_ARGS(inode, nid, blk_addr),
459
460 TP_STRUCT__entry(
461 __field(dev_t, dev)
462 __field(ino_t, ino)
463 __field(nid_t, nid)
464 __field(block_t, blk_addr)
465 ),
466
467 TP_fast_assign(
468 __entry->dev = inode->i_sb->s_dev;
469 __entry->ino = inode->i_ino;
470 __entry->nid = nid;
471 __entry->blk_addr = blk_addr;
472 ),
473
474 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
475 show_dev_ino(__entry),
476 (unsigned int)__entry->nid,
477 (unsigned long long)__entry->blk_addr)
478);
479
480DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
481
482 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
483
484 TP_ARGS(inode, nid, blk_addr)
485);
486
487DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
488
489 TP_PROTO(struct inode *inode, int ret),
490
491 TP_ARGS(inode, ret)
492);
493
494DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
495
496 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
497
498 TP_ARGS(inode, nid, blk_addr)
499);
500
501TRACE_EVENT(f2fs_truncate_partial_nodes,
502
Alexei Starovoitovc1055472018-03-28 12:05:32 -0700503 TP_PROTO(struct inode *inode, nid_t *nid, int depth, int err),
Namjae Jeon51dd6242013-04-20 01:28:52 +0900504
505 TP_ARGS(inode, nid, depth, err),
506
507 TP_STRUCT__entry(
508 __field(dev_t, dev)
509 __field(ino_t, ino)
510 __field(nid_t, nid[3])
511 __field(int, depth)
512 __field(int, err)
513 ),
514
515 TP_fast_assign(
516 __entry->dev = inode->i_sb->s_dev;
517 __entry->ino = inode->i_ino;
518 __entry->nid[0] = nid[0];
519 __entry->nid[1] = nid[1];
520 __entry->nid[2] = nid[2];
521 __entry->depth = depth;
522 __entry->err = err;
523 ),
524
525 TP_printk("dev = (%d,%d), ino = %lu, "
526 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
527 show_dev_ino(__entry),
528 (unsigned int)__entry->nid[0],
529 (unsigned int)__entry->nid[1],
530 (unsigned int)__entry->nid[2],
531 __entry->depth,
532 __entry->err)
533);
534
Chao Yu126ce722019-04-02 18:52:22 +0800535TRACE_EVENT(f2fs_file_write_iter,
536
537 TP_PROTO(struct inode *inode, unsigned long offset,
538 unsigned long length, int ret),
539
540 TP_ARGS(inode, offset, length, ret),
541
542 TP_STRUCT__entry(
543 __field(dev_t, dev)
544 __field(ino_t, ino)
545 __field(unsigned long, offset)
546 __field(unsigned long, length)
547 __field(int, ret)
548 ),
549
550 TP_fast_assign(
551 __entry->dev = inode->i_sb->s_dev;
552 __entry->ino = inode->i_ino;
553 __entry->offset = offset;
554 __entry->length = length;
555 __entry->ret = ret;
556 ),
557
558 TP_printk("dev = (%d,%d), ino = %lu, "
559 "offset = %lu, length = %lu, written(err) = %d",
560 show_dev_ino(__entry),
561 __entry->offset,
562 __entry->length,
563 __entry->ret)
564);
565
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700566TRACE_EVENT(f2fs_map_blocks,
567 TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900568
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700569 TP_ARGS(inode, map, ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900570
571 TP_STRUCT__entry(
572 __field(dev_t, dev)
573 __field(ino_t, ino)
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700574 __field(block_t, m_lblk)
575 __field(block_t, m_pblk)
576 __field(unsigned int, m_len)
Chao Yu76630f22019-02-26 19:01:16 +0800577 __field(unsigned int, m_flags)
578 __field(int, m_seg_type)
579 __field(bool, m_may_create)
Namjae Jeon848753a2013-04-23 16:38:02 +0900580 __field(int, ret)
581 ),
582
583 TP_fast_assign(
584 __entry->dev = inode->i_sb->s_dev;
585 __entry->ino = inode->i_ino;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700586 __entry->m_lblk = map->m_lblk;
587 __entry->m_pblk = map->m_pblk;
588 __entry->m_len = map->m_len;
Chao Yu76630f22019-02-26 19:01:16 +0800589 __entry->m_flags = map->m_flags;
590 __entry->m_seg_type = map->m_seg_type;
591 __entry->m_may_create = map->m_may_create;
Namjae Jeon848753a2013-04-23 16:38:02 +0900592 __entry->ret = ret;
593 ),
594
595 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
Chao Yu76630f22019-02-26 19:01:16 +0800596 "start blkaddr = 0x%llx, len = 0x%llx, flags = %u,"
597 "seg_type = %d, may_create = %d, err = %d",
Namjae Jeon848753a2013-04-23 16:38:02 +0900598 show_dev_ino(__entry),
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700599 (unsigned long long)__entry->m_lblk,
600 (unsigned long long)__entry->m_pblk,
601 (unsigned long long)__entry->m_len,
Chao Yu76630f22019-02-26 19:01:16 +0800602 __entry->m_flags,
603 __entry->m_seg_type,
604 __entry->m_may_create,
Namjae Jeon848753a2013-04-23 16:38:02 +0900605 __entry->ret)
606);
607
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700608TRACE_EVENT(f2fs_background_gc,
609
Chao Yub8c502b2017-08-07 23:12:46 +0800610 TP_PROTO(struct super_block *sb, unsigned int wait_ms,
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700611 unsigned int prefree, unsigned int free),
612
613 TP_ARGS(sb, wait_ms, prefree, free),
614
615 TP_STRUCT__entry(
616 __field(dev_t, dev)
Chao Yub8c502b2017-08-07 23:12:46 +0800617 __field(unsigned int, wait_ms)
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700618 __field(unsigned int, prefree)
619 __field(unsigned int, free)
620 ),
621
622 TP_fast_assign(
623 __entry->dev = sb->s_dev;
624 __entry->wait_ms = wait_ms;
625 __entry->prefree = prefree;
626 __entry->free = free;
627 ),
628
Chao Yub8c502b2017-08-07 23:12:46 +0800629 TP_printk("dev = (%d,%d), wait_ms = %u, prefree = %u, free = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800630 show_dev(__entry->dev),
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700631 __entry->wait_ms,
632 __entry->prefree,
633 __entry->free)
634);
635
Chao Yuc56f16d2017-08-11 18:00:15 +0800636TRACE_EVENT(f2fs_gc_begin,
637
638 TP_PROTO(struct super_block *sb, bool sync, bool background,
639 long long dirty_nodes, long long dirty_dents,
640 long long dirty_imeta, unsigned int free_sec,
641 unsigned int free_seg, int reserved_seg,
642 unsigned int prefree_seg),
643
644 TP_ARGS(sb, sync, background, dirty_nodes, dirty_dents, dirty_imeta,
645 free_sec, free_seg, reserved_seg, prefree_seg),
646
647 TP_STRUCT__entry(
648 __field(dev_t, dev)
649 __field(bool, sync)
650 __field(bool, background)
651 __field(long long, dirty_nodes)
652 __field(long long, dirty_dents)
653 __field(long long, dirty_imeta)
654 __field(unsigned int, free_sec)
655 __field(unsigned int, free_seg)
656 __field(int, reserved_seg)
657 __field(unsigned int, prefree_seg)
658 ),
659
660 TP_fast_assign(
661 __entry->dev = sb->s_dev;
662 __entry->sync = sync;
663 __entry->background = background;
664 __entry->dirty_nodes = dirty_nodes;
665 __entry->dirty_dents = dirty_dents;
666 __entry->dirty_imeta = dirty_imeta;
667 __entry->free_sec = free_sec;
668 __entry->free_seg = free_seg;
669 __entry->reserved_seg = reserved_seg;
670 __entry->prefree_seg = prefree_seg;
671 ),
672
673 TP_printk("dev = (%d,%d), sync = %d, background = %d, nodes = %lld, "
674 "dents = %lld, imeta = %lld, free_sec:%u, free_seg:%u, "
675 "rsv_seg:%d, prefree_seg:%u",
676 show_dev(__entry->dev),
677 __entry->sync,
678 __entry->background,
679 __entry->dirty_nodes,
680 __entry->dirty_dents,
681 __entry->dirty_imeta,
682 __entry->free_sec,
683 __entry->free_seg,
684 __entry->reserved_seg,
685 __entry->prefree_seg)
686);
687
688TRACE_EVENT(f2fs_gc_end,
689
690 TP_PROTO(struct super_block *sb, int ret, int seg_freed,
691 int sec_freed, long long dirty_nodes,
692 long long dirty_dents, long long dirty_imeta,
693 unsigned int free_sec, unsigned int free_seg,
694 int reserved_seg, unsigned int prefree_seg),
695
696 TP_ARGS(sb, ret, seg_freed, sec_freed, dirty_nodes, dirty_dents,
697 dirty_imeta, free_sec, free_seg, reserved_seg, prefree_seg),
698
699 TP_STRUCT__entry(
700 __field(dev_t, dev)
701 __field(int, ret)
702 __field(int, seg_freed)
703 __field(int, sec_freed)
704 __field(long long, dirty_nodes)
705 __field(long long, dirty_dents)
706 __field(long long, dirty_imeta)
707 __field(unsigned int, free_sec)
708 __field(unsigned int, free_seg)
709 __field(int, reserved_seg)
710 __field(unsigned int, prefree_seg)
711 ),
712
713 TP_fast_assign(
714 __entry->dev = sb->s_dev;
715 __entry->ret = ret;
716 __entry->seg_freed = seg_freed;
717 __entry->sec_freed = sec_freed;
718 __entry->dirty_nodes = dirty_nodes;
719 __entry->dirty_dents = dirty_dents;
720 __entry->dirty_imeta = dirty_imeta;
721 __entry->free_sec = free_sec;
722 __entry->free_seg = free_seg;
723 __entry->reserved_seg = reserved_seg;
724 __entry->prefree_seg = prefree_seg;
725 ),
726
727 TP_printk("dev = (%d,%d), ret = %d, seg_freed = %d, sec_freed = %d, "
728 "nodes = %lld, dents = %lld, imeta = %lld, free_sec:%u, "
729 "free_seg:%u, rsv_seg:%d, prefree_seg:%u",
730 show_dev(__entry->dev),
731 __entry->ret,
732 __entry->seg_freed,
733 __entry->sec_freed,
734 __entry->dirty_nodes,
735 __entry->dirty_dents,
736 __entry->dirty_imeta,
737 __entry->free_sec,
738 __entry->free_seg,
739 __entry->reserved_seg,
740 __entry->prefree_seg)
741);
742
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900743TRACE_EVENT(f2fs_get_victim,
744
745 TP_PROTO(struct super_block *sb, int type, int gc_type,
746 struct victim_sel_policy *p, unsigned int pre_victim,
747 unsigned int prefree, unsigned int free),
748
749 TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
750
751 TP_STRUCT__entry(
752 __field(dev_t, dev)
753 __field(int, type)
754 __field(int, gc_type)
755 __field(int, alloc_mode)
756 __field(int, gc_mode)
757 __field(unsigned int, victim)
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800758 __field(unsigned int, cost)
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900759 __field(unsigned int, ofs_unit)
760 __field(unsigned int, pre_victim)
761 __field(unsigned int, prefree)
762 __field(unsigned int, free)
763 ),
764
765 TP_fast_assign(
766 __entry->dev = sb->s_dev;
767 __entry->type = type;
768 __entry->gc_type = gc_type;
769 __entry->alloc_mode = p->alloc_mode;
770 __entry->gc_mode = p->gc_mode;
771 __entry->victim = p->min_segno;
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800772 __entry->cost = p->min_cost;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900773 __entry->ofs_unit = p->ofs_unit;
774 __entry->pre_victim = pre_victim;
775 __entry->prefree = prefree;
776 __entry->free = free;
777 ),
778
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800779 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), "
780 "victim = %u, cost = %u, ofs_unit = %u, "
781 "pre_victim_secno = %d, prefree = %u, free = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800782 show_dev(__entry->dev),
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900783 show_data_type(__entry->type),
784 show_gc_type(__entry->gc_type),
785 show_alloc_mode(__entry->alloc_mode),
786 show_victim_policy(__entry->gc_mode),
787 __entry->victim,
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800788 __entry->cost,
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900789 __entry->ofs_unit,
790 (int)__entry->pre_victim,
791 __entry->prefree,
792 __entry->free)
793);
794
Chao Yu0c5e36d2017-10-17 17:33:41 +0800795TRACE_EVENT(f2fs_lookup_start,
796
797 TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags),
798
799 TP_ARGS(dir, dentry, flags),
800
801 TP_STRUCT__entry(
802 __field(dev_t, dev)
803 __field(ino_t, ino)
804 __field(const char *, name)
805 __field(unsigned int, flags)
806 ),
807
808 TP_fast_assign(
809 __entry->dev = dir->i_sb->s_dev;
810 __entry->ino = dir->i_ino;
811 __entry->name = dentry->d_name.name;
812 __entry->flags = flags;
813 ),
814
815 TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u",
816 show_dev_ino(__entry),
817 __entry->name,
818 __entry->flags)
819);
820
821TRACE_EVENT(f2fs_lookup_end,
822
823 TP_PROTO(struct inode *dir, struct dentry *dentry, nid_t ino,
824 int err),
825
826 TP_ARGS(dir, dentry, ino, err),
827
828 TP_STRUCT__entry(
829 __field(dev_t, dev)
830 __field(ino_t, ino)
831 __field(const char *, name)
832 __field(nid_t, cino)
833 __field(int, err)
834 ),
835
836 TP_fast_assign(
837 __entry->dev = dir->i_sb->s_dev;
838 __entry->ino = dir->i_ino;
839 __entry->name = dentry->d_name.name;
840 __entry->cino = ino;
841 __entry->err = err;
842 ),
843
844 TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d",
845 show_dev_ino(__entry),
846 __entry->name,
847 __entry->cino,
848 __entry->err)
849);
850
Chao Yue97a3c42017-10-13 18:01:33 +0800851TRACE_EVENT(f2fs_readdir,
852
853 TP_PROTO(struct inode *dir, loff_t start_pos, loff_t end_pos, int err),
854
855 TP_ARGS(dir, start_pos, end_pos, err),
856
857 TP_STRUCT__entry(
858 __field(dev_t, dev)
859 __field(ino_t, ino)
860 __field(loff_t, start)
861 __field(loff_t, end)
862 __field(int, err)
863 ),
864
865 TP_fast_assign(
866 __entry->dev = dir->i_sb->s_dev;
867 __entry->ino = dir->i_ino;
868 __entry->start = start_pos;
869 __entry->end = end_pos;
870 __entry->err = err;
871 ),
872
873 TP_printk("dev = (%d,%d), ino = %lu, start_pos:%llu, end_pos:%llu, err:%d",
874 show_dev_ino(__entry),
875 __entry->start,
876 __entry->end,
877 __entry->err)
878);
879
Namjae Jeonc01e2852013-04-23 17:00:52 +0900880TRACE_EVENT(f2fs_fallocate,
881
882 TP_PROTO(struct inode *inode, int mode,
883 loff_t offset, loff_t len, int ret),
884
885 TP_ARGS(inode, mode, offset, len, ret),
886
887 TP_STRUCT__entry(
888 __field(dev_t, dev)
889 __field(ino_t, ino)
890 __field(int, mode)
891 __field(loff_t, offset)
892 __field(loff_t, len)
893 __field(loff_t, size)
894 __field(blkcnt_t, blocks)
895 __field(int, ret)
896 ),
897
898 TP_fast_assign(
899 __entry->dev = inode->i_sb->s_dev;
900 __entry->ino = inode->i_ino;
901 __entry->mode = mode;
902 __entry->offset = offset;
903 __entry->len = len;
904 __entry->size = inode->i_size;
905 __entry->blocks = inode->i_blocks;
906 __entry->ret = ret;
907 ),
908
909 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
910 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
911 show_dev_ino(__entry),
912 __entry->mode,
913 (unsigned long long)__entry->offset,
914 (unsigned long long)__entry->len,
915 (unsigned long long)__entry->size,
916 (unsigned long long)__entry->blocks,
917 __entry->ret)
918);
919
Chao Yu70407fa2014-07-31 21:11:22 +0800920TRACE_EVENT(f2fs_direct_IO_enter,
921
922 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
923
924 TP_ARGS(inode, offset, len, rw),
925
926 TP_STRUCT__entry(
927 __field(dev_t, dev)
928 __field(ino_t, ino)
929 __field(loff_t, pos)
930 __field(unsigned long, len)
931 __field(int, rw)
932 ),
933
934 TP_fast_assign(
935 __entry->dev = inode->i_sb->s_dev;
936 __entry->ino = inode->i_ino;
937 __entry->pos = offset;
938 __entry->len = len;
939 __entry->rw = rw;
940 ),
941
942 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
943 show_dev_ino(__entry),
944 __entry->pos,
945 __entry->len,
946 __entry->rw)
947);
948
949TRACE_EVENT(f2fs_direct_IO_exit,
950
951 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
952 int rw, int ret),
953
954 TP_ARGS(inode, offset, len, rw, ret),
955
956 TP_STRUCT__entry(
957 __field(dev_t, dev)
958 __field(ino_t, ino)
959 __field(loff_t, pos)
960 __field(unsigned long, len)
961 __field(int, rw)
962 __field(int, ret)
963 ),
964
965 TP_fast_assign(
966 __entry->dev = inode->i_sb->s_dev;
967 __entry->ino = inode->i_ino;
968 __entry->pos = offset;
969 __entry->len = len;
970 __entry->rw = rw;
971 __entry->ret = ret;
972 ),
973
974 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
975 "rw = %d ret = %d",
976 show_dev_ino(__entry),
977 __entry->pos,
978 __entry->len,
979 __entry->rw,
980 __entry->ret)
981);
982
Chao Yu46008c62016-05-09 19:56:30 +0800983TRACE_EVENT(f2fs_reserve_new_blocks,
Namjae Jeonc01e2852013-04-23 17:00:52 +0900984
Chao Yu46008c62016-05-09 19:56:30 +0800985 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node,
986 blkcnt_t count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900987
Chao Yu46008c62016-05-09 19:56:30 +0800988 TP_ARGS(inode, nid, ofs_in_node, count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900989
990 TP_STRUCT__entry(
991 __field(dev_t, dev)
992 __field(nid_t, nid)
993 __field(unsigned int, ofs_in_node)
Chao Yu46008c62016-05-09 19:56:30 +0800994 __field(blkcnt_t, count)
Namjae Jeonc01e2852013-04-23 17:00:52 +0900995 ),
996
997 TP_fast_assign(
998 __entry->dev = inode->i_sb->s_dev;
999 __entry->nid = nid;
1000 __entry->ofs_in_node = ofs_in_node;
Chao Yu46008c62016-05-09 19:56:30 +08001001 __entry->count = count;
Namjae Jeonc01e2852013-04-23 17:00:52 +09001002 ),
1003
Chao Yu46008c62016-05-09 19:56:30 +08001004 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001005 show_dev(__entry->dev),
Namjae Jeonc01e2852013-04-23 17:00:52 +09001006 (unsigned int)__entry->nid,
Chao Yu46008c62016-05-09 19:56:30 +08001007 __entry->ofs_in_node,
1008 (unsigned long long)__entry->count)
Namjae Jeonc01e2852013-04-23 17:00:52 +09001009);
1010
Chao Yu3e1c8f12014-12-23 16:35:21 +08001011DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
1012
Chao Yu2ace38e2014-12-24 16:08:14 +08001013 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001014
Chao Yu2ace38e2014-12-24 16:08:14 +08001015 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001016
1017 TP_STRUCT__entry(
1018 __field(dev_t, dev)
1019 __field(ino_t, ino)
1020 __field(pgoff_t, index)
Chao Yu7a9d7542016-02-22 18:36:38 +08001021 __field(block_t, old_blkaddr)
1022 __field(block_t, new_blkaddr)
Mike Christie04d328d2016-06-05 14:31:55 -05001023 __field(int, op)
1024 __field(int, op_flags)
Jaegeuk Kima912b542017-05-10 11:18:25 -07001025 __field(int, temp)
Chao Yu3e1c8f12014-12-23 16:35:21 +08001026 __field(int, type)
1027 ),
1028
1029 TP_fast_assign(
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001030 __entry->dev = page_file_mapping(page)->host->i_sb->s_dev;
1031 __entry->ino = page_file_mapping(page)->host->i_ino;
Chao Yu3e1c8f12014-12-23 16:35:21 +08001032 __entry->index = page->index;
Chao Yu7a9d7542016-02-22 18:36:38 +08001033 __entry->old_blkaddr = fio->old_blkaddr;
1034 __entry->new_blkaddr = fio->new_blkaddr;
Mike Christie04d328d2016-06-05 14:31:55 -05001035 __entry->op = fio->op;
1036 __entry->op_flags = fio->op_flags;
Jaegeuk Kima912b542017-05-10 11:18:25 -07001037 __entry->temp = fio->temp;
Chao Yu2ace38e2014-12-24 16:08:14 +08001038 __entry->type = fio->type;
Chao Yu3e1c8f12014-12-23 16:35:21 +08001039 ),
1040
1041 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
Jaegeuk Kima912b542017-05-10 11:18:25 -07001042 "oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s",
Chao Yu3e1c8f12014-12-23 16:35:21 +08001043 show_dev_ino(__entry),
1044 (unsigned long)__entry->index,
Chao Yu7a9d7542016-02-22 18:36:38 +08001045 (unsigned long long)__entry->old_blkaddr,
1046 (unsigned long long)__entry->new_blkaddr,
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -08001047 show_bio_type(__entry->op, __entry->op_flags),
Jaegeuk Kima912b542017-05-10 11:18:25 -07001048 show_block_temp(__entry->temp),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001049 show_block_type(__entry->type))
1050);
1051
1052DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
1053
Chao Yu2ace38e2014-12-24 16:08:14 +08001054 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001055
Chao Yu2ace38e2014-12-24 16:08:14 +08001056 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001057
1058 TP_CONDITION(page->mapping)
1059);
1060
Jaegeuk Kimb9109b02017-05-10 11:28:38 -07001061DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_write,
Chao Yu3e1c8f12014-12-23 16:35:21 +08001062
Chao Yu2ace38e2014-12-24 16:08:14 +08001063 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001064
Chao Yu2ace38e2014-12-24 16:08:14 +08001065 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001066
1067 TP_CONDITION(page->mapping)
1068);
1069
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001070DECLARE_EVENT_CLASS(f2fs__bio,
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001071
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001072 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001073
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001074 TP_ARGS(sb, type, bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001075
1076 TP_STRUCT__entry(
1077 __field(dev_t, dev)
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001078 __field(dev_t, target)
Mike Christie04d328d2016-06-05 14:31:55 -05001079 __field(int, op)
1080 __field(int, op_flags)
Chao Yud4d288b2013-11-24 12:36:42 +09001081 __field(int, type)
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001082 __field(sector_t, sector)
1083 __field(unsigned int, size)
1084 ),
1085
1086 TP_fast_assign(
1087 __entry->dev = sb->s_dev;
Christoph Hellwig74d46992017-08-23 19:10:32 +02001088 __entry->target = bio_dev(bio);
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001089 __entry->op = bio_op(bio);
1090 __entry->op_flags = bio->bi_opf;
1091 __entry->type = type;
Kent Overstreet4f024f32013-10-11 15:44:27 -07001092 __entry->sector = bio->bi_iter.bi_sector;
1093 __entry->size = bio->bi_iter.bi_size;
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001094 ),
1095
Chao Yubaaabbb2017-05-04 09:35:43 +08001096 TP_printk("dev = (%d,%d)/(%d,%d), rw = %s(%s), %s, sector = %lld, size = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001097 show_dev(__entry->target),
1098 show_dev(__entry->dev),
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -08001099 show_bio_type(__entry->op, __entry->op_flags),
Chao Yud4d288b2013-11-24 12:36:42 +09001100 show_block_type(__entry->type),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001101 (unsigned long long)__entry->sector,
1102 __entry->size)
1103);
1104
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001105DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio,
Chao Yud4d288b2013-11-24 12:36:42 +09001106
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001107 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +09001108
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001109 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +09001110
1111 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +09001112);
1113
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001114DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio,
Chao Yud4d288b2013-11-24 12:36:42 +09001115
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001116 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +09001117
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001118 TP_ARGS(sb, type, bio),
1119
1120 TP_CONDITION(bio)
1121);
1122
1123DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_read_bio,
1124
1125 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1126
1127 TP_ARGS(sb, type, bio),
1128
1129 TP_CONDITION(bio)
1130);
1131
1132DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio,
1133
1134 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1135
1136 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +09001137
1138 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +09001139);
1140
Chao Yu62aed042014-05-06 16:46:04 +08001141TRACE_EVENT(f2fs_write_begin,
1142
1143 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1144 unsigned int flags),
1145
1146 TP_ARGS(inode, pos, len, flags),
1147
1148 TP_STRUCT__entry(
1149 __field(dev_t, dev)
1150 __field(ino_t, ino)
1151 __field(loff_t, pos)
1152 __field(unsigned int, len)
1153 __field(unsigned int, flags)
1154 ),
1155
1156 TP_fast_assign(
1157 __entry->dev = inode->i_sb->s_dev;
1158 __entry->ino = inode->i_ino;
1159 __entry->pos = pos;
1160 __entry->len = len;
1161 __entry->flags = flags;
1162 ),
1163
1164 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
1165 show_dev_ino(__entry),
1166 (unsigned long long)__entry->pos,
1167 __entry->len,
1168 __entry->flags)
1169);
1170
Chao Yudfb2bf32014-05-06 16:47:23 +08001171TRACE_EVENT(f2fs_write_end,
1172
1173 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1174 unsigned int copied),
1175
1176 TP_ARGS(inode, pos, len, copied),
1177
1178 TP_STRUCT__entry(
1179 __field(dev_t, dev)
1180 __field(ino_t, ino)
1181 __field(loff_t, pos)
1182 __field(unsigned int, len)
1183 __field(unsigned int, copied)
1184 ),
1185
1186 TP_fast_assign(
1187 __entry->dev = inode->i_sb->s_dev;
1188 __entry->ino = inode->i_ino;
1189 __entry->pos = pos;
1190 __entry->len = len;
1191 __entry->copied = copied;
1192 ),
1193
1194 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
1195 show_dev_ino(__entry),
1196 (unsigned long long)__entry->pos,
1197 __entry->len,
1198 __entry->copied)
1199);
1200
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001201DECLARE_EVENT_CLASS(f2fs__page,
1202
1203 TP_PROTO(struct page *page, int type),
1204
1205 TP_ARGS(page, type),
1206
1207 TP_STRUCT__entry(
1208 __field(dev_t, dev)
1209 __field(ino_t, ino)
1210 __field(int, type)
1211 __field(int, dir)
1212 __field(pgoff_t, index)
1213 __field(int, dirty)
Chao Yuc20e89c2014-05-06 16:53:08 +08001214 __field(int, uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001215 ),
1216
1217 TP_fast_assign(
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001218 __entry->dev = page_file_mapping(page)->host->i_sb->s_dev;
1219 __entry->ino = page_file_mapping(page)->host->i_ino;
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001220 __entry->type = type;
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001221 __entry->dir =
1222 S_ISDIR(page_file_mapping(page)->host->i_mode);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001223 __entry->index = page->index;
1224 __entry->dirty = PageDirty(page);
Chao Yuc20e89c2014-05-06 16:53:08 +08001225 __entry->uptodate = PageUptodate(page);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001226 ),
1227
Chao Yuc20e89c2014-05-06 16:53:08 +08001228 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
1229 "dirty = %d, uptodate = %d",
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001230 show_dev_ino(__entry),
1231 show_block_type(__entry->type),
1232 show_file_type(__entry->dir),
1233 (unsigned long)__entry->index,
Chao Yuc20e89c2014-05-06 16:53:08 +08001234 __entry->dirty,
1235 __entry->uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001236);
1237
Chao Yuecda0de2014-05-06 16:48:26 +08001238DEFINE_EVENT(f2fs__page, f2fs_writepage,
1239
1240 TP_PROTO(struct page *page, int type),
1241
1242 TP_ARGS(page, type)
1243);
1244
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -07001245DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
1246
1247 TP_PROTO(struct page *page, int type),
1248
1249 TP_ARGS(page, type)
1250);
1251
Chao Yuc20e89c2014-05-06 16:53:08 +08001252DEFINE_EVENT(f2fs__page, f2fs_readpage,
1253
1254 TP_PROTO(struct page *page, int type),
1255
1256 TP_ARGS(page, type)
1257);
1258
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001259DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
1260
1261 TP_PROTO(struct page *page, int type),
1262
1263 TP_ARGS(page, type)
1264);
1265
Jaegeuk Kime943a102013-10-25 14:26:31 +09001266DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
1267
1268 TP_PROTO(struct page *page, int type),
1269
1270 TP_ARGS(page, type)
1271);
1272
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -07001273DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
1274
1275 TP_PROTO(struct page *page, int type),
1276
1277 TP_ARGS(page, type)
1278);
1279
1280DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
1281
1282 TP_PROTO(struct page *page, int type),
1283
1284 TP_ARGS(page, type)
1285);
1286
Chao Yud7648342019-04-15 15:22:19 +08001287TRACE_EVENT(f2fs_filemap_fault,
1288
1289 TP_PROTO(struct inode *inode, pgoff_t index, unsigned long ret),
1290
1291 TP_ARGS(inode, index, ret),
1292
1293 TP_STRUCT__entry(
1294 __field(dev_t, dev)
1295 __field(ino_t, ino)
1296 __field(pgoff_t, index)
1297 __field(unsigned long, ret)
1298 ),
1299
1300 TP_fast_assign(
1301 __entry->dev = inode->i_sb->s_dev;
1302 __entry->ino = inode->i_ino;
1303 __entry->index = index;
1304 __entry->ret = ret;
1305 ),
1306
1307 TP_printk("dev = (%d,%d), ino = %lu, index = %lu, ret = %lx",
1308 show_dev_ino(__entry),
1309 (unsigned long)__entry->index,
1310 __entry->ret)
1311);
1312
Chao Yue5748432014-05-06 16:51:24 +08001313TRACE_EVENT(f2fs_writepages,
1314
1315 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
1316
1317 TP_ARGS(inode, wbc, type),
1318
1319 TP_STRUCT__entry(
1320 __field(dev_t, dev)
1321 __field(ino_t, ino)
1322 __field(int, type)
1323 __field(int, dir)
1324 __field(long, nr_to_write)
1325 __field(long, pages_skipped)
1326 __field(loff_t, range_start)
1327 __field(loff_t, range_end)
1328 __field(pgoff_t, writeback_index)
1329 __field(int, sync_mode)
1330 __field(char, for_kupdate)
1331 __field(char, for_background)
1332 __field(char, tagged_writepages)
1333 __field(char, for_reclaim)
1334 __field(char, range_cyclic)
1335 __field(char, for_sync)
1336 ),
1337
1338 TP_fast_assign(
1339 __entry->dev = inode->i_sb->s_dev;
1340 __entry->ino = inode->i_ino;
1341 __entry->type = type;
1342 __entry->dir = S_ISDIR(inode->i_mode);
1343 __entry->nr_to_write = wbc->nr_to_write;
1344 __entry->pages_skipped = wbc->pages_skipped;
1345 __entry->range_start = wbc->range_start;
1346 __entry->range_end = wbc->range_end;
1347 __entry->writeback_index = inode->i_mapping->writeback_index;
1348 __entry->sync_mode = wbc->sync_mode;
1349 __entry->for_kupdate = wbc->for_kupdate;
1350 __entry->for_background = wbc->for_background;
1351 __entry->tagged_writepages = wbc->tagged_writepages;
1352 __entry->for_reclaim = wbc->for_reclaim;
1353 __entry->range_cyclic = wbc->range_cyclic;
1354 __entry->for_sync = wbc->for_sync;
1355 ),
1356
1357 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1358 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1359 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1360 show_dev_ino(__entry),
1361 show_block_type(__entry->type),
1362 show_file_type(__entry->dir),
1363 __entry->nr_to_write,
1364 __entry->pages_skipped,
1365 __entry->range_start,
1366 __entry->range_end,
1367 (unsigned long)__entry->writeback_index,
1368 __entry->sync_mode,
1369 __entry->for_kupdate,
1370 __entry->for_background,
1371 __entry->tagged_writepages,
1372 __entry->for_reclaim,
1373 __entry->range_cyclic,
1374 __entry->for_sync)
1375);
1376
Chao Yub8c29402015-10-12 17:02:26 +08001377TRACE_EVENT(f2fs_readpages,
1378
Matthew Wilcox (Oracle)23323192020-06-01 21:47:23 -07001379 TP_PROTO(struct inode *inode, pgoff_t start, unsigned int nrpage),
Chao Yub8c29402015-10-12 17:02:26 +08001380
Matthew Wilcox (Oracle)23323192020-06-01 21:47:23 -07001381 TP_ARGS(inode, start, nrpage),
Chao Yub8c29402015-10-12 17:02:26 +08001382
1383 TP_STRUCT__entry(
1384 __field(dev_t, dev)
1385 __field(ino_t, ino)
1386 __field(pgoff_t, start)
1387 __field(unsigned int, nrpage)
1388 ),
1389
1390 TP_fast_assign(
1391 __entry->dev = inode->i_sb->s_dev;
1392 __entry->ino = inode->i_ino;
Matthew Wilcox (Oracle)23323192020-06-01 21:47:23 -07001393 __entry->start = start;
Chao Yub8c29402015-10-12 17:02:26 +08001394 __entry->nrpage = nrpage;
1395 ),
1396
1397 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1398 show_dev_ino(__entry),
1399 (unsigned long)__entry->start,
1400 __entry->nrpage)
1401);
1402
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001403TRACE_EVENT(f2fs_write_checkpoint,
1404
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001405 TP_PROTO(struct super_block *sb, int reason, char *msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001406
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001407 TP_ARGS(sb, reason, msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001408
1409 TP_STRUCT__entry(
1410 __field(dev_t, dev)
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001411 __field(int, reason)
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001412 __field(char *, msg)
1413 ),
1414
1415 TP_fast_assign(
1416 __entry->dev = sb->s_dev;
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001417 __entry->reason = reason;
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001418 __entry->msg = msg;
1419 ),
1420
1421 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001422 show_dev(__entry->dev),
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001423 show_cpreason(__entry->reason),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001424 __entry->msg)
1425);
1426
Chao Yu0243a5f2017-04-15 14:09:38 +08001427DECLARE_EVENT_CLASS(f2fs_discard,
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001428
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001429 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001430
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001431 TP_ARGS(dev, blkstart, blklen),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001432
1433 TP_STRUCT__entry(
1434 __field(dev_t, dev)
1435 __field(block_t, blkstart)
1436 __field(block_t, blklen)
1437 ),
1438
1439 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001440 __entry->dev = dev->bd_dev;
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001441 __entry->blkstart = blkstart;
1442 __entry->blklen = blklen;
1443 ),
1444
1445 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001446 show_dev(__entry->dev),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001447 (unsigned long long)__entry->blkstart,
1448 (unsigned long long)__entry->blklen)
1449);
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001450
Chao Yu0243a5f2017-04-15 14:09:38 +08001451DEFINE_EVENT(f2fs_discard, f2fs_queue_discard,
1452
1453 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1454
1455 TP_ARGS(dev, blkstart, blklen)
1456);
1457
1458DEFINE_EVENT(f2fs_discard, f2fs_issue_discard,
1459
1460 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1461
1462 TP_ARGS(dev, blkstart, blklen)
1463);
1464
Chao Yu2ec6f2e2017-10-04 09:08:36 +08001465DEFINE_EVENT(f2fs_discard, f2fs_remove_discard,
1466
1467 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1468
1469 TP_ARGS(dev, blkstart, blklen)
1470);
1471
Damien Le Moal126606c2016-10-28 17:45:07 +09001472TRACE_EVENT(f2fs_issue_reset_zone,
1473
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001474 TP_PROTO(struct block_device *dev, block_t blkstart),
Damien Le Moal126606c2016-10-28 17:45:07 +09001475
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001476 TP_ARGS(dev, blkstart),
Damien Le Moal126606c2016-10-28 17:45:07 +09001477
1478 TP_STRUCT__entry(
1479 __field(dev_t, dev)
1480 __field(block_t, blkstart)
1481 ),
1482
1483 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001484 __entry->dev = dev->bd_dev;
Damien Le Moal126606c2016-10-28 17:45:07 +09001485 __entry->blkstart = blkstart;
1486 ),
1487
1488 TP_printk("dev = (%d,%d), reset zone at block = 0x%llx",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001489 show_dev(__entry->dev),
Damien Le Moal126606c2016-10-28 17:45:07 +09001490 (unsigned long long)__entry->blkstart)
1491);
1492
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001493TRACE_EVENT(f2fs_issue_flush,
1494
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001495 TP_PROTO(struct block_device *dev, unsigned int nobarrier,
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001496 unsigned int flush_merge, int ret),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001497
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001498 TP_ARGS(dev, nobarrier, flush_merge, ret),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001499
1500 TP_STRUCT__entry(
1501 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -08001502 __field(unsigned int, nobarrier)
1503 __field(unsigned int, flush_merge)
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001504 __field(int, ret)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001505 ),
1506
1507 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001508 __entry->dev = dev->bd_dev;
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001509 __entry->nobarrier = nobarrier;
1510 __entry->flush_merge = flush_merge;
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001511 __entry->ret = ret;
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001512 ),
1513
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001514 TP_printk("dev = (%d,%d), %s %s, ret = %d",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001515 show_dev(__entry->dev),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001516 __entry->nobarrier ? "skip (nobarrier)" : "issue",
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001517 __entry->flush_merge ? " with flush_merge" : "",
1518 __entry->ret)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001519);
Chao Yu1ec46102015-02-05 17:59:59 +08001520
1521TRACE_EVENT(f2fs_lookup_extent_tree_start,
1522
1523 TP_PROTO(struct inode *inode, unsigned int pgofs),
1524
1525 TP_ARGS(inode, pgofs),
1526
1527 TP_STRUCT__entry(
1528 __field(dev_t, dev)
1529 __field(ino_t, ino)
1530 __field(unsigned int, pgofs)
1531 ),
1532
1533 TP_fast_assign(
1534 __entry->dev = inode->i_sb->s_dev;
1535 __entry->ino = inode->i_ino;
1536 __entry->pgofs = pgofs;
1537 ),
1538
1539 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1540 show_dev_ino(__entry),
1541 __entry->pgofs)
1542);
1543
1544TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1545
1546 TP_PROTO(struct inode *inode, unsigned int pgofs,
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001547 struct extent_info *ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001548
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001549 TP_ARGS(inode, pgofs, ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001550
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001551 TP_CONDITION(ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001552
1553 TP_STRUCT__entry(
1554 __field(dev_t, dev)
1555 __field(ino_t, ino)
1556 __field(unsigned int, pgofs)
1557 __field(unsigned int, fofs)
1558 __field(u32, blk)
1559 __field(unsigned int, len)
1560 ),
1561
1562 TP_fast_assign(
1563 __entry->dev = inode->i_sb->s_dev;
1564 __entry->ino = inode->i_ino;
1565 __entry->pgofs = pgofs;
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001566 __entry->fofs = ei->fofs;
1567 __entry->blk = ei->blk;
1568 __entry->len = ei->len;
Chao Yu1ec46102015-02-05 17:59:59 +08001569 ),
1570
1571 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1572 "ext_info(fofs: %u, blk: %u, len: %u)",
1573 show_dev_ino(__entry),
1574 __entry->pgofs,
1575 __entry->fofs,
1576 __entry->blk,
1577 __entry->len)
1578);
1579
Chao Yu744288c2015-09-06 17:50:13 +08001580TRACE_EVENT(f2fs_update_extent_tree_range,
Chao Yu1ec46102015-02-05 17:59:59 +08001581
Chao Yu744288c2015-09-06 17:50:13 +08001582 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1583 unsigned int len),
Chao Yu1ec46102015-02-05 17:59:59 +08001584
Chao Yu744288c2015-09-06 17:50:13 +08001585 TP_ARGS(inode, pgofs, blkaddr, len),
Chao Yu1ec46102015-02-05 17:59:59 +08001586
1587 TP_STRUCT__entry(
1588 __field(dev_t, dev)
1589 __field(ino_t, ino)
1590 __field(unsigned int, pgofs)
1591 __field(u32, blk)
Chao Yu744288c2015-09-06 17:50:13 +08001592 __field(unsigned int, len)
Chao Yu1ec46102015-02-05 17:59:59 +08001593 ),
1594
1595 TP_fast_assign(
1596 __entry->dev = inode->i_sb->s_dev;
1597 __entry->ino = inode->i_ino;
1598 __entry->pgofs = pgofs;
1599 __entry->blk = blkaddr;
Chao Yu744288c2015-09-06 17:50:13 +08001600 __entry->len = len;
Chao Yu1ec46102015-02-05 17:59:59 +08001601 ),
1602
Chao Yu744288c2015-09-06 17:50:13 +08001603 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1604 "blkaddr = %u, len = %u",
Chao Yu1ec46102015-02-05 17:59:59 +08001605 show_dev_ino(__entry),
1606 __entry->pgofs,
Chao Yu744288c2015-09-06 17:50:13 +08001607 __entry->blk,
1608 __entry->len)
Chao Yu1ec46102015-02-05 17:59:59 +08001609);
1610
1611TRACE_EVENT(f2fs_shrink_extent_tree,
1612
1613 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1614 unsigned int tree_cnt),
1615
1616 TP_ARGS(sbi, node_cnt, tree_cnt),
1617
1618 TP_STRUCT__entry(
1619 __field(dev_t, dev)
1620 __field(unsigned int, node_cnt)
1621 __field(unsigned int, tree_cnt)
1622 ),
1623
1624 TP_fast_assign(
1625 __entry->dev = sbi->sb->s_dev;
1626 __entry->node_cnt = node_cnt;
1627 __entry->tree_cnt = tree_cnt;
1628 ),
1629
1630 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001631 show_dev(__entry->dev),
Chao Yu1ec46102015-02-05 17:59:59 +08001632 __entry->node_cnt,
1633 __entry->tree_cnt)
1634);
1635
1636TRACE_EVENT(f2fs_destroy_extent_tree,
1637
1638 TP_PROTO(struct inode *inode, unsigned int node_cnt),
1639
1640 TP_ARGS(inode, node_cnt),
1641
1642 TP_STRUCT__entry(
1643 __field(dev_t, dev)
1644 __field(ino_t, ino)
1645 __field(unsigned int, node_cnt)
1646 ),
1647
1648 TP_fast_assign(
1649 __entry->dev = inode->i_sb->s_dev;
1650 __entry->ino = inode->i_ino;
1651 __entry->node_cnt = node_cnt;
1652 ),
1653
1654 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1655 show_dev_ino(__entry),
1656 __entry->node_cnt)
1657);
1658
Chao Yu4cf18532015-12-17 17:17:16 +08001659DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
1660
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001661 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001662
1663 TP_ARGS(sb, type, count),
1664
1665 TP_STRUCT__entry(
1666 __field(dev_t, dev)
1667 __field(int, type)
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001668 __field(s64, count)
Chao Yu4cf18532015-12-17 17:17:16 +08001669 ),
1670
1671 TP_fast_assign(
1672 __entry->dev = sb->s_dev;
1673 __entry->type = type;
1674 __entry->count = count;
1675 ),
1676
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001677 TP_printk("dev = (%d,%d), %s, dirty count = %lld",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001678 show_dev(__entry->dev),
Chao Yu4cf18532015-12-17 17:17:16 +08001679 show_file_type(__entry->type),
1680 __entry->count)
1681);
1682
1683DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
1684
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001685 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001686
1687 TP_ARGS(sb, type, count)
1688);
1689
1690DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
1691
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001692 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001693
1694 TP_ARGS(sb, type, count)
1695);
1696
Chao Yu559e87c2019-02-26 19:01:15 +08001697TRACE_EVENT(f2fs_shutdown,
1698
1699 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int mode, int ret),
1700
1701 TP_ARGS(sbi, mode, ret),
1702
1703 TP_STRUCT__entry(
1704 __field(dev_t, dev)
1705 __field(unsigned int, mode)
1706 __field(int, ret)
1707 ),
1708
1709 TP_fast_assign(
1710 __entry->dev = sbi->sb->s_dev;
1711 __entry->mode = mode;
1712 __entry->ret = ret;
1713 ),
1714
1715 TP_printk("dev = (%d,%d), mode: %s, ret:%d",
1716 show_dev(__entry->dev),
1717 show_shutdown_mode(__entry->mode),
1718 __entry->ret)
1719);
1720
Chao Yu4c8ff702019-11-01 18:07:14 +08001721DECLARE_EVENT_CLASS(f2fs_zip_start,
1722
1723 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1724 unsigned int cluster_size, unsigned char algtype),
1725
1726 TP_ARGS(inode, cluster_idx, cluster_size, algtype),
1727
1728 TP_STRUCT__entry(
1729 __field(dev_t, dev)
1730 __field(ino_t, ino)
1731 __field(pgoff_t, idx)
1732 __field(unsigned int, size)
1733 __field(unsigned int, algtype)
1734 ),
1735
1736 TP_fast_assign(
1737 __entry->dev = inode->i_sb->s_dev;
1738 __entry->ino = inode->i_ino;
1739 __entry->idx = cluster_idx;
1740 __entry->size = cluster_size;
1741 __entry->algtype = algtype;
1742 ),
1743
1744 TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
1745 "cluster_size = %u, algorithm = %s",
1746 show_dev_ino(__entry),
1747 __entry->idx,
1748 __entry->size,
1749 show_compress_algorithm(__entry->algtype))
1750);
1751
1752DECLARE_EVENT_CLASS(f2fs_zip_end,
1753
1754 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1755 unsigned int compressed_size, int ret),
1756
1757 TP_ARGS(inode, cluster_idx, compressed_size, ret),
1758
1759 TP_STRUCT__entry(
1760 __field(dev_t, dev)
1761 __field(ino_t, ino)
1762 __field(pgoff_t, idx)
1763 __field(unsigned int, size)
1764 __field(unsigned int, ret)
1765 ),
1766
1767 TP_fast_assign(
1768 __entry->dev = inode->i_sb->s_dev;
1769 __entry->ino = inode->i_ino;
1770 __entry->idx = cluster_idx;
1771 __entry->size = compressed_size;
1772 __entry->ret = ret;
1773 ),
1774
1775 TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
1776 "compressed_size = %u, ret = %d",
1777 show_dev_ino(__entry),
1778 __entry->idx,
1779 __entry->size,
1780 __entry->ret)
1781);
1782
1783DEFINE_EVENT(f2fs_zip_start, f2fs_compress_pages_start,
1784
1785 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1786 unsigned int cluster_size, unsigned char algtype),
1787
1788 TP_ARGS(inode, cluster_idx, cluster_size, algtype)
1789);
1790
1791DEFINE_EVENT(f2fs_zip_start, f2fs_decompress_pages_start,
1792
1793 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1794 unsigned int cluster_size, unsigned char algtype),
1795
1796 TP_ARGS(inode, cluster_idx, cluster_size, algtype)
1797);
1798
1799DEFINE_EVENT(f2fs_zip_end, f2fs_compress_pages_end,
1800
1801 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1802 unsigned int compressed_size, int ret),
1803
1804 TP_ARGS(inode, cluster_idx, compressed_size, ret)
1805);
1806
1807DEFINE_EVENT(f2fs_zip_end, f2fs_decompress_pages_end,
1808
1809 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1810 unsigned int compressed_size, int ret),
1811
1812 TP_ARGS(inode, cluster_idx, compressed_size, ret)
1813);
1814
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09001815#endif /* _TRACE_F2FS_H */
1816
1817 /* This part must be outside protection */
1818#include <trace/define_trace.h>