blob: 8a1c1311acac4795a2e73b3e14c9e22e3d79a477 [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);
Jaegeuk Kimb4b10062020-03-31 11:43:07 -070053TRACE_DEFINE_ENUM(CP_RESIZE);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040054
Namjae Jeon6ec178d2013-04-23 17:51:43 +090055#define show_block_type(type) \
56 __print_symbolic(type, \
57 { NODE, "NODE" }, \
58 { DATA, "DATA" }, \
59 { META, "META" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070060 { META_FLUSH, "META_FLUSH" }, \
61 { INMEM, "INMEM" }, \
62 { INMEM_DROP, "INMEM_DROP" }, \
Jaegeuk Kim8c242db2017-03-17 09:55:52 +080063 { INMEM_INVALIDATE, "INMEM_INVALIDATE" }, \
Chao Yu28bc1062016-02-06 14:40:34 +080064 { INMEM_REVOKE, "INMEM_REVOKE" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070065 { IPU, "IN-PLACE" }, \
66 { OPU, "OUT-OF-PLACE" })
Namjae Jeon6ec178d2013-04-23 17:51:43 +090067
Jaegeuk Kima912b542017-05-10 11:18:25 -070068#define show_block_temp(temp) \
69 __print_symbolic(temp, \
70 { HOT, "HOT" }, \
71 { WARM, "WARM" }, \
72 { COLD, "COLD" })
73
Chao Yubaaabbb2017-05-04 09:35:43 +080074#define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_META | REQ_PRIO | \
75 REQ_PREFLUSH | REQ_FUA)
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080076#define F2FS_BIO_FLAG_MASK(t) (t & F2FS_OP_FLAGS)
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090077
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080078#define show_bio_type(op,op_flags) show_bio_op(op), \
79 show_bio_op_flags(op_flags)
80
Chaitanya Kulkarni0ce35372019-06-20 10:59:19 -070081#define show_bio_op(op) blk_op_str(op)
Mike Christie04d328d2016-06-05 14:31:55 -050082
83#define show_bio_op_flags(flags) \
Chao Yubaaabbb2017-05-04 09:35:43 +080084 __print_flags(F2FS_BIO_FLAG_MASK(flags), "|", \
85 { REQ_RAHEAD, "R" }, \
86 { REQ_SYNC, "S" }, \
87 { REQ_META, "M" }, \
88 { REQ_PRIO, "P" }, \
89 { REQ_PREFLUSH, "PF" }, \
90 { REQ_FUA, "FUA" })
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090091
Namjae Jeon8e46b3e2013-04-23 16:42:53 +090092#define show_data_type(type) \
93 __print_symbolic(type, \
94 { CURSEG_HOT_DATA, "Hot DATA" }, \
95 { CURSEG_WARM_DATA, "Warm DATA" }, \
96 { CURSEG_COLD_DATA, "Cold DATA" }, \
97 { CURSEG_HOT_NODE, "Hot NODE" }, \
98 { CURSEG_WARM_NODE, "Warm NODE" }, \
99 { CURSEG_COLD_NODE, "Cold NODE" }, \
100 { NO_CHECK_TYPE, "No TYPE" })
101
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900102#define show_file_type(type) \
103 __print_symbolic(type, \
104 { 0, "FILE" }, \
105 { 1, "DIR" })
106
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900107#define show_gc_type(type) \
108 __print_symbolic(type, \
109 { FG_GC, "Foreground GC" }, \
110 { BG_GC, "Background GC" })
111
112#define show_alloc_mode(type) \
113 __print_symbolic(type, \
114 { LFS, "LFS-mode" }, \
115 { SSR, "SSR-mode" })
116
117#define show_victim_policy(type) \
118 __print_symbolic(type, \
119 { GC_GREEDY, "Greedy" }, \
120 { GC_CB, "Cost-Benefit" })
121
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700122#define show_cpreason(type) \
Chao Yubaaabbb2017-05-04 09:35:43 +0800123 __print_flags(type, "|", \
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700124 { CP_UMOUNT, "Umount" }, \
Jaegeuk Kim119ee912015-01-29 11:45:33 -0800125 { CP_FASTBOOT, "Fastboot" }, \
Jaegeuk Kim4b2fecc2014-09-20 22:06:39 -0700126 { CP_SYNC, "Sync" }, \
Jaegeuk Kim10027552015-04-09 17:03:53 -0700127 { CP_RECOVERY, "Recovery" }, \
Chao Yu1f43e2a2017-04-28 13:56:08 +0800128 { CP_DISCARD, "Discard" }, \
Sahitya Tummalafad5fbc2020-01-03 08:49:28 +0530129 { CP_PAUSE, "Pause" }, \
Jaegeuk Kimb4b10062020-03-31 11:43:07 -0700130 { CP_TRIMMED, "Trimmed" }, \
131 { CP_RESIZE, "Resize" })
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700132
Chao Yua5fd5052017-11-06 22:51:45 +0800133#define show_fsync_cpreason(type) \
134 __print_symbolic(type, \
135 { CP_NO_NEEDED, "no needed" }, \
136 { CP_NON_REGULAR, "non regular" }, \
Chao Yu4c8ff702019-11-01 18:07:14 +0800137 { CP_COMPRESSED, "compreesed" }, \
Chao Yua5fd5052017-11-06 22:51:45 +0800138 { CP_HARDLINK, "hardlink" }, \
139 { CP_SB_NEED_CP, "sb needs cp" }, \
140 { CP_WRONG_PINO, "wrong pino" }, \
141 { CP_NO_SPC_ROLL, "no space roll forward" }, \
142 { CP_NODE_NEED_CP, "node needs cp" }, \
143 { CP_FASTBOOT_MODE, "fastboot mode" }, \
Jaegeuk Kim0a007b972017-12-28 08:09:44 -0800144 { CP_SPEC_LOG_NUM, "log type is 2" }, \
145 { CP_RECOVER_DIR, "dir needs recovery" })
Chao Yua5fd5052017-11-06 22:51:45 +0800146
Chao Yu559e87c2019-02-26 19:01:15 +0800147#define show_shutdown_mode(type) \
148 __print_symbolic(type, \
149 { F2FS_GOING_DOWN_FULLSYNC, "full sync" }, \
150 { F2FS_GOING_DOWN_METASYNC, "meta sync" }, \
151 { F2FS_GOING_DOWN_NOSYNC, "no sync" }, \
152 { F2FS_GOING_DOWN_METAFLUSH, "meta flush" }, \
153 { F2FS_GOING_DOWN_NEED_FSCK, "need fsck" })
154
Chao Yu4c8ff702019-11-01 18:07:14 +0800155#define show_compress_algorithm(type) \
156 __print_symbolic(type, \
157 { COMPRESS_LZO, "LZO" }, \
Chao Yu50cfa662020-03-03 17:46:02 +0800158 { COMPRESS_LZ4, "LZ4" }, \
Chao Yu6d92b202020-04-08 19:56:32 +0800159 { COMPRESS_ZSTD, "ZSTD" }, \
160 { COMPRESS_LZORLE, "LZO-RLE" })
Chao Yu4c8ff702019-11-01 18:07:14 +0800161
Zhikang Zhang539cd352019-01-03 20:06:38 +0800162struct f2fs_sb_info;
163struct f2fs_io_info;
164struct extent_info;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900165struct victim_sel_policy;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700166struct f2fs_map_blocks;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900167
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900168DECLARE_EVENT_CLASS(f2fs__inode,
169
170 TP_PROTO(struct inode *inode),
171
172 TP_ARGS(inode),
173
174 TP_STRUCT__entry(
175 __field(dev_t, dev)
176 __field(ino_t, ino)
177 __field(ino_t, pino)
178 __field(umode_t, mode)
179 __field(loff_t, size)
180 __field(unsigned int, nlink)
181 __field(blkcnt_t, blocks)
182 __field(__u8, advise)
183 ),
184
185 TP_fast_assign(
186 __entry->dev = inode->i_sb->s_dev;
187 __entry->ino = inode->i_ino;
188 __entry->pino = F2FS_I(inode)->i_pino;
189 __entry->mode = inode->i_mode;
190 __entry->nlink = inode->i_nlink;
191 __entry->size = inode->i_size;
192 __entry->blocks = inode->i_blocks;
193 __entry->advise = F2FS_I(inode)->i_advise;
194 ),
195
196 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
197 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
198 show_dev_ino(__entry),
199 (unsigned long)__entry->pino,
200 __entry->mode,
201 __entry->size,
202 (unsigned int)__entry->nlink,
203 (unsigned long long)__entry->blocks,
204 (unsigned char)__entry->advise)
205);
206
207DECLARE_EVENT_CLASS(f2fs__inode_exit,
208
209 TP_PROTO(struct inode *inode, int ret),
210
211 TP_ARGS(inode, ret),
212
213 TP_STRUCT__entry(
214 __field(dev_t, dev)
215 __field(ino_t, ino)
216 __field(int, ret)
217 ),
218
219 TP_fast_assign(
220 __entry->dev = inode->i_sb->s_dev;
221 __entry->ino = inode->i_ino;
222 __entry->ret = ret;
223 ),
224
225 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
226 show_dev_ino(__entry),
227 __entry->ret)
228);
229
230DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
231
232 TP_PROTO(struct inode *inode),
233
234 TP_ARGS(inode)
235);
236
237TRACE_EVENT(f2fs_sync_file_exit,
238
Chao Yua5fd5052017-11-06 22:51:45 +0800239 TP_PROTO(struct inode *inode, int cp_reason, int datasync, int ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900240
Chao Yua5fd5052017-11-06 22:51:45 +0800241 TP_ARGS(inode, cp_reason, datasync, ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900242
243 TP_STRUCT__entry(
244 __field(dev_t, dev)
245 __field(ino_t, ino)
Chao Yua5fd5052017-11-06 22:51:45 +0800246 __field(int, cp_reason)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900247 __field(int, datasync)
248 __field(int, ret)
249 ),
250
251 TP_fast_assign(
252 __entry->dev = inode->i_sb->s_dev;
253 __entry->ino = inode->i_ino;
Chao Yua5fd5052017-11-06 22:51:45 +0800254 __entry->cp_reason = cp_reason;
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900255 __entry->datasync = datasync;
256 __entry->ret = ret;
257 ),
258
Chao Yua5fd5052017-11-06 22:51:45 +0800259 TP_printk("dev = (%d,%d), ino = %lu, cp_reason: %s, "
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900260 "datasync = %d, ret = %d",
261 show_dev_ino(__entry),
Chao Yua5fd5052017-11-06 22:51:45 +0800262 show_fsync_cpreason(__entry->cp_reason),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900263 __entry->datasync,
264 __entry->ret)
265);
266
267TRACE_EVENT(f2fs_sync_fs,
268
269 TP_PROTO(struct super_block *sb, int wait),
270
271 TP_ARGS(sb, wait),
272
273 TP_STRUCT__entry(
274 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800275 __field(int, dirty)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900276 __field(int, wait)
277 ),
278
279 TP_fast_assign(
280 __entry->dev = sb->s_dev;
Chao Yucaf00472015-01-28 17:48:42 +0800281 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900282 __entry->wait = wait;
283 ),
284
285 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800286 show_dev(__entry->dev),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900287 __entry->dirty ? "dirty" : "not dirty",
288 __entry->wait)
289);
290
291DEFINE_EVENT(f2fs__inode, f2fs_iget,
292
293 TP_PROTO(struct inode *inode),
294
295 TP_ARGS(inode)
296);
297
298DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
299
300 TP_PROTO(struct inode *inode, int ret),
301
302 TP_ARGS(inode, ret)
303);
304
305DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
306
307 TP_PROTO(struct inode *inode),
308
309 TP_ARGS(inode)
310);
311
Jaegeuk Kimd70b4f52013-04-25 13:24:33 +0900312DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
313
314 TP_PROTO(struct inode *inode, int ret),
315
316 TP_ARGS(inode, ret)
317);
318
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900319TRACE_EVENT(f2fs_unlink_enter,
320
321 TP_PROTO(struct inode *dir, struct dentry *dentry),
322
323 TP_ARGS(dir, dentry),
324
325 TP_STRUCT__entry(
326 __field(dev_t, dev)
327 __field(ino_t, ino)
328 __field(loff_t, size)
329 __field(blkcnt_t, blocks)
330 __field(const char *, name)
331 ),
332
333 TP_fast_assign(
334 __entry->dev = dir->i_sb->s_dev;
335 __entry->ino = dir->i_ino;
336 __entry->size = dir->i_size;
337 __entry->blocks = dir->i_blocks;
338 __entry->name = dentry->d_name.name;
339 ),
340
341 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
342 "i_blocks = %llu, name = %s",
343 show_dev_ino(__entry),
344 __entry->size,
345 (unsigned long long)__entry->blocks,
346 __entry->name)
347);
348
349DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
350
351 TP_PROTO(struct inode *inode, int ret),
352
353 TP_ARGS(inode, ret)
354);
Namjae Jeon51dd6242013-04-20 01:28:52 +0900355
Hou Pengyangb8d96a32017-02-27 13:02:58 +0000356DEFINE_EVENT(f2fs__inode_exit, f2fs_drop_inode,
357
358 TP_PROTO(struct inode *inode, int ret),
359
360 TP_ARGS(inode, ret)
361);
362
Namjae Jeon51dd6242013-04-20 01:28:52 +0900363DEFINE_EVENT(f2fs__inode, f2fs_truncate,
364
365 TP_PROTO(struct inode *inode),
366
367 TP_ARGS(inode)
368);
369
370TRACE_EVENT(f2fs_truncate_data_blocks_range,
371
372 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
373
374 TP_ARGS(inode, nid, ofs, free),
375
376 TP_STRUCT__entry(
377 __field(dev_t, dev)
378 __field(ino_t, ino)
379 __field(nid_t, nid)
380 __field(unsigned int, ofs)
381 __field(int, free)
382 ),
383
384 TP_fast_assign(
385 __entry->dev = inode->i_sb->s_dev;
386 __entry->ino = inode->i_ino;
387 __entry->nid = nid;
388 __entry->ofs = ofs;
389 __entry->free = free;
390 ),
391
392 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
393 show_dev_ino(__entry),
394 (unsigned int)__entry->nid,
395 __entry->ofs,
396 __entry->free)
397);
398
399DECLARE_EVENT_CLASS(f2fs__truncate_op,
400
401 TP_PROTO(struct inode *inode, u64 from),
402
403 TP_ARGS(inode, from),
404
405 TP_STRUCT__entry(
406 __field(dev_t, dev)
407 __field(ino_t, ino)
408 __field(loff_t, size)
409 __field(blkcnt_t, blocks)
410 __field(u64, from)
411 ),
412
413 TP_fast_assign(
414 __entry->dev = inode->i_sb->s_dev;
415 __entry->ino = inode->i_ino;
416 __entry->size = inode->i_size;
417 __entry->blocks = inode->i_blocks;
418 __entry->from = from;
419 ),
420
421 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
422 "start file offset = %llu",
423 show_dev_ino(__entry),
424 __entry->size,
425 (unsigned long long)__entry->blocks,
426 (unsigned long long)__entry->from)
427);
428
429DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
430
431 TP_PROTO(struct inode *inode, u64 from),
432
433 TP_ARGS(inode, from)
434);
435
436DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
437
438 TP_PROTO(struct inode *inode, int ret),
439
440 TP_ARGS(inode, ret)
441);
442
443DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
444
445 TP_PROTO(struct inode *inode, u64 from),
446
447 TP_ARGS(inode, from)
448);
449
450DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
451
452 TP_PROTO(struct inode *inode, int ret),
453
454 TP_ARGS(inode, ret)
455);
456
457DECLARE_EVENT_CLASS(f2fs__truncate_node,
458
459 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
460
461 TP_ARGS(inode, nid, blk_addr),
462
463 TP_STRUCT__entry(
464 __field(dev_t, dev)
465 __field(ino_t, ino)
466 __field(nid_t, nid)
467 __field(block_t, blk_addr)
468 ),
469
470 TP_fast_assign(
471 __entry->dev = inode->i_sb->s_dev;
472 __entry->ino = inode->i_ino;
473 __entry->nid = nid;
474 __entry->blk_addr = blk_addr;
475 ),
476
477 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
478 show_dev_ino(__entry),
479 (unsigned int)__entry->nid,
480 (unsigned long long)__entry->blk_addr)
481);
482
483DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
484
485 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
486
487 TP_ARGS(inode, nid, blk_addr)
488);
489
490DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
491
492 TP_PROTO(struct inode *inode, int ret),
493
494 TP_ARGS(inode, ret)
495);
496
497DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
498
499 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
500
501 TP_ARGS(inode, nid, blk_addr)
502);
503
504TRACE_EVENT(f2fs_truncate_partial_nodes,
505
Alexei Starovoitovc1055472018-03-28 12:05:32 -0700506 TP_PROTO(struct inode *inode, nid_t *nid, int depth, int err),
Namjae Jeon51dd6242013-04-20 01:28:52 +0900507
508 TP_ARGS(inode, nid, depth, err),
509
510 TP_STRUCT__entry(
511 __field(dev_t, dev)
512 __field(ino_t, ino)
513 __field(nid_t, nid[3])
514 __field(int, depth)
515 __field(int, err)
516 ),
517
518 TP_fast_assign(
519 __entry->dev = inode->i_sb->s_dev;
520 __entry->ino = inode->i_ino;
521 __entry->nid[0] = nid[0];
522 __entry->nid[1] = nid[1];
523 __entry->nid[2] = nid[2];
524 __entry->depth = depth;
525 __entry->err = err;
526 ),
527
528 TP_printk("dev = (%d,%d), ino = %lu, "
529 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
530 show_dev_ino(__entry),
531 (unsigned int)__entry->nid[0],
532 (unsigned int)__entry->nid[1],
533 (unsigned int)__entry->nid[2],
534 __entry->depth,
535 __entry->err)
536);
537
Chao Yu126ce722019-04-02 18:52:22 +0800538TRACE_EVENT(f2fs_file_write_iter,
539
540 TP_PROTO(struct inode *inode, unsigned long offset,
541 unsigned long length, int ret),
542
543 TP_ARGS(inode, offset, length, ret),
544
545 TP_STRUCT__entry(
546 __field(dev_t, dev)
547 __field(ino_t, ino)
548 __field(unsigned long, offset)
549 __field(unsigned long, length)
550 __field(int, ret)
551 ),
552
553 TP_fast_assign(
554 __entry->dev = inode->i_sb->s_dev;
555 __entry->ino = inode->i_ino;
556 __entry->offset = offset;
557 __entry->length = length;
558 __entry->ret = ret;
559 ),
560
561 TP_printk("dev = (%d,%d), ino = %lu, "
562 "offset = %lu, length = %lu, written(err) = %d",
563 show_dev_ino(__entry),
564 __entry->offset,
565 __entry->length,
566 __entry->ret)
567);
568
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700569TRACE_EVENT(f2fs_map_blocks,
570 TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900571
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700572 TP_ARGS(inode, map, ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900573
574 TP_STRUCT__entry(
575 __field(dev_t, dev)
576 __field(ino_t, ino)
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700577 __field(block_t, m_lblk)
578 __field(block_t, m_pblk)
579 __field(unsigned int, m_len)
Chao Yu76630f22019-02-26 19:01:16 +0800580 __field(unsigned int, m_flags)
581 __field(int, m_seg_type)
582 __field(bool, m_may_create)
Namjae Jeon848753a2013-04-23 16:38:02 +0900583 __field(int, ret)
584 ),
585
586 TP_fast_assign(
587 __entry->dev = inode->i_sb->s_dev;
588 __entry->ino = inode->i_ino;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700589 __entry->m_lblk = map->m_lblk;
590 __entry->m_pblk = map->m_pblk;
591 __entry->m_len = map->m_len;
Chao Yu76630f22019-02-26 19:01:16 +0800592 __entry->m_flags = map->m_flags;
593 __entry->m_seg_type = map->m_seg_type;
594 __entry->m_may_create = map->m_may_create;
Namjae Jeon848753a2013-04-23 16:38:02 +0900595 __entry->ret = ret;
596 ),
597
598 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
Chao Yu76630f22019-02-26 19:01:16 +0800599 "start blkaddr = 0x%llx, len = 0x%llx, flags = %u,"
600 "seg_type = %d, may_create = %d, err = %d",
Namjae Jeon848753a2013-04-23 16:38:02 +0900601 show_dev_ino(__entry),
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700602 (unsigned long long)__entry->m_lblk,
603 (unsigned long long)__entry->m_pblk,
604 (unsigned long long)__entry->m_len,
Chao Yu76630f22019-02-26 19:01:16 +0800605 __entry->m_flags,
606 __entry->m_seg_type,
607 __entry->m_may_create,
Namjae Jeon848753a2013-04-23 16:38:02 +0900608 __entry->ret)
609);
610
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700611TRACE_EVENT(f2fs_background_gc,
612
Chao Yub8c502b2017-08-07 23:12:46 +0800613 TP_PROTO(struct super_block *sb, unsigned int wait_ms,
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700614 unsigned int prefree, unsigned int free),
615
616 TP_ARGS(sb, wait_ms, prefree, free),
617
618 TP_STRUCT__entry(
619 __field(dev_t, dev)
Chao Yub8c502b2017-08-07 23:12:46 +0800620 __field(unsigned int, wait_ms)
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700621 __field(unsigned int, prefree)
622 __field(unsigned int, free)
623 ),
624
625 TP_fast_assign(
626 __entry->dev = sb->s_dev;
627 __entry->wait_ms = wait_ms;
628 __entry->prefree = prefree;
629 __entry->free = free;
630 ),
631
Chao Yub8c502b2017-08-07 23:12:46 +0800632 TP_printk("dev = (%d,%d), wait_ms = %u, prefree = %u, free = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800633 show_dev(__entry->dev),
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700634 __entry->wait_ms,
635 __entry->prefree,
636 __entry->free)
637);
638
Chao Yuc56f16d2017-08-11 18:00:15 +0800639TRACE_EVENT(f2fs_gc_begin,
640
641 TP_PROTO(struct super_block *sb, bool sync, bool background,
642 long long dirty_nodes, long long dirty_dents,
643 long long dirty_imeta, unsigned int free_sec,
644 unsigned int free_seg, int reserved_seg,
645 unsigned int prefree_seg),
646
647 TP_ARGS(sb, sync, background, dirty_nodes, dirty_dents, dirty_imeta,
648 free_sec, free_seg, reserved_seg, prefree_seg),
649
650 TP_STRUCT__entry(
651 __field(dev_t, dev)
652 __field(bool, sync)
653 __field(bool, background)
654 __field(long long, dirty_nodes)
655 __field(long long, dirty_dents)
656 __field(long long, dirty_imeta)
657 __field(unsigned int, free_sec)
658 __field(unsigned int, free_seg)
659 __field(int, reserved_seg)
660 __field(unsigned int, prefree_seg)
661 ),
662
663 TP_fast_assign(
664 __entry->dev = sb->s_dev;
665 __entry->sync = sync;
666 __entry->background = background;
667 __entry->dirty_nodes = dirty_nodes;
668 __entry->dirty_dents = dirty_dents;
669 __entry->dirty_imeta = dirty_imeta;
670 __entry->free_sec = free_sec;
671 __entry->free_seg = free_seg;
672 __entry->reserved_seg = reserved_seg;
673 __entry->prefree_seg = prefree_seg;
674 ),
675
676 TP_printk("dev = (%d,%d), sync = %d, background = %d, nodes = %lld, "
677 "dents = %lld, imeta = %lld, free_sec:%u, free_seg:%u, "
678 "rsv_seg:%d, prefree_seg:%u",
679 show_dev(__entry->dev),
680 __entry->sync,
681 __entry->background,
682 __entry->dirty_nodes,
683 __entry->dirty_dents,
684 __entry->dirty_imeta,
685 __entry->free_sec,
686 __entry->free_seg,
687 __entry->reserved_seg,
688 __entry->prefree_seg)
689);
690
691TRACE_EVENT(f2fs_gc_end,
692
693 TP_PROTO(struct super_block *sb, int ret, int seg_freed,
694 int sec_freed, long long dirty_nodes,
695 long long dirty_dents, long long dirty_imeta,
696 unsigned int free_sec, unsigned int free_seg,
697 int reserved_seg, unsigned int prefree_seg),
698
699 TP_ARGS(sb, ret, seg_freed, sec_freed, dirty_nodes, dirty_dents,
700 dirty_imeta, free_sec, free_seg, reserved_seg, prefree_seg),
701
702 TP_STRUCT__entry(
703 __field(dev_t, dev)
704 __field(int, ret)
705 __field(int, seg_freed)
706 __field(int, sec_freed)
707 __field(long long, dirty_nodes)
708 __field(long long, dirty_dents)
709 __field(long long, dirty_imeta)
710 __field(unsigned int, free_sec)
711 __field(unsigned int, free_seg)
712 __field(int, reserved_seg)
713 __field(unsigned int, prefree_seg)
714 ),
715
716 TP_fast_assign(
717 __entry->dev = sb->s_dev;
718 __entry->ret = ret;
719 __entry->seg_freed = seg_freed;
720 __entry->sec_freed = sec_freed;
721 __entry->dirty_nodes = dirty_nodes;
722 __entry->dirty_dents = dirty_dents;
723 __entry->dirty_imeta = dirty_imeta;
724 __entry->free_sec = free_sec;
725 __entry->free_seg = free_seg;
726 __entry->reserved_seg = reserved_seg;
727 __entry->prefree_seg = prefree_seg;
728 ),
729
730 TP_printk("dev = (%d,%d), ret = %d, seg_freed = %d, sec_freed = %d, "
731 "nodes = %lld, dents = %lld, imeta = %lld, free_sec:%u, "
732 "free_seg:%u, rsv_seg:%d, prefree_seg:%u",
733 show_dev(__entry->dev),
734 __entry->ret,
735 __entry->seg_freed,
736 __entry->sec_freed,
737 __entry->dirty_nodes,
738 __entry->dirty_dents,
739 __entry->dirty_imeta,
740 __entry->free_sec,
741 __entry->free_seg,
742 __entry->reserved_seg,
743 __entry->prefree_seg)
744);
745
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900746TRACE_EVENT(f2fs_get_victim,
747
748 TP_PROTO(struct super_block *sb, int type, int gc_type,
749 struct victim_sel_policy *p, unsigned int pre_victim,
750 unsigned int prefree, unsigned int free),
751
752 TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
753
754 TP_STRUCT__entry(
755 __field(dev_t, dev)
756 __field(int, type)
757 __field(int, gc_type)
758 __field(int, alloc_mode)
759 __field(int, gc_mode)
760 __field(unsigned int, victim)
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800761 __field(unsigned int, cost)
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900762 __field(unsigned int, ofs_unit)
763 __field(unsigned int, pre_victim)
764 __field(unsigned int, prefree)
765 __field(unsigned int, free)
766 ),
767
768 TP_fast_assign(
769 __entry->dev = sb->s_dev;
770 __entry->type = type;
771 __entry->gc_type = gc_type;
772 __entry->alloc_mode = p->alloc_mode;
773 __entry->gc_mode = p->gc_mode;
774 __entry->victim = p->min_segno;
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800775 __entry->cost = p->min_cost;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900776 __entry->ofs_unit = p->ofs_unit;
777 __entry->pre_victim = pre_victim;
778 __entry->prefree = prefree;
779 __entry->free = free;
780 ),
781
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800782 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), "
783 "victim = %u, cost = %u, ofs_unit = %u, "
784 "pre_victim_secno = %d, prefree = %u, free = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800785 show_dev(__entry->dev),
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900786 show_data_type(__entry->type),
787 show_gc_type(__entry->gc_type),
788 show_alloc_mode(__entry->alloc_mode),
789 show_victim_policy(__entry->gc_mode),
790 __entry->victim,
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800791 __entry->cost,
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900792 __entry->ofs_unit,
793 (int)__entry->pre_victim,
794 __entry->prefree,
795 __entry->free)
796);
797
Chao Yu0c5e36d2017-10-17 17:33:41 +0800798TRACE_EVENT(f2fs_lookup_start,
799
800 TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags),
801
802 TP_ARGS(dir, dentry, flags),
803
804 TP_STRUCT__entry(
805 __field(dev_t, dev)
806 __field(ino_t, ino)
807 __field(const char *, name)
808 __field(unsigned int, flags)
809 ),
810
811 TP_fast_assign(
812 __entry->dev = dir->i_sb->s_dev;
813 __entry->ino = dir->i_ino;
814 __entry->name = dentry->d_name.name;
815 __entry->flags = flags;
816 ),
817
818 TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u",
819 show_dev_ino(__entry),
820 __entry->name,
821 __entry->flags)
822);
823
824TRACE_EVENT(f2fs_lookup_end,
825
826 TP_PROTO(struct inode *dir, struct dentry *dentry, nid_t ino,
827 int err),
828
829 TP_ARGS(dir, dentry, ino, err),
830
831 TP_STRUCT__entry(
832 __field(dev_t, dev)
833 __field(ino_t, ino)
834 __field(const char *, name)
835 __field(nid_t, cino)
836 __field(int, err)
837 ),
838
839 TP_fast_assign(
840 __entry->dev = dir->i_sb->s_dev;
841 __entry->ino = dir->i_ino;
842 __entry->name = dentry->d_name.name;
843 __entry->cino = ino;
844 __entry->err = err;
845 ),
846
847 TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d",
848 show_dev_ino(__entry),
849 __entry->name,
850 __entry->cino,
851 __entry->err)
852);
853
Chao Yue97a3c42017-10-13 18:01:33 +0800854TRACE_EVENT(f2fs_readdir,
855
856 TP_PROTO(struct inode *dir, loff_t start_pos, loff_t end_pos, int err),
857
858 TP_ARGS(dir, start_pos, end_pos, err),
859
860 TP_STRUCT__entry(
861 __field(dev_t, dev)
862 __field(ino_t, ino)
863 __field(loff_t, start)
864 __field(loff_t, end)
865 __field(int, err)
866 ),
867
868 TP_fast_assign(
869 __entry->dev = dir->i_sb->s_dev;
870 __entry->ino = dir->i_ino;
871 __entry->start = start_pos;
872 __entry->end = end_pos;
873 __entry->err = err;
874 ),
875
876 TP_printk("dev = (%d,%d), ino = %lu, start_pos:%llu, end_pos:%llu, err:%d",
877 show_dev_ino(__entry),
878 __entry->start,
879 __entry->end,
880 __entry->err)
881);
882
Namjae Jeonc01e2852013-04-23 17:00:52 +0900883TRACE_EVENT(f2fs_fallocate,
884
885 TP_PROTO(struct inode *inode, int mode,
886 loff_t offset, loff_t len, int ret),
887
888 TP_ARGS(inode, mode, offset, len, ret),
889
890 TP_STRUCT__entry(
891 __field(dev_t, dev)
892 __field(ino_t, ino)
893 __field(int, mode)
894 __field(loff_t, offset)
895 __field(loff_t, len)
896 __field(loff_t, size)
897 __field(blkcnt_t, blocks)
898 __field(int, ret)
899 ),
900
901 TP_fast_assign(
902 __entry->dev = inode->i_sb->s_dev;
903 __entry->ino = inode->i_ino;
904 __entry->mode = mode;
905 __entry->offset = offset;
906 __entry->len = len;
907 __entry->size = inode->i_size;
908 __entry->blocks = inode->i_blocks;
909 __entry->ret = ret;
910 ),
911
912 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
913 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
914 show_dev_ino(__entry),
915 __entry->mode,
916 (unsigned long long)__entry->offset,
917 (unsigned long long)__entry->len,
918 (unsigned long long)__entry->size,
919 (unsigned long long)__entry->blocks,
920 __entry->ret)
921);
922
Chao Yu70407fa2014-07-31 21:11:22 +0800923TRACE_EVENT(f2fs_direct_IO_enter,
924
925 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
926
927 TP_ARGS(inode, offset, len, rw),
928
929 TP_STRUCT__entry(
930 __field(dev_t, dev)
931 __field(ino_t, ino)
932 __field(loff_t, pos)
933 __field(unsigned long, len)
934 __field(int, rw)
935 ),
936
937 TP_fast_assign(
938 __entry->dev = inode->i_sb->s_dev;
939 __entry->ino = inode->i_ino;
940 __entry->pos = offset;
941 __entry->len = len;
942 __entry->rw = rw;
943 ),
944
945 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
946 show_dev_ino(__entry),
947 __entry->pos,
948 __entry->len,
949 __entry->rw)
950);
951
952TRACE_EVENT(f2fs_direct_IO_exit,
953
954 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
955 int rw, int ret),
956
957 TP_ARGS(inode, offset, len, rw, ret),
958
959 TP_STRUCT__entry(
960 __field(dev_t, dev)
961 __field(ino_t, ino)
962 __field(loff_t, pos)
963 __field(unsigned long, len)
964 __field(int, rw)
965 __field(int, ret)
966 ),
967
968 TP_fast_assign(
969 __entry->dev = inode->i_sb->s_dev;
970 __entry->ino = inode->i_ino;
971 __entry->pos = offset;
972 __entry->len = len;
973 __entry->rw = rw;
974 __entry->ret = ret;
975 ),
976
977 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
978 "rw = %d ret = %d",
979 show_dev_ino(__entry),
980 __entry->pos,
981 __entry->len,
982 __entry->rw,
983 __entry->ret)
984);
985
Chao Yu46008c62016-05-09 19:56:30 +0800986TRACE_EVENT(f2fs_reserve_new_blocks,
Namjae Jeonc01e2852013-04-23 17:00:52 +0900987
Chao Yu46008c62016-05-09 19:56:30 +0800988 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node,
989 blkcnt_t count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900990
Chao Yu46008c62016-05-09 19:56:30 +0800991 TP_ARGS(inode, nid, ofs_in_node, count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900992
993 TP_STRUCT__entry(
994 __field(dev_t, dev)
995 __field(nid_t, nid)
996 __field(unsigned int, ofs_in_node)
Chao Yu46008c62016-05-09 19:56:30 +0800997 __field(blkcnt_t, count)
Namjae Jeonc01e2852013-04-23 17:00:52 +0900998 ),
999
1000 TP_fast_assign(
1001 __entry->dev = inode->i_sb->s_dev;
1002 __entry->nid = nid;
1003 __entry->ofs_in_node = ofs_in_node;
Chao Yu46008c62016-05-09 19:56:30 +08001004 __entry->count = count;
Namjae Jeonc01e2852013-04-23 17:00:52 +09001005 ),
1006
Chao Yu46008c62016-05-09 19:56:30 +08001007 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001008 show_dev(__entry->dev),
Namjae Jeonc01e2852013-04-23 17:00:52 +09001009 (unsigned int)__entry->nid,
Chao Yu46008c62016-05-09 19:56:30 +08001010 __entry->ofs_in_node,
1011 (unsigned long long)__entry->count)
Namjae Jeonc01e2852013-04-23 17:00:52 +09001012);
1013
Chao Yu3e1c8f12014-12-23 16:35:21 +08001014DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
1015
Chao Yu2ace38e2014-12-24 16:08:14 +08001016 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001017
Chao Yu2ace38e2014-12-24 16:08:14 +08001018 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001019
1020 TP_STRUCT__entry(
1021 __field(dev_t, dev)
1022 __field(ino_t, ino)
1023 __field(pgoff_t, index)
Chao Yu7a9d7542016-02-22 18:36:38 +08001024 __field(block_t, old_blkaddr)
1025 __field(block_t, new_blkaddr)
Mike Christie04d328d2016-06-05 14:31:55 -05001026 __field(int, op)
1027 __field(int, op_flags)
Jaegeuk Kima912b542017-05-10 11:18:25 -07001028 __field(int, temp)
Chao Yu3e1c8f12014-12-23 16:35:21 +08001029 __field(int, type)
1030 ),
1031
1032 TP_fast_assign(
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001033 __entry->dev = page_file_mapping(page)->host->i_sb->s_dev;
1034 __entry->ino = page_file_mapping(page)->host->i_ino;
Chao Yu3e1c8f12014-12-23 16:35:21 +08001035 __entry->index = page->index;
Chao Yu7a9d7542016-02-22 18:36:38 +08001036 __entry->old_blkaddr = fio->old_blkaddr;
1037 __entry->new_blkaddr = fio->new_blkaddr;
Mike Christie04d328d2016-06-05 14:31:55 -05001038 __entry->op = fio->op;
1039 __entry->op_flags = fio->op_flags;
Jaegeuk Kima912b542017-05-10 11:18:25 -07001040 __entry->temp = fio->temp;
Chao Yu2ace38e2014-12-24 16:08:14 +08001041 __entry->type = fio->type;
Chao Yu3e1c8f12014-12-23 16:35:21 +08001042 ),
1043
1044 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
Jaegeuk Kima912b542017-05-10 11:18:25 -07001045 "oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s",
Chao Yu3e1c8f12014-12-23 16:35:21 +08001046 show_dev_ino(__entry),
1047 (unsigned long)__entry->index,
Chao Yu7a9d7542016-02-22 18:36:38 +08001048 (unsigned long long)__entry->old_blkaddr,
1049 (unsigned long long)__entry->new_blkaddr,
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -08001050 show_bio_type(__entry->op, __entry->op_flags),
Jaegeuk Kima912b542017-05-10 11:18:25 -07001051 show_block_temp(__entry->temp),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001052 show_block_type(__entry->type))
1053);
1054
1055DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
1056
Chao Yu2ace38e2014-12-24 16:08:14 +08001057 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001058
Chao Yu2ace38e2014-12-24 16:08:14 +08001059 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001060
1061 TP_CONDITION(page->mapping)
1062);
1063
Jaegeuk Kimb9109b02017-05-10 11:28:38 -07001064DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_write,
Chao Yu3e1c8f12014-12-23 16:35:21 +08001065
Chao Yu2ace38e2014-12-24 16:08:14 +08001066 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001067
Chao Yu2ace38e2014-12-24 16:08:14 +08001068 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001069
1070 TP_CONDITION(page->mapping)
1071);
1072
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001073DECLARE_EVENT_CLASS(f2fs__bio,
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001074
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001075 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001076
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001077 TP_ARGS(sb, type, bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001078
1079 TP_STRUCT__entry(
1080 __field(dev_t, dev)
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001081 __field(dev_t, target)
Mike Christie04d328d2016-06-05 14:31:55 -05001082 __field(int, op)
1083 __field(int, op_flags)
Chao Yud4d288b2013-11-24 12:36:42 +09001084 __field(int, type)
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001085 __field(sector_t, sector)
1086 __field(unsigned int, size)
1087 ),
1088
1089 TP_fast_assign(
1090 __entry->dev = sb->s_dev;
Christoph Hellwig74d46992017-08-23 19:10:32 +02001091 __entry->target = bio_dev(bio);
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001092 __entry->op = bio_op(bio);
1093 __entry->op_flags = bio->bi_opf;
1094 __entry->type = type;
Kent Overstreet4f024f32013-10-11 15:44:27 -07001095 __entry->sector = bio->bi_iter.bi_sector;
1096 __entry->size = bio->bi_iter.bi_size;
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001097 ),
1098
Chao Yubaaabbb2017-05-04 09:35:43 +08001099 TP_printk("dev = (%d,%d)/(%d,%d), rw = %s(%s), %s, sector = %lld, size = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001100 show_dev(__entry->target),
1101 show_dev(__entry->dev),
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -08001102 show_bio_type(__entry->op, __entry->op_flags),
Chao Yud4d288b2013-11-24 12:36:42 +09001103 show_block_type(__entry->type),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001104 (unsigned long long)__entry->sector,
1105 __entry->size)
1106);
1107
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001108DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio,
Chao Yud4d288b2013-11-24 12:36:42 +09001109
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001110 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +09001111
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001112 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +09001113
1114 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +09001115);
1116
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001117DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio,
Chao Yud4d288b2013-11-24 12:36:42 +09001118
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001119 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +09001120
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001121 TP_ARGS(sb, type, bio),
1122
1123 TP_CONDITION(bio)
1124);
1125
1126DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_read_bio,
1127
1128 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1129
1130 TP_ARGS(sb, type, bio),
1131
1132 TP_CONDITION(bio)
1133);
1134
1135DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio,
1136
1137 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1138
1139 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +09001140
1141 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +09001142);
1143
Chao Yu62aed042014-05-06 16:46:04 +08001144TRACE_EVENT(f2fs_write_begin,
1145
1146 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1147 unsigned int flags),
1148
1149 TP_ARGS(inode, pos, len, flags),
1150
1151 TP_STRUCT__entry(
1152 __field(dev_t, dev)
1153 __field(ino_t, ino)
1154 __field(loff_t, pos)
1155 __field(unsigned int, len)
1156 __field(unsigned int, flags)
1157 ),
1158
1159 TP_fast_assign(
1160 __entry->dev = inode->i_sb->s_dev;
1161 __entry->ino = inode->i_ino;
1162 __entry->pos = pos;
1163 __entry->len = len;
1164 __entry->flags = flags;
1165 ),
1166
1167 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
1168 show_dev_ino(__entry),
1169 (unsigned long long)__entry->pos,
1170 __entry->len,
1171 __entry->flags)
1172);
1173
Chao Yudfb2bf32014-05-06 16:47:23 +08001174TRACE_EVENT(f2fs_write_end,
1175
1176 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1177 unsigned int copied),
1178
1179 TP_ARGS(inode, pos, len, copied),
1180
1181 TP_STRUCT__entry(
1182 __field(dev_t, dev)
1183 __field(ino_t, ino)
1184 __field(loff_t, pos)
1185 __field(unsigned int, len)
1186 __field(unsigned int, copied)
1187 ),
1188
1189 TP_fast_assign(
1190 __entry->dev = inode->i_sb->s_dev;
1191 __entry->ino = inode->i_ino;
1192 __entry->pos = pos;
1193 __entry->len = len;
1194 __entry->copied = copied;
1195 ),
1196
1197 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
1198 show_dev_ino(__entry),
1199 (unsigned long long)__entry->pos,
1200 __entry->len,
1201 __entry->copied)
1202);
1203
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001204DECLARE_EVENT_CLASS(f2fs__page,
1205
1206 TP_PROTO(struct page *page, int type),
1207
1208 TP_ARGS(page, type),
1209
1210 TP_STRUCT__entry(
1211 __field(dev_t, dev)
1212 __field(ino_t, ino)
1213 __field(int, type)
1214 __field(int, dir)
1215 __field(pgoff_t, index)
1216 __field(int, dirty)
Chao Yuc20e89c2014-05-06 16:53:08 +08001217 __field(int, uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001218 ),
1219
1220 TP_fast_assign(
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001221 __entry->dev = page_file_mapping(page)->host->i_sb->s_dev;
1222 __entry->ino = page_file_mapping(page)->host->i_ino;
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001223 __entry->type = type;
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001224 __entry->dir =
1225 S_ISDIR(page_file_mapping(page)->host->i_mode);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001226 __entry->index = page->index;
1227 __entry->dirty = PageDirty(page);
Chao Yuc20e89c2014-05-06 16:53:08 +08001228 __entry->uptodate = PageUptodate(page);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001229 ),
1230
Chao Yuc20e89c2014-05-06 16:53:08 +08001231 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
1232 "dirty = %d, uptodate = %d",
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001233 show_dev_ino(__entry),
1234 show_block_type(__entry->type),
1235 show_file_type(__entry->dir),
1236 (unsigned long)__entry->index,
Chao Yuc20e89c2014-05-06 16:53:08 +08001237 __entry->dirty,
1238 __entry->uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001239);
1240
Chao Yuecda0de2014-05-06 16:48:26 +08001241DEFINE_EVENT(f2fs__page, f2fs_writepage,
1242
1243 TP_PROTO(struct page *page, int type),
1244
1245 TP_ARGS(page, type)
1246);
1247
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -07001248DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
1249
1250 TP_PROTO(struct page *page, int type),
1251
1252 TP_ARGS(page, type)
1253);
1254
Chao Yuc20e89c2014-05-06 16:53:08 +08001255DEFINE_EVENT(f2fs__page, f2fs_readpage,
1256
1257 TP_PROTO(struct page *page, int type),
1258
1259 TP_ARGS(page, type)
1260);
1261
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001262DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
1263
1264 TP_PROTO(struct page *page, int type),
1265
1266 TP_ARGS(page, type)
1267);
1268
Jaegeuk Kime943a102013-10-25 14:26:31 +09001269DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
1270
1271 TP_PROTO(struct page *page, int type),
1272
1273 TP_ARGS(page, type)
1274);
1275
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -07001276DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
1277
1278 TP_PROTO(struct page *page, int type),
1279
1280 TP_ARGS(page, type)
1281);
1282
1283DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
1284
1285 TP_PROTO(struct page *page, int type),
1286
1287 TP_ARGS(page, type)
1288);
1289
Chao Yud7648342019-04-15 15:22:19 +08001290TRACE_EVENT(f2fs_filemap_fault,
1291
1292 TP_PROTO(struct inode *inode, pgoff_t index, unsigned long ret),
1293
1294 TP_ARGS(inode, index, ret),
1295
1296 TP_STRUCT__entry(
1297 __field(dev_t, dev)
1298 __field(ino_t, ino)
1299 __field(pgoff_t, index)
1300 __field(unsigned long, ret)
1301 ),
1302
1303 TP_fast_assign(
1304 __entry->dev = inode->i_sb->s_dev;
1305 __entry->ino = inode->i_ino;
1306 __entry->index = index;
1307 __entry->ret = ret;
1308 ),
1309
1310 TP_printk("dev = (%d,%d), ino = %lu, index = %lu, ret = %lx",
1311 show_dev_ino(__entry),
1312 (unsigned long)__entry->index,
1313 __entry->ret)
1314);
1315
Chao Yue5748432014-05-06 16:51:24 +08001316TRACE_EVENT(f2fs_writepages,
1317
1318 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
1319
1320 TP_ARGS(inode, wbc, type),
1321
1322 TP_STRUCT__entry(
1323 __field(dev_t, dev)
1324 __field(ino_t, ino)
1325 __field(int, type)
1326 __field(int, dir)
1327 __field(long, nr_to_write)
1328 __field(long, pages_skipped)
1329 __field(loff_t, range_start)
1330 __field(loff_t, range_end)
1331 __field(pgoff_t, writeback_index)
1332 __field(int, sync_mode)
1333 __field(char, for_kupdate)
1334 __field(char, for_background)
1335 __field(char, tagged_writepages)
1336 __field(char, for_reclaim)
1337 __field(char, range_cyclic)
1338 __field(char, for_sync)
1339 ),
1340
1341 TP_fast_assign(
1342 __entry->dev = inode->i_sb->s_dev;
1343 __entry->ino = inode->i_ino;
1344 __entry->type = type;
1345 __entry->dir = S_ISDIR(inode->i_mode);
1346 __entry->nr_to_write = wbc->nr_to_write;
1347 __entry->pages_skipped = wbc->pages_skipped;
1348 __entry->range_start = wbc->range_start;
1349 __entry->range_end = wbc->range_end;
1350 __entry->writeback_index = inode->i_mapping->writeback_index;
1351 __entry->sync_mode = wbc->sync_mode;
1352 __entry->for_kupdate = wbc->for_kupdate;
1353 __entry->for_background = wbc->for_background;
1354 __entry->tagged_writepages = wbc->tagged_writepages;
1355 __entry->for_reclaim = wbc->for_reclaim;
1356 __entry->range_cyclic = wbc->range_cyclic;
1357 __entry->for_sync = wbc->for_sync;
1358 ),
1359
1360 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1361 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1362 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1363 show_dev_ino(__entry),
1364 show_block_type(__entry->type),
1365 show_file_type(__entry->dir),
1366 __entry->nr_to_write,
1367 __entry->pages_skipped,
1368 __entry->range_start,
1369 __entry->range_end,
1370 (unsigned long)__entry->writeback_index,
1371 __entry->sync_mode,
1372 __entry->for_kupdate,
1373 __entry->for_background,
1374 __entry->tagged_writepages,
1375 __entry->for_reclaim,
1376 __entry->range_cyclic,
1377 __entry->for_sync)
1378);
1379
Chao Yub8c29402015-10-12 17:02:26 +08001380TRACE_EVENT(f2fs_readpages,
1381
Matthew Wilcox (Oracle)23323192020-06-01 21:47:23 -07001382 TP_PROTO(struct inode *inode, pgoff_t start, unsigned int nrpage),
Chao Yub8c29402015-10-12 17:02:26 +08001383
Matthew Wilcox (Oracle)23323192020-06-01 21:47:23 -07001384 TP_ARGS(inode, start, nrpage),
Chao Yub8c29402015-10-12 17:02:26 +08001385
1386 TP_STRUCT__entry(
1387 __field(dev_t, dev)
1388 __field(ino_t, ino)
1389 __field(pgoff_t, start)
1390 __field(unsigned int, nrpage)
1391 ),
1392
1393 TP_fast_assign(
1394 __entry->dev = inode->i_sb->s_dev;
1395 __entry->ino = inode->i_ino;
Matthew Wilcox (Oracle)23323192020-06-01 21:47:23 -07001396 __entry->start = start;
Chao Yub8c29402015-10-12 17:02:26 +08001397 __entry->nrpage = nrpage;
1398 ),
1399
1400 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1401 show_dev_ino(__entry),
1402 (unsigned long)__entry->start,
1403 __entry->nrpage)
1404);
1405
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001406TRACE_EVENT(f2fs_write_checkpoint,
1407
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001408 TP_PROTO(struct super_block *sb, int reason, char *msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001409
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001410 TP_ARGS(sb, reason, msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001411
1412 TP_STRUCT__entry(
1413 __field(dev_t, dev)
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001414 __field(int, reason)
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001415 __field(char *, msg)
1416 ),
1417
1418 TP_fast_assign(
1419 __entry->dev = sb->s_dev;
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001420 __entry->reason = reason;
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001421 __entry->msg = msg;
1422 ),
1423
1424 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001425 show_dev(__entry->dev),
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001426 show_cpreason(__entry->reason),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001427 __entry->msg)
1428);
1429
Chao Yu0243a5f2017-04-15 14:09:38 +08001430DECLARE_EVENT_CLASS(f2fs_discard,
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001431
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001432 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001433
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001434 TP_ARGS(dev, blkstart, blklen),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001435
1436 TP_STRUCT__entry(
1437 __field(dev_t, dev)
1438 __field(block_t, blkstart)
1439 __field(block_t, blklen)
1440 ),
1441
1442 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001443 __entry->dev = dev->bd_dev;
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001444 __entry->blkstart = blkstart;
1445 __entry->blklen = blklen;
1446 ),
1447
1448 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001449 show_dev(__entry->dev),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001450 (unsigned long long)__entry->blkstart,
1451 (unsigned long long)__entry->blklen)
1452);
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001453
Chao Yu0243a5f2017-04-15 14:09:38 +08001454DEFINE_EVENT(f2fs_discard, f2fs_queue_discard,
1455
1456 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1457
1458 TP_ARGS(dev, blkstart, blklen)
1459);
1460
1461DEFINE_EVENT(f2fs_discard, f2fs_issue_discard,
1462
1463 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1464
1465 TP_ARGS(dev, blkstart, blklen)
1466);
1467
Chao Yu2ec6f2e2017-10-04 09:08:36 +08001468DEFINE_EVENT(f2fs_discard, f2fs_remove_discard,
1469
1470 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1471
1472 TP_ARGS(dev, blkstart, blklen)
1473);
1474
Damien Le Moal126606c2016-10-28 17:45:07 +09001475TRACE_EVENT(f2fs_issue_reset_zone,
1476
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001477 TP_PROTO(struct block_device *dev, block_t blkstart),
Damien Le Moal126606c2016-10-28 17:45:07 +09001478
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001479 TP_ARGS(dev, blkstart),
Damien Le Moal126606c2016-10-28 17:45:07 +09001480
1481 TP_STRUCT__entry(
1482 __field(dev_t, dev)
1483 __field(block_t, blkstart)
1484 ),
1485
1486 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001487 __entry->dev = dev->bd_dev;
Damien Le Moal126606c2016-10-28 17:45:07 +09001488 __entry->blkstart = blkstart;
1489 ),
1490
1491 TP_printk("dev = (%d,%d), reset zone at block = 0x%llx",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001492 show_dev(__entry->dev),
Damien Le Moal126606c2016-10-28 17:45:07 +09001493 (unsigned long long)__entry->blkstart)
1494);
1495
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001496TRACE_EVENT(f2fs_issue_flush,
1497
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001498 TP_PROTO(struct block_device *dev, unsigned int nobarrier,
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001499 unsigned int flush_merge, int ret),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001500
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001501 TP_ARGS(dev, nobarrier, flush_merge, ret),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001502
1503 TP_STRUCT__entry(
1504 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -08001505 __field(unsigned int, nobarrier)
1506 __field(unsigned int, flush_merge)
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001507 __field(int, ret)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001508 ),
1509
1510 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001511 __entry->dev = dev->bd_dev;
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001512 __entry->nobarrier = nobarrier;
1513 __entry->flush_merge = flush_merge;
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001514 __entry->ret = ret;
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001515 ),
1516
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001517 TP_printk("dev = (%d,%d), %s %s, ret = %d",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001518 show_dev(__entry->dev),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001519 __entry->nobarrier ? "skip (nobarrier)" : "issue",
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001520 __entry->flush_merge ? " with flush_merge" : "",
1521 __entry->ret)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001522);
Chao Yu1ec46102015-02-05 17:59:59 +08001523
1524TRACE_EVENT(f2fs_lookup_extent_tree_start,
1525
1526 TP_PROTO(struct inode *inode, unsigned int pgofs),
1527
1528 TP_ARGS(inode, pgofs),
1529
1530 TP_STRUCT__entry(
1531 __field(dev_t, dev)
1532 __field(ino_t, ino)
1533 __field(unsigned int, pgofs)
1534 ),
1535
1536 TP_fast_assign(
1537 __entry->dev = inode->i_sb->s_dev;
1538 __entry->ino = inode->i_ino;
1539 __entry->pgofs = pgofs;
1540 ),
1541
1542 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1543 show_dev_ino(__entry),
1544 __entry->pgofs)
1545);
1546
1547TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1548
1549 TP_PROTO(struct inode *inode, unsigned int pgofs,
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001550 struct extent_info *ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001551
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001552 TP_ARGS(inode, pgofs, ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001553
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001554 TP_CONDITION(ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001555
1556 TP_STRUCT__entry(
1557 __field(dev_t, dev)
1558 __field(ino_t, ino)
1559 __field(unsigned int, pgofs)
1560 __field(unsigned int, fofs)
1561 __field(u32, blk)
1562 __field(unsigned int, len)
1563 ),
1564
1565 TP_fast_assign(
1566 __entry->dev = inode->i_sb->s_dev;
1567 __entry->ino = inode->i_ino;
1568 __entry->pgofs = pgofs;
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001569 __entry->fofs = ei->fofs;
1570 __entry->blk = ei->blk;
1571 __entry->len = ei->len;
Chao Yu1ec46102015-02-05 17:59:59 +08001572 ),
1573
1574 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1575 "ext_info(fofs: %u, blk: %u, len: %u)",
1576 show_dev_ino(__entry),
1577 __entry->pgofs,
1578 __entry->fofs,
1579 __entry->blk,
1580 __entry->len)
1581);
1582
Chao Yu744288c2015-09-06 17:50:13 +08001583TRACE_EVENT(f2fs_update_extent_tree_range,
Chao Yu1ec46102015-02-05 17:59:59 +08001584
Chao Yu744288c2015-09-06 17:50:13 +08001585 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1586 unsigned int len),
Chao Yu1ec46102015-02-05 17:59:59 +08001587
Chao Yu744288c2015-09-06 17:50:13 +08001588 TP_ARGS(inode, pgofs, blkaddr, len),
Chao Yu1ec46102015-02-05 17:59:59 +08001589
1590 TP_STRUCT__entry(
1591 __field(dev_t, dev)
1592 __field(ino_t, ino)
1593 __field(unsigned int, pgofs)
1594 __field(u32, blk)
Chao Yu744288c2015-09-06 17:50:13 +08001595 __field(unsigned int, len)
Chao Yu1ec46102015-02-05 17:59:59 +08001596 ),
1597
1598 TP_fast_assign(
1599 __entry->dev = inode->i_sb->s_dev;
1600 __entry->ino = inode->i_ino;
1601 __entry->pgofs = pgofs;
1602 __entry->blk = blkaddr;
Chao Yu744288c2015-09-06 17:50:13 +08001603 __entry->len = len;
Chao Yu1ec46102015-02-05 17:59:59 +08001604 ),
1605
Chao Yu744288c2015-09-06 17:50:13 +08001606 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1607 "blkaddr = %u, len = %u",
Chao Yu1ec46102015-02-05 17:59:59 +08001608 show_dev_ino(__entry),
1609 __entry->pgofs,
Chao Yu744288c2015-09-06 17:50:13 +08001610 __entry->blk,
1611 __entry->len)
Chao Yu1ec46102015-02-05 17:59:59 +08001612);
1613
1614TRACE_EVENT(f2fs_shrink_extent_tree,
1615
1616 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1617 unsigned int tree_cnt),
1618
1619 TP_ARGS(sbi, node_cnt, tree_cnt),
1620
1621 TP_STRUCT__entry(
1622 __field(dev_t, dev)
1623 __field(unsigned int, node_cnt)
1624 __field(unsigned int, tree_cnt)
1625 ),
1626
1627 TP_fast_assign(
1628 __entry->dev = sbi->sb->s_dev;
1629 __entry->node_cnt = node_cnt;
1630 __entry->tree_cnt = tree_cnt;
1631 ),
1632
1633 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001634 show_dev(__entry->dev),
Chao Yu1ec46102015-02-05 17:59:59 +08001635 __entry->node_cnt,
1636 __entry->tree_cnt)
1637);
1638
1639TRACE_EVENT(f2fs_destroy_extent_tree,
1640
1641 TP_PROTO(struct inode *inode, unsigned int node_cnt),
1642
1643 TP_ARGS(inode, node_cnt),
1644
1645 TP_STRUCT__entry(
1646 __field(dev_t, dev)
1647 __field(ino_t, ino)
1648 __field(unsigned int, node_cnt)
1649 ),
1650
1651 TP_fast_assign(
1652 __entry->dev = inode->i_sb->s_dev;
1653 __entry->ino = inode->i_ino;
1654 __entry->node_cnt = node_cnt;
1655 ),
1656
1657 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1658 show_dev_ino(__entry),
1659 __entry->node_cnt)
1660);
1661
Chao Yu4cf18532015-12-17 17:17:16 +08001662DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
1663
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001664 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001665
1666 TP_ARGS(sb, type, count),
1667
1668 TP_STRUCT__entry(
1669 __field(dev_t, dev)
1670 __field(int, type)
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001671 __field(s64, count)
Chao Yu4cf18532015-12-17 17:17:16 +08001672 ),
1673
1674 TP_fast_assign(
1675 __entry->dev = sb->s_dev;
1676 __entry->type = type;
1677 __entry->count = count;
1678 ),
1679
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001680 TP_printk("dev = (%d,%d), %s, dirty count = %lld",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001681 show_dev(__entry->dev),
Chao Yu4cf18532015-12-17 17:17:16 +08001682 show_file_type(__entry->type),
1683 __entry->count)
1684);
1685
1686DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
1687
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001688 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001689
1690 TP_ARGS(sb, type, count)
1691);
1692
1693DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
1694
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001695 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001696
1697 TP_ARGS(sb, type, count)
1698);
1699
Chao Yu559e87c2019-02-26 19:01:15 +08001700TRACE_EVENT(f2fs_shutdown,
1701
1702 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int mode, int ret),
1703
1704 TP_ARGS(sbi, mode, ret),
1705
1706 TP_STRUCT__entry(
1707 __field(dev_t, dev)
1708 __field(unsigned int, mode)
1709 __field(int, ret)
1710 ),
1711
1712 TP_fast_assign(
1713 __entry->dev = sbi->sb->s_dev;
1714 __entry->mode = mode;
1715 __entry->ret = ret;
1716 ),
1717
1718 TP_printk("dev = (%d,%d), mode: %s, ret:%d",
1719 show_dev(__entry->dev),
1720 show_shutdown_mode(__entry->mode),
1721 __entry->ret)
1722);
1723
Chao Yu4c8ff702019-11-01 18:07:14 +08001724DECLARE_EVENT_CLASS(f2fs_zip_start,
1725
1726 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1727 unsigned int cluster_size, unsigned char algtype),
1728
1729 TP_ARGS(inode, cluster_idx, cluster_size, algtype),
1730
1731 TP_STRUCT__entry(
1732 __field(dev_t, dev)
1733 __field(ino_t, ino)
1734 __field(pgoff_t, idx)
1735 __field(unsigned int, size)
1736 __field(unsigned int, algtype)
1737 ),
1738
1739 TP_fast_assign(
1740 __entry->dev = inode->i_sb->s_dev;
1741 __entry->ino = inode->i_ino;
1742 __entry->idx = cluster_idx;
1743 __entry->size = cluster_size;
1744 __entry->algtype = algtype;
1745 ),
1746
1747 TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
1748 "cluster_size = %u, algorithm = %s",
1749 show_dev_ino(__entry),
1750 __entry->idx,
1751 __entry->size,
1752 show_compress_algorithm(__entry->algtype))
1753);
1754
1755DECLARE_EVENT_CLASS(f2fs_zip_end,
1756
1757 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1758 unsigned int compressed_size, int ret),
1759
1760 TP_ARGS(inode, cluster_idx, compressed_size, ret),
1761
1762 TP_STRUCT__entry(
1763 __field(dev_t, dev)
1764 __field(ino_t, ino)
1765 __field(pgoff_t, idx)
1766 __field(unsigned int, size)
1767 __field(unsigned int, ret)
1768 ),
1769
1770 TP_fast_assign(
1771 __entry->dev = inode->i_sb->s_dev;
1772 __entry->ino = inode->i_ino;
1773 __entry->idx = cluster_idx;
1774 __entry->size = compressed_size;
1775 __entry->ret = ret;
1776 ),
1777
1778 TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
1779 "compressed_size = %u, ret = %d",
1780 show_dev_ino(__entry),
1781 __entry->idx,
1782 __entry->size,
1783 __entry->ret)
1784);
1785
1786DEFINE_EVENT(f2fs_zip_start, f2fs_compress_pages_start,
1787
1788 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1789 unsigned int cluster_size, unsigned char algtype),
1790
1791 TP_ARGS(inode, cluster_idx, cluster_size, algtype)
1792);
1793
1794DEFINE_EVENT(f2fs_zip_start, f2fs_decompress_pages_start,
1795
1796 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1797 unsigned int cluster_size, unsigned char algtype),
1798
1799 TP_ARGS(inode, cluster_idx, cluster_size, algtype)
1800);
1801
1802DEFINE_EVENT(f2fs_zip_end, f2fs_compress_pages_end,
1803
1804 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1805 unsigned int compressed_size, int ret),
1806
1807 TP_ARGS(inode, cluster_idx, compressed_size, ret)
1808);
1809
1810DEFINE_EVENT(f2fs_zip_end, f2fs_decompress_pages_end,
1811
1812 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1813 unsigned int compressed_size, int ret),
1814
1815 TP_ARGS(inode, cluster_idx, compressed_size, ret)
1816);
1817
Daeho Jeong2bc4bea2020-03-30 03:30:59 +00001818TRACE_EVENT(f2fs_iostat,
1819
1820 TP_PROTO(struct f2fs_sb_info *sbi, unsigned long long *iostat),
1821
1822 TP_ARGS(sbi, iostat),
1823
1824 TP_STRUCT__entry(
1825 __field(dev_t, dev)
1826 __field(unsigned long long, app_dio)
1827 __field(unsigned long long, app_bio)
1828 __field(unsigned long long, app_wio)
1829 __field(unsigned long long, app_mio)
1830 __field(unsigned long long, fs_dio)
1831 __field(unsigned long long, fs_nio)
1832 __field(unsigned long long, fs_mio)
1833 __field(unsigned long long, fs_gc_dio)
1834 __field(unsigned long long, fs_gc_nio)
1835 __field(unsigned long long, fs_cp_dio)
1836 __field(unsigned long long, fs_cp_nio)
1837 __field(unsigned long long, fs_cp_mio)
Chao Yu8b83ac82020-04-16 18:16:56 +08001838 __field(unsigned long long, app_drio)
1839 __field(unsigned long long, app_brio)
1840 __field(unsigned long long, app_rio)
1841 __field(unsigned long long, app_mrio)
1842 __field(unsigned long long, fs_drio)
Chao Yu9c122382020-04-23 18:03:06 +08001843 __field(unsigned long long, fs_gdrio)
1844 __field(unsigned long long, fs_cdrio)
Chao Yu8b83ac82020-04-16 18:16:56 +08001845 __field(unsigned long long, fs_nrio)
1846 __field(unsigned long long, fs_mrio)
Daeho Jeong2bc4bea2020-03-30 03:30:59 +00001847 __field(unsigned long long, fs_discard)
1848 ),
1849
1850 TP_fast_assign(
1851 __entry->dev = sbi->sb->s_dev;
1852 __entry->app_dio = iostat[APP_DIRECT_IO];
1853 __entry->app_bio = iostat[APP_BUFFERED_IO];
1854 __entry->app_wio = iostat[APP_WRITE_IO];
1855 __entry->app_mio = iostat[APP_MAPPED_IO];
1856 __entry->fs_dio = iostat[FS_DATA_IO];
1857 __entry->fs_nio = iostat[FS_NODE_IO];
1858 __entry->fs_mio = iostat[FS_META_IO];
1859 __entry->fs_gc_dio = iostat[FS_GC_DATA_IO];
1860 __entry->fs_gc_nio = iostat[FS_GC_NODE_IO];
1861 __entry->fs_cp_dio = iostat[FS_CP_DATA_IO];
1862 __entry->fs_cp_nio = iostat[FS_CP_NODE_IO];
1863 __entry->fs_cp_mio = iostat[FS_CP_META_IO];
Chao Yu8b83ac82020-04-16 18:16:56 +08001864 __entry->app_drio = iostat[APP_DIRECT_READ_IO];
1865 __entry->app_brio = iostat[APP_BUFFERED_READ_IO];
1866 __entry->app_rio = iostat[APP_READ_IO];
1867 __entry->app_mrio = iostat[APP_MAPPED_READ_IO];
1868 __entry->fs_drio = iostat[FS_DATA_READ_IO];
Chao Yu9c122382020-04-23 18:03:06 +08001869 __entry->fs_gdrio = iostat[FS_GDATA_READ_IO];
1870 __entry->fs_cdrio = iostat[FS_CDATA_READ_IO];
Chao Yu8b83ac82020-04-16 18:16:56 +08001871 __entry->fs_nrio = iostat[FS_NODE_READ_IO];
1872 __entry->fs_mrio = iostat[FS_META_READ_IO];
Daeho Jeong2bc4bea2020-03-30 03:30:59 +00001873 __entry->fs_discard = iostat[FS_DISCARD];
1874 ),
1875
1876 TP_printk("dev = (%d,%d), "
1877 "app [write=%llu (direct=%llu, buffered=%llu), mapped=%llu], "
1878 "fs [data=%llu, node=%llu, meta=%llu, discard=%llu], "
1879 "gc [data=%llu, node=%llu], "
Chao Yu8b83ac82020-04-16 18:16:56 +08001880 "cp [data=%llu, node=%llu, meta=%llu], "
1881 "app [read=%llu (direct=%llu, buffered=%llu), mapped=%llu], "
Chao Yu9c122382020-04-23 18:03:06 +08001882 "fs [data=%llu, (gc_data=%llu, compr_data=%llu), "
1883 "node=%llu, meta=%llu]",
Daeho Jeong2bc4bea2020-03-30 03:30:59 +00001884 show_dev(__entry->dev), __entry->app_wio, __entry->app_dio,
1885 __entry->app_bio, __entry->app_mio, __entry->fs_dio,
1886 __entry->fs_nio, __entry->fs_mio, __entry->fs_discard,
1887 __entry->fs_gc_dio, __entry->fs_gc_nio, __entry->fs_cp_dio,
Chao Yu8b83ac82020-04-16 18:16:56 +08001888 __entry->fs_cp_nio, __entry->fs_cp_mio,
1889 __entry->app_rio, __entry->app_drio, __entry->app_brio,
Chao Yu9c122382020-04-23 18:03:06 +08001890 __entry->app_mrio, __entry->fs_drio, __entry->fs_gdrio,
1891 __entry->fs_cdrio, __entry->fs_nrio, __entry->fs_mrio)
Daeho Jeong2bc4bea2020-03-30 03:30:59 +00001892);
1893
Chao Yub79b0a32020-06-29 20:13:12 +08001894TRACE_EVENT(f2fs_bmap,
1895
1896 TP_PROTO(struct inode *inode, sector_t lblock, sector_t pblock),
1897
1898 TP_ARGS(inode, lblock, pblock),
1899
1900 TP_STRUCT__entry(
1901 __field(dev_t, dev)
1902 __field(ino_t, ino)
1903 __field(sector_t, lblock)
1904 __field(sector_t, pblock)
1905 ),
1906
1907 TP_fast_assign(
1908 __entry->dev = inode->i_sb->s_dev;
1909 __entry->ino = inode->i_ino;
1910 __entry->lblock = lblock;
1911 __entry->pblock = pblock;
1912 ),
1913
1914 TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld",
1915 show_dev_ino(__entry),
1916 (unsigned long long)__entry->lblock,
1917 (unsigned long long)__entry->pblock)
1918);
1919
Chao Yudd5a09b2020-06-29 20:13:13 +08001920TRACE_EVENT(f2fs_fiemap,
1921
1922 TP_PROTO(struct inode *inode, sector_t lblock, sector_t pblock,
1923 unsigned long long len, unsigned int flags, int ret),
1924
1925 TP_ARGS(inode, lblock, pblock, len, flags, ret),
1926
1927 TP_STRUCT__entry(
1928 __field(dev_t, dev)
1929 __field(ino_t, ino)
1930 __field(sector_t, lblock)
1931 __field(sector_t, pblock)
1932 __field(unsigned long long, len)
1933 __field(unsigned int, flags)
1934 __field(int, ret)
1935 ),
1936
1937 TP_fast_assign(
1938 __entry->dev = inode->i_sb->s_dev;
1939 __entry->ino = inode->i_ino;
1940 __entry->lblock = lblock;
1941 __entry->pblock = pblock;
1942 __entry->len = len;
1943 __entry->flags = flags;
1944 __entry->ret = ret;
1945 ),
1946
1947 TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld, "
1948 "len:%llu, flags:%u, ret:%d",
1949 show_dev_ino(__entry),
1950 (unsigned long long)__entry->lblock,
1951 (unsigned long long)__entry->pblock,
1952 __entry->len,
1953 __entry->flags,
1954 __entry->ret)
1955);
1956
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09001957#endif /* _TRACE_F2FS_H */
1958
1959 /* This part must be outside protection */
1960#include <trace/define_trace.h>