blob: af79e0c72926667fca370fc5d597f0b8f9042f57 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09002#undef TRACE_SYSTEM
3#define TRACE_SYSTEM f2fs
4
5#if !defined(_TRACE_F2FS_H) || defined(TRACE_HEADER_MULTI_READ)
6#define _TRACE_F2FS_H
7
8#include <linux/tracepoint.h>
9
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -080010#define show_dev(dev) MAJOR(dev), MINOR(dev)
11#define show_dev_ino(entry) show_dev(entry->dev), (unsigned long)entry->ino
Namjae Jeon6ec178d2013-04-23 17:51:43 +090012
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040013TRACE_DEFINE_ENUM(NODE);
14TRACE_DEFINE_ENUM(DATA);
15TRACE_DEFINE_ENUM(META);
16TRACE_DEFINE_ENUM(META_FLUSH);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070017TRACE_DEFINE_ENUM(INMEM);
18TRACE_DEFINE_ENUM(INMEM_DROP);
Jaegeuk Kim8c242db2017-03-17 09:55:52 +080019TRACE_DEFINE_ENUM(INMEM_INVALIDATE);
Chao Yua58f2442017-03-17 18:46:14 +080020TRACE_DEFINE_ENUM(INMEM_REVOKE);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070021TRACE_DEFINE_ENUM(IPU);
22TRACE_DEFINE_ENUM(OPU);
Jaegeuk Kima912b542017-05-10 11:18:25 -070023TRACE_DEFINE_ENUM(HOT);
24TRACE_DEFINE_ENUM(WARM);
25TRACE_DEFINE_ENUM(COLD);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040026TRACE_DEFINE_ENUM(CURSEG_HOT_DATA);
27TRACE_DEFINE_ENUM(CURSEG_WARM_DATA);
28TRACE_DEFINE_ENUM(CURSEG_COLD_DATA);
29TRACE_DEFINE_ENUM(CURSEG_HOT_NODE);
30TRACE_DEFINE_ENUM(CURSEG_WARM_NODE);
31TRACE_DEFINE_ENUM(CURSEG_COLD_NODE);
32TRACE_DEFINE_ENUM(NO_CHECK_TYPE);
33TRACE_DEFINE_ENUM(GC_GREEDY);
34TRACE_DEFINE_ENUM(GC_CB);
35TRACE_DEFINE_ENUM(FG_GC);
36TRACE_DEFINE_ENUM(BG_GC);
37TRACE_DEFINE_ENUM(LFS);
38TRACE_DEFINE_ENUM(SSR);
39TRACE_DEFINE_ENUM(__REQ_RAHEAD);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040040TRACE_DEFINE_ENUM(__REQ_SYNC);
Christoph Hellwiga2b80962016-11-01 07:40:09 -060041TRACE_DEFINE_ENUM(__REQ_IDLE);
Mike Christie28a8f0d2016-06-05 14:32:25 -050042TRACE_DEFINE_ENUM(__REQ_PREFLUSH);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040043TRACE_DEFINE_ENUM(__REQ_FUA);
44TRACE_DEFINE_ENUM(__REQ_PRIO);
45TRACE_DEFINE_ENUM(__REQ_META);
46TRACE_DEFINE_ENUM(CP_UMOUNT);
47TRACE_DEFINE_ENUM(CP_FASTBOOT);
48TRACE_DEFINE_ENUM(CP_SYNC);
Jaegeuk Kim5d799882015-04-22 16:07:38 -070049TRACE_DEFINE_ENUM(CP_RECOVERY);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040050TRACE_DEFINE_ENUM(CP_DISCARD);
Chao Yu1f43e2a2017-04-28 13:56:08 +080051TRACE_DEFINE_ENUM(CP_TRIMMED);
Steven Rostedt (Red Hat)5511b9a2015-03-27 16:18:07 -040052
Namjae Jeon6ec178d2013-04-23 17:51:43 +090053#define show_block_type(type) \
54 __print_symbolic(type, \
55 { NODE, "NODE" }, \
56 { DATA, "DATA" }, \
57 { META, "META" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070058 { META_FLUSH, "META_FLUSH" }, \
59 { INMEM, "INMEM" }, \
60 { INMEM_DROP, "INMEM_DROP" }, \
Jaegeuk Kim8c242db2017-03-17 09:55:52 +080061 { INMEM_INVALIDATE, "INMEM_INVALIDATE" }, \
Chao Yu28bc1062016-02-06 14:40:34 +080062 { INMEM_REVOKE, "INMEM_REVOKE" }, \
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -070063 { IPU, "IN-PLACE" }, \
64 { OPU, "OUT-OF-PLACE" })
Namjae Jeon6ec178d2013-04-23 17:51:43 +090065
Jaegeuk Kima912b542017-05-10 11:18:25 -070066#define show_block_temp(temp) \
67 __print_symbolic(temp, \
68 { HOT, "HOT" }, \
69 { WARM, "WARM" }, \
70 { COLD, "COLD" })
71
Chao Yubaaabbb2017-05-04 09:35:43 +080072#define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_META | REQ_PRIO | \
73 REQ_PREFLUSH | REQ_FUA)
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080074#define F2FS_BIO_FLAG_MASK(t) (t & F2FS_OP_FLAGS)
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090075
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080076#define show_bio_type(op,op_flags) show_bio_op(op), \
77 show_bio_op_flags(op_flags)
78
79#define show_bio_op(op) \
80 __print_symbolic(op, \
81 { REQ_OP_READ, "READ" }, \
82 { REQ_OP_WRITE, "WRITE" }, \
83 { REQ_OP_FLUSH, "FLUSH" }, \
84 { REQ_OP_DISCARD, "DISCARD" }, \
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -080085 { REQ_OP_SECURE_ERASE, "SECURE_ERASE" }, \
86 { REQ_OP_ZONE_RESET, "ZONE_RESET" }, \
87 { REQ_OP_WRITE_SAME, "WRITE_SAME" }, \
88 { REQ_OP_WRITE_ZEROES, "WRITE_ZEROES" })
Mike Christie04d328d2016-06-05 14:31:55 -050089
90#define show_bio_op_flags(flags) \
Chao Yubaaabbb2017-05-04 09:35:43 +080091 __print_flags(F2FS_BIO_FLAG_MASK(flags), "|", \
92 { REQ_RAHEAD, "R" }, \
93 { REQ_SYNC, "S" }, \
94 { REQ_META, "M" }, \
95 { REQ_PRIO, "P" }, \
96 { REQ_PREFLUSH, "PF" }, \
97 { REQ_FUA, "FUA" })
Jaegeuk Kima709f4a2013-11-24 14:42:23 +090098
Namjae Jeon8e46b3e2013-04-23 16:42:53 +090099#define show_data_type(type) \
100 __print_symbolic(type, \
101 { CURSEG_HOT_DATA, "Hot DATA" }, \
102 { CURSEG_WARM_DATA, "Warm DATA" }, \
103 { CURSEG_COLD_DATA, "Cold DATA" }, \
104 { CURSEG_HOT_NODE, "Hot NODE" }, \
105 { CURSEG_WARM_NODE, "Warm NODE" }, \
106 { CURSEG_COLD_NODE, "Cold NODE" }, \
107 { NO_CHECK_TYPE, "No TYPE" })
108
Jaegeuk Kim26c6b882013-10-24 17:53:29 +0900109#define show_file_type(type) \
110 __print_symbolic(type, \
111 { 0, "FILE" }, \
112 { 1, "DIR" })
113
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900114#define show_gc_type(type) \
115 __print_symbolic(type, \
116 { FG_GC, "Foreground GC" }, \
117 { BG_GC, "Background GC" })
118
119#define show_alloc_mode(type) \
120 __print_symbolic(type, \
121 { LFS, "LFS-mode" }, \
122 { SSR, "SSR-mode" })
123
124#define show_victim_policy(type) \
125 __print_symbolic(type, \
126 { GC_GREEDY, "Greedy" }, \
127 { GC_CB, "Cost-Benefit" })
128
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700129#define show_cpreason(type) \
Chao Yubaaabbb2017-05-04 09:35:43 +0800130 __print_flags(type, "|", \
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700131 { CP_UMOUNT, "Umount" }, \
Jaegeuk Kim119ee912015-01-29 11:45:33 -0800132 { CP_FASTBOOT, "Fastboot" }, \
Jaegeuk Kim4b2fecc2014-09-20 22:06:39 -0700133 { CP_SYNC, "Sync" }, \
Jaegeuk Kim10027552015-04-09 17:03:53 -0700134 { CP_RECOVERY, "Recovery" }, \
Chao Yu1f43e2a2017-04-28 13:56:08 +0800135 { CP_DISCARD, "Discard" }, \
Chao Yubaaabbb2017-05-04 09:35:43 +0800136 { CP_UMOUNT, "Umount" }, \
137 { CP_TRIMMED, "Trimmed" })
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -0700138
Chao Yua5fd5052017-11-06 22:51:45 +0800139#define show_fsync_cpreason(type) \
140 __print_symbolic(type, \
141 { CP_NO_NEEDED, "no needed" }, \
142 { CP_NON_REGULAR, "non regular" }, \
143 { CP_HARDLINK, "hardlink" }, \
144 { CP_SB_NEED_CP, "sb needs cp" }, \
145 { CP_WRONG_PINO, "wrong pino" }, \
146 { CP_NO_SPC_ROLL, "no space roll forward" }, \
147 { CP_NODE_NEED_CP, "node needs cp" }, \
148 { CP_FASTBOOT_MODE, "fastboot mode" }, \
Jaegeuk Kim0a007b972017-12-28 08:09:44 -0800149 { CP_SPEC_LOG_NUM, "log type is 2" }, \
150 { CP_RECOVER_DIR, "dir needs recovery" })
Chao Yua5fd5052017-11-06 22:51:45 +0800151
Chao Yu559e87c2019-02-26 19:01:15 +0800152#define show_shutdown_mode(type) \
153 __print_symbolic(type, \
154 { F2FS_GOING_DOWN_FULLSYNC, "full sync" }, \
155 { F2FS_GOING_DOWN_METASYNC, "meta sync" }, \
156 { F2FS_GOING_DOWN_NOSYNC, "no sync" }, \
157 { F2FS_GOING_DOWN_METAFLUSH, "meta flush" }, \
158 { F2FS_GOING_DOWN_NEED_FSCK, "need fsck" })
159
Zhikang Zhang539cd352019-01-03 20:06:38 +0800160struct f2fs_sb_info;
161struct f2fs_io_info;
162struct extent_info;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900163struct victim_sel_policy;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700164struct f2fs_map_blocks;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900165
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900166DECLARE_EVENT_CLASS(f2fs__inode,
167
168 TP_PROTO(struct inode *inode),
169
170 TP_ARGS(inode),
171
172 TP_STRUCT__entry(
173 __field(dev_t, dev)
174 __field(ino_t, ino)
175 __field(ino_t, pino)
176 __field(umode_t, mode)
177 __field(loff_t, size)
178 __field(unsigned int, nlink)
179 __field(blkcnt_t, blocks)
180 __field(__u8, advise)
181 ),
182
183 TP_fast_assign(
184 __entry->dev = inode->i_sb->s_dev;
185 __entry->ino = inode->i_ino;
186 __entry->pino = F2FS_I(inode)->i_pino;
187 __entry->mode = inode->i_mode;
188 __entry->nlink = inode->i_nlink;
189 __entry->size = inode->i_size;
190 __entry->blocks = inode->i_blocks;
191 __entry->advise = F2FS_I(inode)->i_advise;
192 ),
193
194 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
195 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
196 show_dev_ino(__entry),
197 (unsigned long)__entry->pino,
198 __entry->mode,
199 __entry->size,
200 (unsigned int)__entry->nlink,
201 (unsigned long long)__entry->blocks,
202 (unsigned char)__entry->advise)
203);
204
205DECLARE_EVENT_CLASS(f2fs__inode_exit,
206
207 TP_PROTO(struct inode *inode, int ret),
208
209 TP_ARGS(inode, ret),
210
211 TP_STRUCT__entry(
212 __field(dev_t, dev)
213 __field(ino_t, ino)
214 __field(int, ret)
215 ),
216
217 TP_fast_assign(
218 __entry->dev = inode->i_sb->s_dev;
219 __entry->ino = inode->i_ino;
220 __entry->ret = ret;
221 ),
222
223 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
224 show_dev_ino(__entry),
225 __entry->ret)
226);
227
228DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
229
230 TP_PROTO(struct inode *inode),
231
232 TP_ARGS(inode)
233);
234
235TRACE_EVENT(f2fs_sync_file_exit,
236
Chao Yua5fd5052017-11-06 22:51:45 +0800237 TP_PROTO(struct inode *inode, int cp_reason, int datasync, int ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900238
Chao Yua5fd5052017-11-06 22:51:45 +0800239 TP_ARGS(inode, cp_reason, datasync, ret),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900240
241 TP_STRUCT__entry(
242 __field(dev_t, dev)
243 __field(ino_t, ino)
Chao Yua5fd5052017-11-06 22:51:45 +0800244 __field(int, cp_reason)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900245 __field(int, datasync)
246 __field(int, ret)
247 ),
248
249 TP_fast_assign(
250 __entry->dev = inode->i_sb->s_dev;
251 __entry->ino = inode->i_ino;
Chao Yua5fd5052017-11-06 22:51:45 +0800252 __entry->cp_reason = cp_reason;
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900253 __entry->datasync = datasync;
254 __entry->ret = ret;
255 ),
256
Chao Yua5fd5052017-11-06 22:51:45 +0800257 TP_printk("dev = (%d,%d), ino = %lu, cp_reason: %s, "
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900258 "datasync = %d, ret = %d",
259 show_dev_ino(__entry),
Chao Yua5fd5052017-11-06 22:51:45 +0800260 show_fsync_cpreason(__entry->cp_reason),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900261 __entry->datasync,
262 __entry->ret)
263);
264
265TRACE_EVENT(f2fs_sync_fs,
266
267 TP_PROTO(struct super_block *sb, int wait),
268
269 TP_ARGS(sb, wait),
270
271 TP_STRUCT__entry(
272 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -0800273 __field(int, dirty)
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900274 __field(int, wait)
275 ),
276
277 TP_fast_assign(
278 __entry->dev = sb->s_dev;
Chao Yucaf00472015-01-28 17:48:42 +0800279 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900280 __entry->wait = wait;
281 ),
282
283 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800284 show_dev(__entry->dev),
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900285 __entry->dirty ? "dirty" : "not dirty",
286 __entry->wait)
287);
288
289DEFINE_EVENT(f2fs__inode, f2fs_iget,
290
291 TP_PROTO(struct inode *inode),
292
293 TP_ARGS(inode)
294);
295
296DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
297
298 TP_PROTO(struct inode *inode, int ret),
299
300 TP_ARGS(inode, ret)
301);
302
303DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
304
305 TP_PROTO(struct inode *inode),
306
307 TP_ARGS(inode)
308);
309
Jaegeuk Kimd70b4f52013-04-25 13:24:33 +0900310DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
311
312 TP_PROTO(struct inode *inode, int ret),
313
314 TP_ARGS(inode, ret)
315);
316
Namjae Jeona2a4a7e2013-04-20 01:28:40 +0900317TRACE_EVENT(f2fs_unlink_enter,
318
319 TP_PROTO(struct inode *dir, struct dentry *dentry),
320
321 TP_ARGS(dir, dentry),
322
323 TP_STRUCT__entry(
324 __field(dev_t, dev)
325 __field(ino_t, ino)
326 __field(loff_t, size)
327 __field(blkcnt_t, blocks)
328 __field(const char *, name)
329 ),
330
331 TP_fast_assign(
332 __entry->dev = dir->i_sb->s_dev;
333 __entry->ino = dir->i_ino;
334 __entry->size = dir->i_size;
335 __entry->blocks = dir->i_blocks;
336 __entry->name = dentry->d_name.name;
337 ),
338
339 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
340 "i_blocks = %llu, name = %s",
341 show_dev_ino(__entry),
342 __entry->size,
343 (unsigned long long)__entry->blocks,
344 __entry->name)
345);
346
347DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
348
349 TP_PROTO(struct inode *inode, int ret),
350
351 TP_ARGS(inode, ret)
352);
Namjae Jeon51dd6242013-04-20 01:28:52 +0900353
Hou Pengyangb8d96a32017-02-27 13:02:58 +0000354DEFINE_EVENT(f2fs__inode_exit, f2fs_drop_inode,
355
356 TP_PROTO(struct inode *inode, int ret),
357
358 TP_ARGS(inode, ret)
359);
360
Namjae Jeon51dd6242013-04-20 01:28:52 +0900361DEFINE_EVENT(f2fs__inode, f2fs_truncate,
362
363 TP_PROTO(struct inode *inode),
364
365 TP_ARGS(inode)
366);
367
368TRACE_EVENT(f2fs_truncate_data_blocks_range,
369
370 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
371
372 TP_ARGS(inode, nid, ofs, free),
373
374 TP_STRUCT__entry(
375 __field(dev_t, dev)
376 __field(ino_t, ino)
377 __field(nid_t, nid)
378 __field(unsigned int, ofs)
379 __field(int, free)
380 ),
381
382 TP_fast_assign(
383 __entry->dev = inode->i_sb->s_dev;
384 __entry->ino = inode->i_ino;
385 __entry->nid = nid;
386 __entry->ofs = ofs;
387 __entry->free = free;
388 ),
389
390 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
391 show_dev_ino(__entry),
392 (unsigned int)__entry->nid,
393 __entry->ofs,
394 __entry->free)
395);
396
397DECLARE_EVENT_CLASS(f2fs__truncate_op,
398
399 TP_PROTO(struct inode *inode, u64 from),
400
401 TP_ARGS(inode, from),
402
403 TP_STRUCT__entry(
404 __field(dev_t, dev)
405 __field(ino_t, ino)
406 __field(loff_t, size)
407 __field(blkcnt_t, blocks)
408 __field(u64, from)
409 ),
410
411 TP_fast_assign(
412 __entry->dev = inode->i_sb->s_dev;
413 __entry->ino = inode->i_ino;
414 __entry->size = inode->i_size;
415 __entry->blocks = inode->i_blocks;
416 __entry->from = from;
417 ),
418
419 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
420 "start file offset = %llu",
421 show_dev_ino(__entry),
422 __entry->size,
423 (unsigned long long)__entry->blocks,
424 (unsigned long long)__entry->from)
425);
426
427DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
428
429 TP_PROTO(struct inode *inode, u64 from),
430
431 TP_ARGS(inode, from)
432);
433
434DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
435
436 TP_PROTO(struct inode *inode, int ret),
437
438 TP_ARGS(inode, ret)
439);
440
441DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
442
443 TP_PROTO(struct inode *inode, u64 from),
444
445 TP_ARGS(inode, from)
446);
447
448DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
449
450 TP_PROTO(struct inode *inode, int ret),
451
452 TP_ARGS(inode, ret)
453);
454
455DECLARE_EVENT_CLASS(f2fs__truncate_node,
456
457 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
458
459 TP_ARGS(inode, nid, blk_addr),
460
461 TP_STRUCT__entry(
462 __field(dev_t, dev)
463 __field(ino_t, ino)
464 __field(nid_t, nid)
465 __field(block_t, blk_addr)
466 ),
467
468 TP_fast_assign(
469 __entry->dev = inode->i_sb->s_dev;
470 __entry->ino = inode->i_ino;
471 __entry->nid = nid;
472 __entry->blk_addr = blk_addr;
473 ),
474
475 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
476 show_dev_ino(__entry),
477 (unsigned int)__entry->nid,
478 (unsigned long long)__entry->blk_addr)
479);
480
481DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
482
483 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
484
485 TP_ARGS(inode, nid, blk_addr)
486);
487
488DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
489
490 TP_PROTO(struct inode *inode, int ret),
491
492 TP_ARGS(inode, ret)
493);
494
495DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
496
497 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
498
499 TP_ARGS(inode, nid, blk_addr)
500);
501
502TRACE_EVENT(f2fs_truncate_partial_nodes,
503
Alexei Starovoitovc1055472018-03-28 12:05:32 -0700504 TP_PROTO(struct inode *inode, nid_t *nid, int depth, int err),
Namjae Jeon51dd6242013-04-20 01:28:52 +0900505
506 TP_ARGS(inode, nid, depth, err),
507
508 TP_STRUCT__entry(
509 __field(dev_t, dev)
510 __field(ino_t, ino)
511 __field(nid_t, nid[3])
512 __field(int, depth)
513 __field(int, err)
514 ),
515
516 TP_fast_assign(
517 __entry->dev = inode->i_sb->s_dev;
518 __entry->ino = inode->i_ino;
519 __entry->nid[0] = nid[0];
520 __entry->nid[1] = nid[1];
521 __entry->nid[2] = nid[2];
522 __entry->depth = depth;
523 __entry->err = err;
524 ),
525
526 TP_printk("dev = (%d,%d), ino = %lu, "
527 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
528 show_dev_ino(__entry),
529 (unsigned int)__entry->nid[0],
530 (unsigned int)__entry->nid[1],
531 (unsigned int)__entry->nid[2],
532 __entry->depth,
533 __entry->err)
534);
535
Chao Yu126ce722019-04-02 18:52:22 +0800536TRACE_EVENT(f2fs_file_write_iter,
537
538 TP_PROTO(struct inode *inode, unsigned long offset,
539 unsigned long length, int ret),
540
541 TP_ARGS(inode, offset, length, ret),
542
543 TP_STRUCT__entry(
544 __field(dev_t, dev)
545 __field(ino_t, ino)
546 __field(unsigned long, offset)
547 __field(unsigned long, length)
548 __field(int, ret)
549 ),
550
551 TP_fast_assign(
552 __entry->dev = inode->i_sb->s_dev;
553 __entry->ino = inode->i_ino;
554 __entry->offset = offset;
555 __entry->length = length;
556 __entry->ret = ret;
557 ),
558
559 TP_printk("dev = (%d,%d), ino = %lu, "
560 "offset = %lu, length = %lu, written(err) = %d",
561 show_dev_ino(__entry),
562 __entry->offset,
563 __entry->length,
564 __entry->ret)
565);
566
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700567TRACE_EVENT(f2fs_map_blocks,
568 TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900569
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700570 TP_ARGS(inode, map, ret),
Namjae Jeon848753a2013-04-23 16:38:02 +0900571
572 TP_STRUCT__entry(
573 __field(dev_t, dev)
574 __field(ino_t, ino)
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700575 __field(block_t, m_lblk)
576 __field(block_t, m_pblk)
577 __field(unsigned int, m_len)
Chao Yu76630f22019-02-26 19:01:16 +0800578 __field(unsigned int, m_flags)
579 __field(int, m_seg_type)
580 __field(bool, m_may_create)
Namjae Jeon848753a2013-04-23 16:38:02 +0900581 __field(int, ret)
582 ),
583
584 TP_fast_assign(
585 __entry->dev = inode->i_sb->s_dev;
586 __entry->ino = inode->i_ino;
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700587 __entry->m_lblk = map->m_lblk;
588 __entry->m_pblk = map->m_pblk;
589 __entry->m_len = map->m_len;
Chao Yu76630f22019-02-26 19:01:16 +0800590 __entry->m_flags = map->m_flags;
591 __entry->m_seg_type = map->m_seg_type;
592 __entry->m_may_create = map->m_may_create;
Namjae Jeon848753a2013-04-23 16:38:02 +0900593 __entry->ret = ret;
594 ),
595
596 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
Chao Yu76630f22019-02-26 19:01:16 +0800597 "start blkaddr = 0x%llx, len = 0x%llx, flags = %u,"
598 "seg_type = %d, may_create = %d, err = %d",
Namjae Jeon848753a2013-04-23 16:38:02 +0900599 show_dev_ino(__entry),
Jaegeuk Kim003a3e12015-04-06 19:55:34 -0700600 (unsigned long long)__entry->m_lblk,
601 (unsigned long long)__entry->m_pblk,
602 (unsigned long long)__entry->m_len,
Chao Yu76630f22019-02-26 19:01:16 +0800603 __entry->m_flags,
604 __entry->m_seg_type,
605 __entry->m_may_create,
Namjae Jeon848753a2013-04-23 16:38:02 +0900606 __entry->ret)
607);
608
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700609TRACE_EVENT(f2fs_background_gc,
610
Chao Yub8c502b2017-08-07 23:12:46 +0800611 TP_PROTO(struct super_block *sb, unsigned int wait_ms,
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700612 unsigned int prefree, unsigned int free),
613
614 TP_ARGS(sb, wait_ms, prefree, free),
615
616 TP_STRUCT__entry(
617 __field(dev_t, dev)
Chao Yub8c502b2017-08-07 23:12:46 +0800618 __field(unsigned int, wait_ms)
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700619 __field(unsigned int, prefree)
620 __field(unsigned int, free)
621 ),
622
623 TP_fast_assign(
624 __entry->dev = sb->s_dev;
625 __entry->wait_ms = wait_ms;
626 __entry->prefree = prefree;
627 __entry->free = free;
628 ),
629
Chao Yub8c502b2017-08-07 23:12:46 +0800630 TP_printk("dev = (%d,%d), wait_ms = %u, prefree = %u, free = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800631 show_dev(__entry->dev),
Jaegeuk Kim5c267432015-10-05 11:32:34 -0700632 __entry->wait_ms,
633 __entry->prefree,
634 __entry->free)
635);
636
Chao Yuc56f16d2017-08-11 18:00:15 +0800637TRACE_EVENT(f2fs_gc_begin,
638
639 TP_PROTO(struct super_block *sb, bool sync, bool background,
640 long long dirty_nodes, long long dirty_dents,
641 long long dirty_imeta, unsigned int free_sec,
642 unsigned int free_seg, int reserved_seg,
643 unsigned int prefree_seg),
644
645 TP_ARGS(sb, sync, background, dirty_nodes, dirty_dents, dirty_imeta,
646 free_sec, free_seg, reserved_seg, prefree_seg),
647
648 TP_STRUCT__entry(
649 __field(dev_t, dev)
650 __field(bool, sync)
651 __field(bool, background)
652 __field(long long, dirty_nodes)
653 __field(long long, dirty_dents)
654 __field(long long, dirty_imeta)
655 __field(unsigned int, free_sec)
656 __field(unsigned int, free_seg)
657 __field(int, reserved_seg)
658 __field(unsigned int, prefree_seg)
659 ),
660
661 TP_fast_assign(
662 __entry->dev = sb->s_dev;
663 __entry->sync = sync;
664 __entry->background = background;
665 __entry->dirty_nodes = dirty_nodes;
666 __entry->dirty_dents = dirty_dents;
667 __entry->dirty_imeta = dirty_imeta;
668 __entry->free_sec = free_sec;
669 __entry->free_seg = free_seg;
670 __entry->reserved_seg = reserved_seg;
671 __entry->prefree_seg = prefree_seg;
672 ),
673
674 TP_printk("dev = (%d,%d), sync = %d, background = %d, nodes = %lld, "
675 "dents = %lld, imeta = %lld, free_sec:%u, free_seg:%u, "
676 "rsv_seg:%d, prefree_seg:%u",
677 show_dev(__entry->dev),
678 __entry->sync,
679 __entry->background,
680 __entry->dirty_nodes,
681 __entry->dirty_dents,
682 __entry->dirty_imeta,
683 __entry->free_sec,
684 __entry->free_seg,
685 __entry->reserved_seg,
686 __entry->prefree_seg)
687);
688
689TRACE_EVENT(f2fs_gc_end,
690
691 TP_PROTO(struct super_block *sb, int ret, int seg_freed,
692 int sec_freed, long long dirty_nodes,
693 long long dirty_dents, long long dirty_imeta,
694 unsigned int free_sec, unsigned int free_seg,
695 int reserved_seg, unsigned int prefree_seg),
696
697 TP_ARGS(sb, ret, seg_freed, sec_freed, dirty_nodes, dirty_dents,
698 dirty_imeta, free_sec, free_seg, reserved_seg, prefree_seg),
699
700 TP_STRUCT__entry(
701 __field(dev_t, dev)
702 __field(int, ret)
703 __field(int, seg_freed)
704 __field(int, sec_freed)
705 __field(long long, dirty_nodes)
706 __field(long long, dirty_dents)
707 __field(long long, dirty_imeta)
708 __field(unsigned int, free_sec)
709 __field(unsigned int, free_seg)
710 __field(int, reserved_seg)
711 __field(unsigned int, prefree_seg)
712 ),
713
714 TP_fast_assign(
715 __entry->dev = sb->s_dev;
716 __entry->ret = ret;
717 __entry->seg_freed = seg_freed;
718 __entry->sec_freed = sec_freed;
719 __entry->dirty_nodes = dirty_nodes;
720 __entry->dirty_dents = dirty_dents;
721 __entry->dirty_imeta = dirty_imeta;
722 __entry->free_sec = free_sec;
723 __entry->free_seg = free_seg;
724 __entry->reserved_seg = reserved_seg;
725 __entry->prefree_seg = prefree_seg;
726 ),
727
728 TP_printk("dev = (%d,%d), ret = %d, seg_freed = %d, sec_freed = %d, "
729 "nodes = %lld, dents = %lld, imeta = %lld, free_sec:%u, "
730 "free_seg:%u, rsv_seg:%d, prefree_seg:%u",
731 show_dev(__entry->dev),
732 __entry->ret,
733 __entry->seg_freed,
734 __entry->sec_freed,
735 __entry->dirty_nodes,
736 __entry->dirty_dents,
737 __entry->dirty_imeta,
738 __entry->free_sec,
739 __entry->free_seg,
740 __entry->reserved_seg,
741 __entry->prefree_seg)
742);
743
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900744TRACE_EVENT(f2fs_get_victim,
745
746 TP_PROTO(struct super_block *sb, int type, int gc_type,
747 struct victim_sel_policy *p, unsigned int pre_victim,
748 unsigned int prefree, unsigned int free),
749
750 TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
751
752 TP_STRUCT__entry(
753 __field(dev_t, dev)
754 __field(int, type)
755 __field(int, gc_type)
756 __field(int, alloc_mode)
757 __field(int, gc_mode)
758 __field(unsigned int, victim)
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800759 __field(unsigned int, cost)
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900760 __field(unsigned int, ofs_unit)
761 __field(unsigned int, pre_victim)
762 __field(unsigned int, prefree)
763 __field(unsigned int, free)
764 ),
765
766 TP_fast_assign(
767 __entry->dev = sb->s_dev;
768 __entry->type = type;
769 __entry->gc_type = gc_type;
770 __entry->alloc_mode = p->alloc_mode;
771 __entry->gc_mode = p->gc_mode;
772 __entry->victim = p->min_segno;
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800773 __entry->cost = p->min_cost;
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900774 __entry->ofs_unit = p->ofs_unit;
775 __entry->pre_victim = pre_victim;
776 __entry->prefree = prefree;
777 __entry->free = free;
778 ),
779
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800780 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), "
781 "victim = %u, cost = %u, ofs_unit = %u, "
782 "pre_victim_secno = %d, prefree = %u, free = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -0800783 show_dev(__entry->dev),
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900784 show_data_type(__entry->type),
785 show_gc_type(__entry->gc_type),
786 show_alloc_mode(__entry->alloc_mode),
787 show_victim_policy(__entry->gc_mode),
788 __entry->victim,
Jaegeuk Kim5012de22017-02-16 10:35:41 -0800789 __entry->cost,
Namjae Jeon8e46b3e2013-04-23 16:42:53 +0900790 __entry->ofs_unit,
791 (int)__entry->pre_victim,
792 __entry->prefree,
793 __entry->free)
794);
795
Chao Yu0c5e36d2017-10-17 17:33:41 +0800796TRACE_EVENT(f2fs_lookup_start,
797
798 TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags),
799
800 TP_ARGS(dir, dentry, flags),
801
802 TP_STRUCT__entry(
803 __field(dev_t, dev)
804 __field(ino_t, ino)
805 __field(const char *, name)
806 __field(unsigned int, flags)
807 ),
808
809 TP_fast_assign(
810 __entry->dev = dir->i_sb->s_dev;
811 __entry->ino = dir->i_ino;
812 __entry->name = dentry->d_name.name;
813 __entry->flags = flags;
814 ),
815
816 TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u",
817 show_dev_ino(__entry),
818 __entry->name,
819 __entry->flags)
820);
821
822TRACE_EVENT(f2fs_lookup_end,
823
824 TP_PROTO(struct inode *dir, struct dentry *dentry, nid_t ino,
825 int err),
826
827 TP_ARGS(dir, dentry, ino, err),
828
829 TP_STRUCT__entry(
830 __field(dev_t, dev)
831 __field(ino_t, ino)
832 __field(const char *, name)
833 __field(nid_t, cino)
834 __field(int, err)
835 ),
836
837 TP_fast_assign(
838 __entry->dev = dir->i_sb->s_dev;
839 __entry->ino = dir->i_ino;
840 __entry->name = dentry->d_name.name;
841 __entry->cino = ino;
842 __entry->err = err;
843 ),
844
845 TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d",
846 show_dev_ino(__entry),
847 __entry->name,
848 __entry->cino,
849 __entry->err)
850);
851
Chao Yue97a3c42017-10-13 18:01:33 +0800852TRACE_EVENT(f2fs_readdir,
853
854 TP_PROTO(struct inode *dir, loff_t start_pos, loff_t end_pos, int err),
855
856 TP_ARGS(dir, start_pos, end_pos, err),
857
858 TP_STRUCT__entry(
859 __field(dev_t, dev)
860 __field(ino_t, ino)
861 __field(loff_t, start)
862 __field(loff_t, end)
863 __field(int, err)
864 ),
865
866 TP_fast_assign(
867 __entry->dev = dir->i_sb->s_dev;
868 __entry->ino = dir->i_ino;
869 __entry->start = start_pos;
870 __entry->end = end_pos;
871 __entry->err = err;
872 ),
873
874 TP_printk("dev = (%d,%d), ino = %lu, start_pos:%llu, end_pos:%llu, err:%d",
875 show_dev_ino(__entry),
876 __entry->start,
877 __entry->end,
878 __entry->err)
879);
880
Namjae Jeonc01e2852013-04-23 17:00:52 +0900881TRACE_EVENT(f2fs_fallocate,
882
883 TP_PROTO(struct inode *inode, int mode,
884 loff_t offset, loff_t len, int ret),
885
886 TP_ARGS(inode, mode, offset, len, ret),
887
888 TP_STRUCT__entry(
889 __field(dev_t, dev)
890 __field(ino_t, ino)
891 __field(int, mode)
892 __field(loff_t, offset)
893 __field(loff_t, len)
894 __field(loff_t, size)
895 __field(blkcnt_t, blocks)
896 __field(int, ret)
897 ),
898
899 TP_fast_assign(
900 __entry->dev = inode->i_sb->s_dev;
901 __entry->ino = inode->i_ino;
902 __entry->mode = mode;
903 __entry->offset = offset;
904 __entry->len = len;
905 __entry->size = inode->i_size;
906 __entry->blocks = inode->i_blocks;
907 __entry->ret = ret;
908 ),
909
910 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
911 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
912 show_dev_ino(__entry),
913 __entry->mode,
914 (unsigned long long)__entry->offset,
915 (unsigned long long)__entry->len,
916 (unsigned long long)__entry->size,
917 (unsigned long long)__entry->blocks,
918 __entry->ret)
919);
920
Chao Yu70407fa2014-07-31 21:11:22 +0800921TRACE_EVENT(f2fs_direct_IO_enter,
922
923 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
924
925 TP_ARGS(inode, offset, len, rw),
926
927 TP_STRUCT__entry(
928 __field(dev_t, dev)
929 __field(ino_t, ino)
930 __field(loff_t, pos)
931 __field(unsigned long, len)
932 __field(int, rw)
933 ),
934
935 TP_fast_assign(
936 __entry->dev = inode->i_sb->s_dev;
937 __entry->ino = inode->i_ino;
938 __entry->pos = offset;
939 __entry->len = len;
940 __entry->rw = rw;
941 ),
942
943 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
944 show_dev_ino(__entry),
945 __entry->pos,
946 __entry->len,
947 __entry->rw)
948);
949
950TRACE_EVENT(f2fs_direct_IO_exit,
951
952 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
953 int rw, int ret),
954
955 TP_ARGS(inode, offset, len, rw, ret),
956
957 TP_STRUCT__entry(
958 __field(dev_t, dev)
959 __field(ino_t, ino)
960 __field(loff_t, pos)
961 __field(unsigned long, len)
962 __field(int, rw)
963 __field(int, ret)
964 ),
965
966 TP_fast_assign(
967 __entry->dev = inode->i_sb->s_dev;
968 __entry->ino = inode->i_ino;
969 __entry->pos = offset;
970 __entry->len = len;
971 __entry->rw = rw;
972 __entry->ret = ret;
973 ),
974
975 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
976 "rw = %d ret = %d",
977 show_dev_ino(__entry),
978 __entry->pos,
979 __entry->len,
980 __entry->rw,
981 __entry->ret)
982);
983
Chao Yu46008c62016-05-09 19:56:30 +0800984TRACE_EVENT(f2fs_reserve_new_blocks,
Namjae Jeonc01e2852013-04-23 17:00:52 +0900985
Chao Yu46008c62016-05-09 19:56:30 +0800986 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node,
987 blkcnt_t count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900988
Chao Yu46008c62016-05-09 19:56:30 +0800989 TP_ARGS(inode, nid, ofs_in_node, count),
Namjae Jeonc01e2852013-04-23 17:00:52 +0900990
991 TP_STRUCT__entry(
992 __field(dev_t, dev)
993 __field(nid_t, nid)
994 __field(unsigned int, ofs_in_node)
Chao Yu46008c62016-05-09 19:56:30 +0800995 __field(blkcnt_t, count)
Namjae Jeonc01e2852013-04-23 17:00:52 +0900996 ),
997
998 TP_fast_assign(
999 __entry->dev = inode->i_sb->s_dev;
1000 __entry->nid = nid;
1001 __entry->ofs_in_node = ofs_in_node;
Chao Yu46008c62016-05-09 19:56:30 +08001002 __entry->count = count;
Namjae Jeonc01e2852013-04-23 17:00:52 +09001003 ),
1004
Chao Yu46008c62016-05-09 19:56:30 +08001005 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001006 show_dev(__entry->dev),
Namjae Jeonc01e2852013-04-23 17:00:52 +09001007 (unsigned int)__entry->nid,
Chao Yu46008c62016-05-09 19:56:30 +08001008 __entry->ofs_in_node,
1009 (unsigned long long)__entry->count)
Namjae Jeonc01e2852013-04-23 17:00:52 +09001010);
1011
Chao Yu3e1c8f12014-12-23 16:35:21 +08001012DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
1013
Chao Yu2ace38e2014-12-24 16:08:14 +08001014 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001015
Chao Yu2ace38e2014-12-24 16:08:14 +08001016 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001017
1018 TP_STRUCT__entry(
1019 __field(dev_t, dev)
1020 __field(ino_t, ino)
1021 __field(pgoff_t, index)
Chao Yu7a9d7542016-02-22 18:36:38 +08001022 __field(block_t, old_blkaddr)
1023 __field(block_t, new_blkaddr)
Mike Christie04d328d2016-06-05 14:31:55 -05001024 __field(int, op)
1025 __field(int, op_flags)
Jaegeuk Kima912b542017-05-10 11:18:25 -07001026 __field(int, temp)
Chao Yu3e1c8f12014-12-23 16:35:21 +08001027 __field(int, type)
1028 ),
1029
1030 TP_fast_assign(
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001031 __entry->dev = page_file_mapping(page)->host->i_sb->s_dev;
1032 __entry->ino = page_file_mapping(page)->host->i_ino;
Chao Yu3e1c8f12014-12-23 16:35:21 +08001033 __entry->index = page->index;
Chao Yu7a9d7542016-02-22 18:36:38 +08001034 __entry->old_blkaddr = fio->old_blkaddr;
1035 __entry->new_blkaddr = fio->new_blkaddr;
Mike Christie04d328d2016-06-05 14:31:55 -05001036 __entry->op = fio->op;
1037 __entry->op_flags = fio->op_flags;
Jaegeuk Kima912b542017-05-10 11:18:25 -07001038 __entry->temp = fio->temp;
Chao Yu2ace38e2014-12-24 16:08:14 +08001039 __entry->type = fio->type;
Chao Yu3e1c8f12014-12-23 16:35:21 +08001040 ),
1041
1042 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
Jaegeuk Kima912b542017-05-10 11:18:25 -07001043 "oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s",
Chao Yu3e1c8f12014-12-23 16:35:21 +08001044 show_dev_ino(__entry),
1045 (unsigned long)__entry->index,
Chao Yu7a9d7542016-02-22 18:36:38 +08001046 (unsigned long long)__entry->old_blkaddr,
1047 (unsigned long long)__entry->new_blkaddr,
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -08001048 show_bio_type(__entry->op, __entry->op_flags),
Jaegeuk Kima912b542017-05-10 11:18:25 -07001049 show_block_temp(__entry->temp),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001050 show_block_type(__entry->type))
1051);
1052
1053DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
1054
Chao Yu2ace38e2014-12-24 16:08:14 +08001055 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001056
Chao Yu2ace38e2014-12-24 16:08:14 +08001057 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001058
1059 TP_CONDITION(page->mapping)
1060);
1061
Jaegeuk Kimb9109b02017-05-10 11:28:38 -07001062DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_write,
Chao Yu3e1c8f12014-12-23 16:35:21 +08001063
Chao Yu2ace38e2014-12-24 16:08:14 +08001064 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001065
Chao Yu2ace38e2014-12-24 16:08:14 +08001066 TP_ARGS(page, fio),
Chao Yu3e1c8f12014-12-23 16:35:21 +08001067
1068 TP_CONDITION(page->mapping)
1069);
1070
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001071DECLARE_EVENT_CLASS(f2fs__bio,
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001072
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001073 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001074
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001075 TP_ARGS(sb, type, bio),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001076
1077 TP_STRUCT__entry(
1078 __field(dev_t, dev)
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001079 __field(dev_t, target)
Mike Christie04d328d2016-06-05 14:31:55 -05001080 __field(int, op)
1081 __field(int, op_flags)
Chao Yud4d288b2013-11-24 12:36:42 +09001082 __field(int, type)
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001083 __field(sector_t, sector)
1084 __field(unsigned int, size)
1085 ),
1086
1087 TP_fast_assign(
1088 __entry->dev = sb->s_dev;
Christoph Hellwig74d46992017-08-23 19:10:32 +02001089 __entry->target = bio_dev(bio);
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001090 __entry->op = bio_op(bio);
1091 __entry->op_flags = bio->bi_opf;
1092 __entry->type = type;
Kent Overstreet4f024f32013-10-11 15:44:27 -07001093 __entry->sector = bio->bi_iter.bi_sector;
1094 __entry->size = bio->bi_iter.bi_size;
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001095 ),
1096
Chao Yubaaabbb2017-05-04 09:35:43 +08001097 TP_printk("dev = (%d,%d)/(%d,%d), rw = %s(%s), %s, sector = %lld, size = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001098 show_dev(__entry->target),
1099 show_dev(__entry->dev),
Jaegeuk Kimd621e6b2016-12-21 14:26:39 -08001100 show_bio_type(__entry->op, __entry->op_flags),
Chao Yud4d288b2013-11-24 12:36:42 +09001101 show_block_type(__entry->type),
Namjae Jeon6ec178d2013-04-23 17:51:43 +09001102 (unsigned long long)__entry->sector,
1103 __entry->size)
1104);
1105
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001106DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio,
Chao Yud4d288b2013-11-24 12:36:42 +09001107
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001108 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +09001109
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001110 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +09001111
1112 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +09001113);
1114
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001115DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio,
Chao Yud4d288b2013-11-24 12:36:42 +09001116
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001117 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
Chao Yud4d288b2013-11-24 12:36:42 +09001118
Jaegeuk Kim554b5122016-12-21 12:13:03 -08001119 TP_ARGS(sb, type, bio),
1120
1121 TP_CONDITION(bio)
1122);
1123
1124DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_read_bio,
1125
1126 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1127
1128 TP_ARGS(sb, type, bio),
1129
1130 TP_CONDITION(bio)
1131);
1132
1133DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio,
1134
1135 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1136
1137 TP_ARGS(sb, type, bio),
Jaegeuk Kim93dfe2a2013-11-30 12:51:14 +09001138
1139 TP_CONDITION(bio)
Chao Yud4d288b2013-11-24 12:36:42 +09001140);
1141
Chao Yu62aed042014-05-06 16:46:04 +08001142TRACE_EVENT(f2fs_write_begin,
1143
1144 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1145 unsigned int flags),
1146
1147 TP_ARGS(inode, pos, len, flags),
1148
1149 TP_STRUCT__entry(
1150 __field(dev_t, dev)
1151 __field(ino_t, ino)
1152 __field(loff_t, pos)
1153 __field(unsigned int, len)
1154 __field(unsigned int, flags)
1155 ),
1156
1157 TP_fast_assign(
1158 __entry->dev = inode->i_sb->s_dev;
1159 __entry->ino = inode->i_ino;
1160 __entry->pos = pos;
1161 __entry->len = len;
1162 __entry->flags = flags;
1163 ),
1164
1165 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
1166 show_dev_ino(__entry),
1167 (unsigned long long)__entry->pos,
1168 __entry->len,
1169 __entry->flags)
1170);
1171
Chao Yudfb2bf32014-05-06 16:47:23 +08001172TRACE_EVENT(f2fs_write_end,
1173
1174 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1175 unsigned int copied),
1176
1177 TP_ARGS(inode, pos, len, copied),
1178
1179 TP_STRUCT__entry(
1180 __field(dev_t, dev)
1181 __field(ino_t, ino)
1182 __field(loff_t, pos)
1183 __field(unsigned int, len)
1184 __field(unsigned int, copied)
1185 ),
1186
1187 TP_fast_assign(
1188 __entry->dev = inode->i_sb->s_dev;
1189 __entry->ino = inode->i_ino;
1190 __entry->pos = pos;
1191 __entry->len = len;
1192 __entry->copied = copied;
1193 ),
1194
1195 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
1196 show_dev_ino(__entry),
1197 (unsigned long long)__entry->pos,
1198 __entry->len,
1199 __entry->copied)
1200);
1201
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001202DECLARE_EVENT_CLASS(f2fs__page,
1203
1204 TP_PROTO(struct page *page, int type),
1205
1206 TP_ARGS(page, type),
1207
1208 TP_STRUCT__entry(
1209 __field(dev_t, dev)
1210 __field(ino_t, ino)
1211 __field(int, type)
1212 __field(int, dir)
1213 __field(pgoff_t, index)
1214 __field(int, dirty)
Chao Yuc20e89c2014-05-06 16:53:08 +08001215 __field(int, uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001216 ),
1217
1218 TP_fast_assign(
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001219 __entry->dev = page_file_mapping(page)->host->i_sb->s_dev;
1220 __entry->ino = page_file_mapping(page)->host->i_ino;
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001221 __entry->type = type;
Jaegeuk Kim4969c062019-07-01 19:15:29 -07001222 __entry->dir =
1223 S_ISDIR(page_file_mapping(page)->host->i_mode);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001224 __entry->index = page->index;
1225 __entry->dirty = PageDirty(page);
Chao Yuc20e89c2014-05-06 16:53:08 +08001226 __entry->uptodate = PageUptodate(page);
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001227 ),
1228
Chao Yuc20e89c2014-05-06 16:53:08 +08001229 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
1230 "dirty = %d, uptodate = %d",
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001231 show_dev_ino(__entry),
1232 show_block_type(__entry->type),
1233 show_file_type(__entry->dir),
1234 (unsigned long)__entry->index,
Chao Yuc20e89c2014-05-06 16:53:08 +08001235 __entry->dirty,
1236 __entry->uptodate)
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001237);
1238
Chao Yuecda0de2014-05-06 16:48:26 +08001239DEFINE_EVENT(f2fs__page, f2fs_writepage,
1240
1241 TP_PROTO(struct page *page, int type),
1242
1243 TP_ARGS(page, type)
1244);
1245
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -07001246DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
1247
1248 TP_PROTO(struct page *page, int type),
1249
1250 TP_ARGS(page, type)
1251);
1252
Chao Yuc20e89c2014-05-06 16:53:08 +08001253DEFINE_EVENT(f2fs__page, f2fs_readpage,
1254
1255 TP_PROTO(struct page *page, int type),
1256
1257 TP_ARGS(page, type)
1258);
1259
Jaegeuk Kim26c6b882013-10-24 17:53:29 +09001260DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
1261
1262 TP_PROTO(struct page *page, int type),
1263
1264 TP_ARGS(page, type)
1265);
1266
Jaegeuk Kime943a102013-10-25 14:26:31 +09001267DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
1268
1269 TP_PROTO(struct page *page, int type),
1270
1271 TP_ARGS(page, type)
1272);
1273
Jaegeuk Kim8ce67cb2015-03-17 17:58:08 -07001274DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
1275
1276 TP_PROTO(struct page *page, int type),
1277
1278 TP_ARGS(page, type)
1279);
1280
1281DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
1282
1283 TP_PROTO(struct page *page, int type),
1284
1285 TP_ARGS(page, type)
1286);
1287
Chao Yud7648342019-04-15 15:22:19 +08001288TRACE_EVENT(f2fs_filemap_fault,
1289
1290 TP_PROTO(struct inode *inode, pgoff_t index, unsigned long ret),
1291
1292 TP_ARGS(inode, index, ret),
1293
1294 TP_STRUCT__entry(
1295 __field(dev_t, dev)
1296 __field(ino_t, ino)
1297 __field(pgoff_t, index)
1298 __field(unsigned long, ret)
1299 ),
1300
1301 TP_fast_assign(
1302 __entry->dev = inode->i_sb->s_dev;
1303 __entry->ino = inode->i_ino;
1304 __entry->index = index;
1305 __entry->ret = ret;
1306 ),
1307
1308 TP_printk("dev = (%d,%d), ino = %lu, index = %lu, ret = %lx",
1309 show_dev_ino(__entry),
1310 (unsigned long)__entry->index,
1311 __entry->ret)
1312);
1313
Chao Yue5748432014-05-06 16:51:24 +08001314TRACE_EVENT(f2fs_writepages,
1315
1316 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
1317
1318 TP_ARGS(inode, wbc, type),
1319
1320 TP_STRUCT__entry(
1321 __field(dev_t, dev)
1322 __field(ino_t, ino)
1323 __field(int, type)
1324 __field(int, dir)
1325 __field(long, nr_to_write)
1326 __field(long, pages_skipped)
1327 __field(loff_t, range_start)
1328 __field(loff_t, range_end)
1329 __field(pgoff_t, writeback_index)
1330 __field(int, sync_mode)
1331 __field(char, for_kupdate)
1332 __field(char, for_background)
1333 __field(char, tagged_writepages)
1334 __field(char, for_reclaim)
1335 __field(char, range_cyclic)
1336 __field(char, for_sync)
1337 ),
1338
1339 TP_fast_assign(
1340 __entry->dev = inode->i_sb->s_dev;
1341 __entry->ino = inode->i_ino;
1342 __entry->type = type;
1343 __entry->dir = S_ISDIR(inode->i_mode);
1344 __entry->nr_to_write = wbc->nr_to_write;
1345 __entry->pages_skipped = wbc->pages_skipped;
1346 __entry->range_start = wbc->range_start;
1347 __entry->range_end = wbc->range_end;
1348 __entry->writeback_index = inode->i_mapping->writeback_index;
1349 __entry->sync_mode = wbc->sync_mode;
1350 __entry->for_kupdate = wbc->for_kupdate;
1351 __entry->for_background = wbc->for_background;
1352 __entry->tagged_writepages = wbc->tagged_writepages;
1353 __entry->for_reclaim = wbc->for_reclaim;
1354 __entry->range_cyclic = wbc->range_cyclic;
1355 __entry->for_sync = wbc->for_sync;
1356 ),
1357
1358 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1359 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1360 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1361 show_dev_ino(__entry),
1362 show_block_type(__entry->type),
1363 show_file_type(__entry->dir),
1364 __entry->nr_to_write,
1365 __entry->pages_skipped,
1366 __entry->range_start,
1367 __entry->range_end,
1368 (unsigned long)__entry->writeback_index,
1369 __entry->sync_mode,
1370 __entry->for_kupdate,
1371 __entry->for_background,
1372 __entry->tagged_writepages,
1373 __entry->for_reclaim,
1374 __entry->range_cyclic,
1375 __entry->for_sync)
1376);
1377
Chao Yub8c29402015-10-12 17:02:26 +08001378TRACE_EVENT(f2fs_readpages,
1379
1380 TP_PROTO(struct inode *inode, struct page *page, unsigned int nrpage),
1381
1382 TP_ARGS(inode, page, nrpage),
1383
1384 TP_STRUCT__entry(
1385 __field(dev_t, dev)
1386 __field(ino_t, ino)
1387 __field(pgoff_t, start)
1388 __field(unsigned int, nrpage)
1389 ),
1390
1391 TP_fast_assign(
1392 __entry->dev = inode->i_sb->s_dev;
1393 __entry->ino = inode->i_ino;
1394 __entry->start = page->index;
1395 __entry->nrpage = nrpage;
1396 ),
1397
1398 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1399 show_dev_ino(__entry),
1400 (unsigned long)__entry->start,
1401 __entry->nrpage)
1402);
1403
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001404TRACE_EVENT(f2fs_write_checkpoint,
1405
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001406 TP_PROTO(struct super_block *sb, int reason, char *msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001407
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001408 TP_ARGS(sb, reason, msg),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001409
1410 TP_STRUCT__entry(
1411 __field(dev_t, dev)
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001412 __field(int, reason)
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001413 __field(char *, msg)
1414 ),
1415
1416 TP_fast_assign(
1417 __entry->dev = sb->s_dev;
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001418 __entry->reason = reason;
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001419 __entry->msg = msg;
1420 ),
1421
1422 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001423 show_dev(__entry->dev),
Jaegeuk Kim75ab4cb2014-09-20 21:57:51 -07001424 show_cpreason(__entry->reason),
Namjae Jeon2af4bd62013-04-23 18:26:54 +09001425 __entry->msg)
1426);
1427
Chao Yu0243a5f2017-04-15 14:09:38 +08001428DECLARE_EVENT_CLASS(f2fs_discard,
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001429
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001430 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001431
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001432 TP_ARGS(dev, blkstart, blklen),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001433
1434 TP_STRUCT__entry(
1435 __field(dev_t, dev)
1436 __field(block_t, blkstart)
1437 __field(block_t, blklen)
1438 ),
1439
1440 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001441 __entry->dev = dev->bd_dev;
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001442 __entry->blkstart = blkstart;
1443 __entry->blklen = blklen;
1444 ),
1445
1446 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001447 show_dev(__entry->dev),
Jaegeuk Kim1661d072013-11-12 17:01:00 +09001448 (unsigned long long)__entry->blkstart,
1449 (unsigned long long)__entry->blklen)
1450);
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001451
Chao Yu0243a5f2017-04-15 14:09:38 +08001452DEFINE_EVENT(f2fs_discard, f2fs_queue_discard,
1453
1454 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1455
1456 TP_ARGS(dev, blkstart, blklen)
1457);
1458
1459DEFINE_EVENT(f2fs_discard, f2fs_issue_discard,
1460
1461 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1462
1463 TP_ARGS(dev, blkstart, blklen)
1464);
1465
Chao Yu2ec6f2e2017-10-04 09:08:36 +08001466DEFINE_EVENT(f2fs_discard, f2fs_remove_discard,
1467
1468 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1469
1470 TP_ARGS(dev, blkstart, blklen)
1471);
1472
Damien Le Moal126606c2016-10-28 17:45:07 +09001473TRACE_EVENT(f2fs_issue_reset_zone,
1474
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001475 TP_PROTO(struct block_device *dev, block_t blkstart),
Damien Le Moal126606c2016-10-28 17:45:07 +09001476
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001477 TP_ARGS(dev, blkstart),
Damien Le Moal126606c2016-10-28 17:45:07 +09001478
1479 TP_STRUCT__entry(
1480 __field(dev_t, dev)
1481 __field(block_t, blkstart)
1482 ),
1483
1484 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001485 __entry->dev = dev->bd_dev;
Damien Le Moal126606c2016-10-28 17:45:07 +09001486 __entry->blkstart = blkstart;
1487 ),
1488
1489 TP_printk("dev = (%d,%d), reset zone at block = 0x%llx",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001490 show_dev(__entry->dev),
Damien Le Moal126606c2016-10-28 17:45:07 +09001491 (unsigned long long)__entry->blkstart)
1492);
1493
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001494TRACE_EVENT(f2fs_issue_flush,
1495
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001496 TP_PROTO(struct block_device *dev, unsigned int nobarrier,
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001497 unsigned int flush_merge, int ret),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001498
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001499 TP_ARGS(dev, nobarrier, flush_merge, ret),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001500
1501 TP_STRUCT__entry(
1502 __field(dev_t, dev)
Jaegeuk Kim29e70432015-02-10 16:23:12 -08001503 __field(unsigned int, nobarrier)
1504 __field(unsigned int, flush_merge)
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001505 __field(int, ret)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001506 ),
1507
1508 TP_fast_assign(
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001509 __entry->dev = dev->bd_dev;
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001510 __entry->nobarrier = nobarrier;
1511 __entry->flush_merge = flush_merge;
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001512 __entry->ret = ret;
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001513 ),
1514
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001515 TP_printk("dev = (%d,%d), %s %s, ret = %d",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001516 show_dev(__entry->dev),
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001517 __entry->nobarrier ? "skip (nobarrier)" : "issue",
Kinglong Mee20fda56b2017-03-04 22:13:10 +08001518 __entry->flush_merge ? " with flush_merge" : "",
1519 __entry->ret)
Jaegeuk Kim24a9ee02014-07-25 17:46:10 -07001520);
Chao Yu1ec46102015-02-05 17:59:59 +08001521
1522TRACE_EVENT(f2fs_lookup_extent_tree_start,
1523
1524 TP_PROTO(struct inode *inode, unsigned int pgofs),
1525
1526 TP_ARGS(inode, pgofs),
1527
1528 TP_STRUCT__entry(
1529 __field(dev_t, dev)
1530 __field(ino_t, ino)
1531 __field(unsigned int, pgofs)
1532 ),
1533
1534 TP_fast_assign(
1535 __entry->dev = inode->i_sb->s_dev;
1536 __entry->ino = inode->i_ino;
1537 __entry->pgofs = pgofs;
1538 ),
1539
1540 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1541 show_dev_ino(__entry),
1542 __entry->pgofs)
1543);
1544
1545TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1546
1547 TP_PROTO(struct inode *inode, unsigned int pgofs,
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001548 struct extent_info *ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001549
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001550 TP_ARGS(inode, pgofs, ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001551
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001552 TP_CONDITION(ei),
Chao Yu1ec46102015-02-05 17:59:59 +08001553
1554 TP_STRUCT__entry(
1555 __field(dev_t, dev)
1556 __field(ino_t, ino)
1557 __field(unsigned int, pgofs)
1558 __field(unsigned int, fofs)
1559 __field(u32, blk)
1560 __field(unsigned int, len)
1561 ),
1562
1563 TP_fast_assign(
1564 __entry->dev = inode->i_sb->s_dev;
1565 __entry->ino = inode->i_ino;
1566 __entry->pgofs = pgofs;
Jaegeuk Kim84bc9262015-06-29 16:01:14 -07001567 __entry->fofs = ei->fofs;
1568 __entry->blk = ei->blk;
1569 __entry->len = ei->len;
Chao Yu1ec46102015-02-05 17:59:59 +08001570 ),
1571
1572 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1573 "ext_info(fofs: %u, blk: %u, len: %u)",
1574 show_dev_ino(__entry),
1575 __entry->pgofs,
1576 __entry->fofs,
1577 __entry->blk,
1578 __entry->len)
1579);
1580
Chao Yu744288c2015-09-06 17:50:13 +08001581TRACE_EVENT(f2fs_update_extent_tree_range,
Chao Yu1ec46102015-02-05 17:59:59 +08001582
Chao Yu744288c2015-09-06 17:50:13 +08001583 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1584 unsigned int len),
Chao Yu1ec46102015-02-05 17:59:59 +08001585
Chao Yu744288c2015-09-06 17:50:13 +08001586 TP_ARGS(inode, pgofs, blkaddr, len),
Chao Yu1ec46102015-02-05 17:59:59 +08001587
1588 TP_STRUCT__entry(
1589 __field(dev_t, dev)
1590 __field(ino_t, ino)
1591 __field(unsigned int, pgofs)
1592 __field(u32, blk)
Chao Yu744288c2015-09-06 17:50:13 +08001593 __field(unsigned int, len)
Chao Yu1ec46102015-02-05 17:59:59 +08001594 ),
1595
1596 TP_fast_assign(
1597 __entry->dev = inode->i_sb->s_dev;
1598 __entry->ino = inode->i_ino;
1599 __entry->pgofs = pgofs;
1600 __entry->blk = blkaddr;
Chao Yu744288c2015-09-06 17:50:13 +08001601 __entry->len = len;
Chao Yu1ec46102015-02-05 17:59:59 +08001602 ),
1603
Chao Yu744288c2015-09-06 17:50:13 +08001604 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1605 "blkaddr = %u, len = %u",
Chao Yu1ec46102015-02-05 17:59:59 +08001606 show_dev_ino(__entry),
1607 __entry->pgofs,
Chao Yu744288c2015-09-06 17:50:13 +08001608 __entry->blk,
1609 __entry->len)
Chao Yu1ec46102015-02-05 17:59:59 +08001610);
1611
1612TRACE_EVENT(f2fs_shrink_extent_tree,
1613
1614 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1615 unsigned int tree_cnt),
1616
1617 TP_ARGS(sbi, node_cnt, tree_cnt),
1618
1619 TP_STRUCT__entry(
1620 __field(dev_t, dev)
1621 __field(unsigned int, node_cnt)
1622 __field(unsigned int, tree_cnt)
1623 ),
1624
1625 TP_fast_assign(
1626 __entry->dev = sbi->sb->s_dev;
1627 __entry->node_cnt = node_cnt;
1628 __entry->tree_cnt = tree_cnt;
1629 ),
1630
1631 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001632 show_dev(__entry->dev),
Chao Yu1ec46102015-02-05 17:59:59 +08001633 __entry->node_cnt,
1634 __entry->tree_cnt)
1635);
1636
1637TRACE_EVENT(f2fs_destroy_extent_tree,
1638
1639 TP_PROTO(struct inode *inode, unsigned int node_cnt),
1640
1641 TP_ARGS(inode, node_cnt),
1642
1643 TP_STRUCT__entry(
1644 __field(dev_t, dev)
1645 __field(ino_t, ino)
1646 __field(unsigned int, node_cnt)
1647 ),
1648
1649 TP_fast_assign(
1650 __entry->dev = inode->i_sb->s_dev;
1651 __entry->ino = inode->i_ino;
1652 __entry->node_cnt = node_cnt;
1653 ),
1654
1655 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1656 show_dev_ino(__entry),
1657 __entry->node_cnt)
1658);
1659
Chao Yu4cf18532015-12-17 17:17:16 +08001660DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
1661
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001662 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001663
1664 TP_ARGS(sb, type, count),
1665
1666 TP_STRUCT__entry(
1667 __field(dev_t, dev)
1668 __field(int, type)
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001669 __field(s64, count)
Chao Yu4cf18532015-12-17 17:17:16 +08001670 ),
1671
1672 TP_fast_assign(
1673 __entry->dev = sb->s_dev;
1674 __entry->type = type;
1675 __entry->count = count;
1676 ),
1677
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001678 TP_printk("dev = (%d,%d), %s, dirty count = %lld",
Jaegeuk Kimd50aaee2017-02-15 11:14:06 -08001679 show_dev(__entry->dev),
Chao Yu4cf18532015-12-17 17:17:16 +08001680 show_file_type(__entry->type),
1681 __entry->count)
1682);
1683
1684DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
1685
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001686 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001687
1688 TP_ARGS(sb, type, count)
1689);
1690
1691DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
1692
Jaegeuk Kim523be8a2016-05-13 12:36:58 -07001693 TP_PROTO(struct super_block *sb, int type, s64 count),
Chao Yu4cf18532015-12-17 17:17:16 +08001694
1695 TP_ARGS(sb, type, count)
1696);
1697
Chao Yu559e87c2019-02-26 19:01:15 +08001698TRACE_EVENT(f2fs_shutdown,
1699
1700 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int mode, int ret),
1701
1702 TP_ARGS(sbi, mode, ret),
1703
1704 TP_STRUCT__entry(
1705 __field(dev_t, dev)
1706 __field(unsigned int, mode)
1707 __field(int, ret)
1708 ),
1709
1710 TP_fast_assign(
1711 __entry->dev = sbi->sb->s_dev;
1712 __entry->mode = mode;
1713 __entry->ret = ret;
1714 ),
1715
1716 TP_printk("dev = (%d,%d), mode: %s, ret:%d",
1717 show_dev(__entry->dev),
1718 show_shutdown_mode(__entry->mode),
1719 __entry->ret)
1720);
1721
Namjae Jeona2a4a7e2013-04-20 01:28:40 +09001722#endif /* _TRACE_F2FS_H */
1723
1724 /* This part must be outside protection */
1725#include <trace/define_trace.h>