Linux 4.1.18
[linux/fpc-iii.git] / include / trace / events / f2fs.h
blobe202dec22e1dd14aaae4a76d7d807d4d7f9a3e7a
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM f2fs
4 #if !defined(_TRACE_F2FS_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_F2FS_H
7 #include <linux/tracepoint.h>
9 #define show_dev(entry) MAJOR(entry->dev), MINOR(entry->dev)
10 #define show_dev_ino(entry) show_dev(entry), (unsigned long)entry->ino
12 TRACE_DEFINE_ENUM(NODE);
13 TRACE_DEFINE_ENUM(DATA);
14 TRACE_DEFINE_ENUM(META);
15 TRACE_DEFINE_ENUM(META_FLUSH);
16 TRACE_DEFINE_ENUM(CURSEG_HOT_DATA);
17 TRACE_DEFINE_ENUM(CURSEG_WARM_DATA);
18 TRACE_DEFINE_ENUM(CURSEG_COLD_DATA);
19 TRACE_DEFINE_ENUM(CURSEG_HOT_NODE);
20 TRACE_DEFINE_ENUM(CURSEG_WARM_NODE);
21 TRACE_DEFINE_ENUM(CURSEG_COLD_NODE);
22 TRACE_DEFINE_ENUM(NO_CHECK_TYPE);
23 TRACE_DEFINE_ENUM(GC_GREEDY);
24 TRACE_DEFINE_ENUM(GC_CB);
25 TRACE_DEFINE_ENUM(FG_GC);
26 TRACE_DEFINE_ENUM(BG_GC);
27 TRACE_DEFINE_ENUM(LFS);
28 TRACE_DEFINE_ENUM(SSR);
29 TRACE_DEFINE_ENUM(__REQ_RAHEAD);
30 TRACE_DEFINE_ENUM(__REQ_WRITE);
31 TRACE_DEFINE_ENUM(__REQ_SYNC);
32 TRACE_DEFINE_ENUM(__REQ_NOIDLE);
33 TRACE_DEFINE_ENUM(__REQ_FLUSH);
34 TRACE_DEFINE_ENUM(__REQ_FUA);
35 TRACE_DEFINE_ENUM(__REQ_PRIO);
36 TRACE_DEFINE_ENUM(__REQ_META);
37 TRACE_DEFINE_ENUM(CP_UMOUNT);
38 TRACE_DEFINE_ENUM(CP_FASTBOOT);
39 TRACE_DEFINE_ENUM(CP_SYNC);
40 TRACE_DEFINE_ENUM(CP_DISCARD);
42 #define show_block_type(type) \
43 __print_symbolic(type, \
44 { NODE, "NODE" }, \
45 { DATA, "DATA" }, \
46 { META, "META" }, \
47 { META_FLUSH, "META_FLUSH" }, \
48 { INMEM, "INMEM" }, \
49 { INMEM_DROP, "INMEM_DROP" }, \
50 { IPU, "IN-PLACE" }, \
51 { OPU, "OUT-OF-PLACE" })
53 #define F2FS_BIO_MASK(t) (t & (READA | WRITE_FLUSH_FUA))
54 #define F2FS_BIO_EXTRA_MASK(t) (t & (REQ_META | REQ_PRIO))
56 #define show_bio_type(type) show_bio_base(type), show_bio_extra(type)
58 #define show_bio_base(type) \
59 __print_symbolic(F2FS_BIO_MASK(type), \
60 { READ, "READ" }, \
61 { READA, "READAHEAD" }, \
62 { READ_SYNC, "READ_SYNC" }, \
63 { WRITE, "WRITE" }, \
64 { WRITE_SYNC, "WRITE_SYNC" }, \
65 { WRITE_FLUSH, "WRITE_FLUSH" }, \
66 { WRITE_FUA, "WRITE_FUA" }, \
67 { WRITE_FLUSH_FUA, "WRITE_FLUSH_FUA" })
69 #define show_bio_extra(type) \
70 __print_symbolic(F2FS_BIO_EXTRA_MASK(type), \
71 { REQ_META, "(M)" }, \
72 { REQ_PRIO, "(P)" }, \
73 { REQ_META | REQ_PRIO, "(MP)" }, \
74 { 0, " \b" })
76 #define show_data_type(type) \
77 __print_symbolic(type, \
78 { CURSEG_HOT_DATA, "Hot DATA" }, \
79 { CURSEG_WARM_DATA, "Warm DATA" }, \
80 { CURSEG_COLD_DATA, "Cold DATA" }, \
81 { CURSEG_HOT_NODE, "Hot NODE" }, \
82 { CURSEG_WARM_NODE, "Warm NODE" }, \
83 { CURSEG_COLD_NODE, "Cold NODE" }, \
84 { NO_CHECK_TYPE, "No TYPE" })
86 #define show_file_type(type) \
87 __print_symbolic(type, \
88 { 0, "FILE" }, \
89 { 1, "DIR" })
91 #define show_gc_type(type) \
92 __print_symbolic(type, \
93 { FG_GC, "Foreground GC" }, \
94 { BG_GC, "Background GC" })
96 #define show_alloc_mode(type) \
97 __print_symbolic(type, \
98 { LFS, "LFS-mode" }, \
99 { SSR, "SSR-mode" })
101 #define show_victim_policy(type) \
102 __print_symbolic(type, \
103 { GC_GREEDY, "Greedy" }, \
104 { GC_CB, "Cost-Benefit" })
106 #define show_cpreason(type) \
107 __print_symbolic(type, \
108 { CP_UMOUNT, "Umount" }, \
109 { CP_FASTBOOT, "Fastboot" }, \
110 { CP_SYNC, "Sync" }, \
111 { CP_RECOVERY, "Recovery" }, \
112 { CP_DISCARD, "Discard" })
114 struct victim_sel_policy;
116 DECLARE_EVENT_CLASS(f2fs__inode,
118 TP_PROTO(struct inode *inode),
120 TP_ARGS(inode),
122 TP_STRUCT__entry(
123 __field(dev_t, dev)
124 __field(ino_t, ino)
125 __field(ino_t, pino)
126 __field(umode_t, mode)
127 __field(loff_t, size)
128 __field(unsigned int, nlink)
129 __field(blkcnt_t, blocks)
130 __field(__u8, advise)
133 TP_fast_assign(
134 __entry->dev = inode->i_sb->s_dev;
135 __entry->ino = inode->i_ino;
136 __entry->pino = F2FS_I(inode)->i_pino;
137 __entry->mode = inode->i_mode;
138 __entry->nlink = inode->i_nlink;
139 __entry->size = inode->i_size;
140 __entry->blocks = inode->i_blocks;
141 __entry->advise = F2FS_I(inode)->i_advise;
144 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
145 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
146 show_dev_ino(__entry),
147 (unsigned long)__entry->pino,
148 __entry->mode,
149 __entry->size,
150 (unsigned int)__entry->nlink,
151 (unsigned long long)__entry->blocks,
152 (unsigned char)__entry->advise)
155 DECLARE_EVENT_CLASS(f2fs__inode_exit,
157 TP_PROTO(struct inode *inode, int ret),
159 TP_ARGS(inode, ret),
161 TP_STRUCT__entry(
162 __field(dev_t, dev)
163 __field(ino_t, ino)
164 __field(int, ret)
167 TP_fast_assign(
168 __entry->dev = inode->i_sb->s_dev;
169 __entry->ino = inode->i_ino;
170 __entry->ret = ret;
173 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
174 show_dev_ino(__entry),
175 __entry->ret)
178 DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
180 TP_PROTO(struct inode *inode),
182 TP_ARGS(inode)
185 TRACE_EVENT(f2fs_sync_file_exit,
187 TP_PROTO(struct inode *inode, int need_cp, int datasync, int ret),
189 TP_ARGS(inode, need_cp, datasync, ret),
191 TP_STRUCT__entry(
192 __field(dev_t, dev)
193 __field(ino_t, ino)
194 __field(int, need_cp)
195 __field(int, datasync)
196 __field(int, ret)
199 TP_fast_assign(
200 __entry->dev = inode->i_sb->s_dev;
201 __entry->ino = inode->i_ino;
202 __entry->need_cp = need_cp;
203 __entry->datasync = datasync;
204 __entry->ret = ret;
207 TP_printk("dev = (%d,%d), ino = %lu, checkpoint is %s, "
208 "datasync = %d, ret = %d",
209 show_dev_ino(__entry),
210 __entry->need_cp ? "needed" : "not needed",
211 __entry->datasync,
212 __entry->ret)
215 TRACE_EVENT(f2fs_sync_fs,
217 TP_PROTO(struct super_block *sb, int wait),
219 TP_ARGS(sb, wait),
221 TP_STRUCT__entry(
222 __field(dev_t, dev)
223 __field(int, dirty)
224 __field(int, wait)
227 TP_fast_assign(
228 __entry->dev = sb->s_dev;
229 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
230 __entry->wait = wait;
233 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
234 show_dev(__entry),
235 __entry->dirty ? "dirty" : "not dirty",
236 __entry->wait)
239 DEFINE_EVENT(f2fs__inode, f2fs_iget,
241 TP_PROTO(struct inode *inode),
243 TP_ARGS(inode)
246 DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
248 TP_PROTO(struct inode *inode, int ret),
250 TP_ARGS(inode, ret)
253 DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
255 TP_PROTO(struct inode *inode),
257 TP_ARGS(inode)
260 DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
262 TP_PROTO(struct inode *inode, int ret),
264 TP_ARGS(inode, ret)
267 TRACE_EVENT(f2fs_unlink_enter,
269 TP_PROTO(struct inode *dir, struct dentry *dentry),
271 TP_ARGS(dir, dentry),
273 TP_STRUCT__entry(
274 __field(dev_t, dev)
275 __field(ino_t, ino)
276 __field(loff_t, size)
277 __field(blkcnt_t, blocks)
278 __field(const char *, name)
281 TP_fast_assign(
282 __entry->dev = dir->i_sb->s_dev;
283 __entry->ino = dir->i_ino;
284 __entry->size = dir->i_size;
285 __entry->blocks = dir->i_blocks;
286 __entry->name = dentry->d_name.name;
289 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
290 "i_blocks = %llu, name = %s",
291 show_dev_ino(__entry),
292 __entry->size,
293 (unsigned long long)__entry->blocks,
294 __entry->name)
297 DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
299 TP_PROTO(struct inode *inode, int ret),
301 TP_ARGS(inode, ret)
304 DEFINE_EVENT(f2fs__inode, f2fs_truncate,
306 TP_PROTO(struct inode *inode),
308 TP_ARGS(inode)
311 TRACE_EVENT(f2fs_truncate_data_blocks_range,
313 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
315 TP_ARGS(inode, nid, ofs, free),
317 TP_STRUCT__entry(
318 __field(dev_t, dev)
319 __field(ino_t, ino)
320 __field(nid_t, nid)
321 __field(unsigned int, ofs)
322 __field(int, free)
325 TP_fast_assign(
326 __entry->dev = inode->i_sb->s_dev;
327 __entry->ino = inode->i_ino;
328 __entry->nid = nid;
329 __entry->ofs = ofs;
330 __entry->free = free;
333 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
334 show_dev_ino(__entry),
335 (unsigned int)__entry->nid,
336 __entry->ofs,
337 __entry->free)
340 DECLARE_EVENT_CLASS(f2fs__truncate_op,
342 TP_PROTO(struct inode *inode, u64 from),
344 TP_ARGS(inode, from),
346 TP_STRUCT__entry(
347 __field(dev_t, dev)
348 __field(ino_t, ino)
349 __field(loff_t, size)
350 __field(blkcnt_t, blocks)
351 __field(u64, from)
354 TP_fast_assign(
355 __entry->dev = inode->i_sb->s_dev;
356 __entry->ino = inode->i_ino;
357 __entry->size = inode->i_size;
358 __entry->blocks = inode->i_blocks;
359 __entry->from = from;
362 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
363 "start file offset = %llu",
364 show_dev_ino(__entry),
365 __entry->size,
366 (unsigned long long)__entry->blocks,
367 (unsigned long long)__entry->from)
370 DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
372 TP_PROTO(struct inode *inode, u64 from),
374 TP_ARGS(inode, from)
377 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
379 TP_PROTO(struct inode *inode, int ret),
381 TP_ARGS(inode, ret)
384 DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
386 TP_PROTO(struct inode *inode, u64 from),
388 TP_ARGS(inode, from)
391 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
393 TP_PROTO(struct inode *inode, int ret),
395 TP_ARGS(inode, ret)
398 DECLARE_EVENT_CLASS(f2fs__truncate_node,
400 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
402 TP_ARGS(inode, nid, blk_addr),
404 TP_STRUCT__entry(
405 __field(dev_t, dev)
406 __field(ino_t, ino)
407 __field(nid_t, nid)
408 __field(block_t, blk_addr)
411 TP_fast_assign(
412 __entry->dev = inode->i_sb->s_dev;
413 __entry->ino = inode->i_ino;
414 __entry->nid = nid;
415 __entry->blk_addr = blk_addr;
418 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
419 show_dev_ino(__entry),
420 (unsigned int)__entry->nid,
421 (unsigned long long)__entry->blk_addr)
424 DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
426 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
428 TP_ARGS(inode, nid, blk_addr)
431 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
433 TP_PROTO(struct inode *inode, int ret),
435 TP_ARGS(inode, ret)
438 DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
440 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
442 TP_ARGS(inode, nid, blk_addr)
445 TRACE_EVENT(f2fs_truncate_partial_nodes,
447 TP_PROTO(struct inode *inode, nid_t nid[], int depth, int err),
449 TP_ARGS(inode, nid, depth, err),
451 TP_STRUCT__entry(
452 __field(dev_t, dev)
453 __field(ino_t, ino)
454 __field(nid_t, nid[3])
455 __field(int, depth)
456 __field(int, err)
459 TP_fast_assign(
460 __entry->dev = inode->i_sb->s_dev;
461 __entry->ino = inode->i_ino;
462 __entry->nid[0] = nid[0];
463 __entry->nid[1] = nid[1];
464 __entry->nid[2] = nid[2];
465 __entry->depth = depth;
466 __entry->err = err;
469 TP_printk("dev = (%d,%d), ino = %lu, "
470 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
471 show_dev_ino(__entry),
472 (unsigned int)__entry->nid[0],
473 (unsigned int)__entry->nid[1],
474 (unsigned int)__entry->nid[2],
475 __entry->depth,
476 __entry->err)
479 TRACE_EVENT(f2fs_get_data_block,
480 TP_PROTO(struct inode *inode, sector_t iblock,
481 struct buffer_head *bh, int ret),
483 TP_ARGS(inode, iblock, bh, ret),
485 TP_STRUCT__entry(
486 __field(dev_t, dev)
487 __field(ino_t, ino)
488 __field(sector_t, iblock)
489 __field(sector_t, bh_start)
490 __field(size_t, bh_size)
491 __field(int, ret)
494 TP_fast_assign(
495 __entry->dev = inode->i_sb->s_dev;
496 __entry->ino = inode->i_ino;
497 __entry->iblock = iblock;
498 __entry->bh_start = bh->b_blocknr;
499 __entry->bh_size = bh->b_size;
500 __entry->ret = ret;
503 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
504 "start blkaddr = 0x%llx, len = 0x%llx bytes, err = %d",
505 show_dev_ino(__entry),
506 (unsigned long long)__entry->iblock,
507 (unsigned long long)__entry->bh_start,
508 (unsigned long long)__entry->bh_size,
509 __entry->ret)
512 TRACE_EVENT(f2fs_get_victim,
514 TP_PROTO(struct super_block *sb, int type, int gc_type,
515 struct victim_sel_policy *p, unsigned int pre_victim,
516 unsigned int prefree, unsigned int free),
518 TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
520 TP_STRUCT__entry(
521 __field(dev_t, dev)
522 __field(int, type)
523 __field(int, gc_type)
524 __field(int, alloc_mode)
525 __field(int, gc_mode)
526 __field(unsigned int, victim)
527 __field(unsigned int, ofs_unit)
528 __field(unsigned int, pre_victim)
529 __field(unsigned int, prefree)
530 __field(unsigned int, free)
533 TP_fast_assign(
534 __entry->dev = sb->s_dev;
535 __entry->type = type;
536 __entry->gc_type = gc_type;
537 __entry->alloc_mode = p->alloc_mode;
538 __entry->gc_mode = p->gc_mode;
539 __entry->victim = p->min_segno;
540 __entry->ofs_unit = p->ofs_unit;
541 __entry->pre_victim = pre_victim;
542 __entry->prefree = prefree;
543 __entry->free = free;
546 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), victim = %u "
547 "ofs_unit = %u, pre_victim_secno = %d, prefree = %u, free = %u",
548 show_dev(__entry),
549 show_data_type(__entry->type),
550 show_gc_type(__entry->gc_type),
551 show_alloc_mode(__entry->alloc_mode),
552 show_victim_policy(__entry->gc_mode),
553 __entry->victim,
554 __entry->ofs_unit,
555 (int)__entry->pre_victim,
556 __entry->prefree,
557 __entry->free)
560 TRACE_EVENT(f2fs_fallocate,
562 TP_PROTO(struct inode *inode, int mode,
563 loff_t offset, loff_t len, int ret),
565 TP_ARGS(inode, mode, offset, len, ret),
567 TP_STRUCT__entry(
568 __field(dev_t, dev)
569 __field(ino_t, ino)
570 __field(int, mode)
571 __field(loff_t, offset)
572 __field(loff_t, len)
573 __field(loff_t, size)
574 __field(blkcnt_t, blocks)
575 __field(int, ret)
578 TP_fast_assign(
579 __entry->dev = inode->i_sb->s_dev;
580 __entry->ino = inode->i_ino;
581 __entry->mode = mode;
582 __entry->offset = offset;
583 __entry->len = len;
584 __entry->size = inode->i_size;
585 __entry->blocks = inode->i_blocks;
586 __entry->ret = ret;
589 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
590 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
591 show_dev_ino(__entry),
592 __entry->mode,
593 (unsigned long long)__entry->offset,
594 (unsigned long long)__entry->len,
595 (unsigned long long)__entry->size,
596 (unsigned long long)__entry->blocks,
597 __entry->ret)
600 TRACE_EVENT(f2fs_direct_IO_enter,
602 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
604 TP_ARGS(inode, offset, len, rw),
606 TP_STRUCT__entry(
607 __field(dev_t, dev)
608 __field(ino_t, ino)
609 __field(loff_t, pos)
610 __field(unsigned long, len)
611 __field(int, rw)
614 TP_fast_assign(
615 __entry->dev = inode->i_sb->s_dev;
616 __entry->ino = inode->i_ino;
617 __entry->pos = offset;
618 __entry->len = len;
619 __entry->rw = rw;
622 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
623 show_dev_ino(__entry),
624 __entry->pos,
625 __entry->len,
626 __entry->rw)
629 TRACE_EVENT(f2fs_direct_IO_exit,
631 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
632 int rw, int ret),
634 TP_ARGS(inode, offset, len, rw, ret),
636 TP_STRUCT__entry(
637 __field(dev_t, dev)
638 __field(ino_t, ino)
639 __field(loff_t, pos)
640 __field(unsigned long, len)
641 __field(int, rw)
642 __field(int, ret)
645 TP_fast_assign(
646 __entry->dev = inode->i_sb->s_dev;
647 __entry->ino = inode->i_ino;
648 __entry->pos = offset;
649 __entry->len = len;
650 __entry->rw = rw;
651 __entry->ret = ret;
654 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
655 "rw = %d ret = %d",
656 show_dev_ino(__entry),
657 __entry->pos,
658 __entry->len,
659 __entry->rw,
660 __entry->ret)
663 TRACE_EVENT(f2fs_reserve_new_block,
665 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node),
667 TP_ARGS(inode, nid, ofs_in_node),
669 TP_STRUCT__entry(
670 __field(dev_t, dev)
671 __field(nid_t, nid)
672 __field(unsigned int, ofs_in_node)
675 TP_fast_assign(
676 __entry->dev = inode->i_sb->s_dev;
677 __entry->nid = nid;
678 __entry->ofs_in_node = ofs_in_node;
681 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u",
682 show_dev(__entry),
683 (unsigned int)__entry->nid,
684 __entry->ofs_in_node)
687 DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
689 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
691 TP_ARGS(page, fio),
693 TP_STRUCT__entry(
694 __field(dev_t, dev)
695 __field(ino_t, ino)
696 __field(pgoff_t, index)
697 __field(block_t, blkaddr)
698 __field(int, rw)
699 __field(int, type)
702 TP_fast_assign(
703 __entry->dev = page->mapping->host->i_sb->s_dev;
704 __entry->ino = page->mapping->host->i_ino;
705 __entry->index = page->index;
706 __entry->blkaddr = fio->blk_addr;
707 __entry->rw = fio->rw;
708 __entry->type = fio->type;
711 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
712 "blkaddr = 0x%llx, rw = %s%s, type = %s",
713 show_dev_ino(__entry),
714 (unsigned long)__entry->index,
715 (unsigned long long)__entry->blkaddr,
716 show_bio_type(__entry->rw),
717 show_block_type(__entry->type))
720 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
722 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
724 TP_ARGS(page, fio),
726 TP_CONDITION(page->mapping)
729 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_mbio,
731 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
733 TP_ARGS(page, fio),
735 TP_CONDITION(page->mapping)
738 DECLARE_EVENT_CLASS(f2fs__submit_bio,
740 TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
741 struct bio *bio),
743 TP_ARGS(sb, fio, bio),
745 TP_STRUCT__entry(
746 __field(dev_t, dev)
747 __field(int, rw)
748 __field(int, type)
749 __field(sector_t, sector)
750 __field(unsigned int, size)
753 TP_fast_assign(
754 __entry->dev = sb->s_dev;
755 __entry->rw = fio->rw;
756 __entry->type = fio->type;
757 __entry->sector = bio->bi_iter.bi_sector;
758 __entry->size = bio->bi_iter.bi_size;
761 TP_printk("dev = (%d,%d), %s%s, %s, sector = %lld, size = %u",
762 show_dev(__entry),
763 show_bio_type(__entry->rw),
764 show_block_type(__entry->type),
765 (unsigned long long)__entry->sector,
766 __entry->size)
769 DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_write_bio,
771 TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
772 struct bio *bio),
774 TP_ARGS(sb, fio, bio),
776 TP_CONDITION(bio)
779 DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_read_bio,
781 TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
782 struct bio *bio),
784 TP_ARGS(sb, fio, bio),
786 TP_CONDITION(bio)
789 TRACE_EVENT(f2fs_write_begin,
791 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
792 unsigned int flags),
794 TP_ARGS(inode, pos, len, flags),
796 TP_STRUCT__entry(
797 __field(dev_t, dev)
798 __field(ino_t, ino)
799 __field(loff_t, pos)
800 __field(unsigned int, len)
801 __field(unsigned int, flags)
804 TP_fast_assign(
805 __entry->dev = inode->i_sb->s_dev;
806 __entry->ino = inode->i_ino;
807 __entry->pos = pos;
808 __entry->len = len;
809 __entry->flags = flags;
812 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
813 show_dev_ino(__entry),
814 (unsigned long long)__entry->pos,
815 __entry->len,
816 __entry->flags)
819 TRACE_EVENT(f2fs_write_end,
821 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
822 unsigned int copied),
824 TP_ARGS(inode, pos, len, copied),
826 TP_STRUCT__entry(
827 __field(dev_t, dev)
828 __field(ino_t, ino)
829 __field(loff_t, pos)
830 __field(unsigned int, len)
831 __field(unsigned int, copied)
834 TP_fast_assign(
835 __entry->dev = inode->i_sb->s_dev;
836 __entry->ino = inode->i_ino;
837 __entry->pos = pos;
838 __entry->len = len;
839 __entry->copied = copied;
842 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
843 show_dev_ino(__entry),
844 (unsigned long long)__entry->pos,
845 __entry->len,
846 __entry->copied)
849 DECLARE_EVENT_CLASS(f2fs__page,
851 TP_PROTO(struct page *page, int type),
853 TP_ARGS(page, type),
855 TP_STRUCT__entry(
856 __field(dev_t, dev)
857 __field(ino_t, ino)
858 __field(int, type)
859 __field(int, dir)
860 __field(pgoff_t, index)
861 __field(int, dirty)
862 __field(int, uptodate)
865 TP_fast_assign(
866 __entry->dev = page->mapping->host->i_sb->s_dev;
867 __entry->ino = page->mapping->host->i_ino;
868 __entry->type = type;
869 __entry->dir = S_ISDIR(page->mapping->host->i_mode);
870 __entry->index = page->index;
871 __entry->dirty = PageDirty(page);
872 __entry->uptodate = PageUptodate(page);
875 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
876 "dirty = %d, uptodate = %d",
877 show_dev_ino(__entry),
878 show_block_type(__entry->type),
879 show_file_type(__entry->dir),
880 (unsigned long)__entry->index,
881 __entry->dirty,
882 __entry->uptodate)
885 DEFINE_EVENT(f2fs__page, f2fs_writepage,
887 TP_PROTO(struct page *page, int type),
889 TP_ARGS(page, type)
892 DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
894 TP_PROTO(struct page *page, int type),
896 TP_ARGS(page, type)
899 DEFINE_EVENT(f2fs__page, f2fs_readpage,
901 TP_PROTO(struct page *page, int type),
903 TP_ARGS(page, type)
906 DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
908 TP_PROTO(struct page *page, int type),
910 TP_ARGS(page, type)
913 DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
915 TP_PROTO(struct page *page, int type),
917 TP_ARGS(page, type)
920 DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
922 TP_PROTO(struct page *page, int type),
924 TP_ARGS(page, type)
927 DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
929 TP_PROTO(struct page *page, int type),
931 TP_ARGS(page, type)
934 TRACE_EVENT(f2fs_writepages,
936 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
938 TP_ARGS(inode, wbc, type),
940 TP_STRUCT__entry(
941 __field(dev_t, dev)
942 __field(ino_t, ino)
943 __field(int, type)
944 __field(int, dir)
945 __field(long, nr_to_write)
946 __field(long, pages_skipped)
947 __field(loff_t, range_start)
948 __field(loff_t, range_end)
949 __field(pgoff_t, writeback_index)
950 __field(int, sync_mode)
951 __field(char, for_kupdate)
952 __field(char, for_background)
953 __field(char, tagged_writepages)
954 __field(char, for_reclaim)
955 __field(char, range_cyclic)
956 __field(char, for_sync)
959 TP_fast_assign(
960 __entry->dev = inode->i_sb->s_dev;
961 __entry->ino = inode->i_ino;
962 __entry->type = type;
963 __entry->dir = S_ISDIR(inode->i_mode);
964 __entry->nr_to_write = wbc->nr_to_write;
965 __entry->pages_skipped = wbc->pages_skipped;
966 __entry->range_start = wbc->range_start;
967 __entry->range_end = wbc->range_end;
968 __entry->writeback_index = inode->i_mapping->writeback_index;
969 __entry->sync_mode = wbc->sync_mode;
970 __entry->for_kupdate = wbc->for_kupdate;
971 __entry->for_background = wbc->for_background;
972 __entry->tagged_writepages = wbc->tagged_writepages;
973 __entry->for_reclaim = wbc->for_reclaim;
974 __entry->range_cyclic = wbc->range_cyclic;
975 __entry->for_sync = wbc->for_sync;
978 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
979 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
980 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
981 show_dev_ino(__entry),
982 show_block_type(__entry->type),
983 show_file_type(__entry->dir),
984 __entry->nr_to_write,
985 __entry->pages_skipped,
986 __entry->range_start,
987 __entry->range_end,
988 (unsigned long)__entry->writeback_index,
989 __entry->sync_mode,
990 __entry->for_kupdate,
991 __entry->for_background,
992 __entry->tagged_writepages,
993 __entry->for_reclaim,
994 __entry->range_cyclic,
995 __entry->for_sync)
998 TRACE_EVENT(f2fs_write_checkpoint,
1000 TP_PROTO(struct super_block *sb, int reason, char *msg),
1002 TP_ARGS(sb, reason, msg),
1004 TP_STRUCT__entry(
1005 __field(dev_t, dev)
1006 __field(int, reason)
1007 __field(char *, msg)
1010 TP_fast_assign(
1011 __entry->dev = sb->s_dev;
1012 __entry->reason = reason;
1013 __entry->msg = msg;
1016 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
1017 show_dev(__entry),
1018 show_cpreason(__entry->reason),
1019 __entry->msg)
1022 TRACE_EVENT(f2fs_issue_discard,
1024 TP_PROTO(struct super_block *sb, block_t blkstart, block_t blklen),
1026 TP_ARGS(sb, blkstart, blklen),
1028 TP_STRUCT__entry(
1029 __field(dev_t, dev)
1030 __field(block_t, blkstart)
1031 __field(block_t, blklen)
1034 TP_fast_assign(
1035 __entry->dev = sb->s_dev;
1036 __entry->blkstart = blkstart;
1037 __entry->blklen = blklen;
1040 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
1041 show_dev(__entry),
1042 (unsigned long long)__entry->blkstart,
1043 (unsigned long long)__entry->blklen)
1046 TRACE_EVENT(f2fs_issue_flush,
1048 TP_PROTO(struct super_block *sb, unsigned int nobarrier,
1049 unsigned int flush_merge),
1051 TP_ARGS(sb, nobarrier, flush_merge),
1053 TP_STRUCT__entry(
1054 __field(dev_t, dev)
1055 __field(unsigned int, nobarrier)
1056 __field(unsigned int, flush_merge)
1059 TP_fast_assign(
1060 __entry->dev = sb->s_dev;
1061 __entry->nobarrier = nobarrier;
1062 __entry->flush_merge = flush_merge;
1065 TP_printk("dev = (%d,%d), %s %s",
1066 show_dev(__entry),
1067 __entry->nobarrier ? "skip (nobarrier)" : "issue",
1068 __entry->flush_merge ? " with flush_merge" : "")
1071 TRACE_EVENT(f2fs_lookup_extent_tree_start,
1073 TP_PROTO(struct inode *inode, unsigned int pgofs),
1075 TP_ARGS(inode, pgofs),
1077 TP_STRUCT__entry(
1078 __field(dev_t, dev)
1079 __field(ino_t, ino)
1080 __field(unsigned int, pgofs)
1083 TP_fast_assign(
1084 __entry->dev = inode->i_sb->s_dev;
1085 __entry->ino = inode->i_ino;
1086 __entry->pgofs = pgofs;
1089 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1090 show_dev_ino(__entry),
1091 __entry->pgofs)
1094 TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1096 TP_PROTO(struct inode *inode, unsigned int pgofs,
1097 struct extent_node *en),
1099 TP_ARGS(inode, pgofs, en),
1101 TP_CONDITION(en),
1103 TP_STRUCT__entry(
1104 __field(dev_t, dev)
1105 __field(ino_t, ino)
1106 __field(unsigned int, pgofs)
1107 __field(unsigned int, fofs)
1108 __field(u32, blk)
1109 __field(unsigned int, len)
1112 TP_fast_assign(
1113 __entry->dev = inode->i_sb->s_dev;
1114 __entry->ino = inode->i_ino;
1115 __entry->pgofs = pgofs;
1116 __entry->fofs = en->ei.fofs;
1117 __entry->blk = en->ei.blk;
1118 __entry->len = en->ei.len;
1121 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1122 "ext_info(fofs: %u, blk: %u, len: %u)",
1123 show_dev_ino(__entry),
1124 __entry->pgofs,
1125 __entry->fofs,
1126 __entry->blk,
1127 __entry->len)
1130 TRACE_EVENT(f2fs_update_extent_tree,
1132 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr),
1134 TP_ARGS(inode, pgofs, blkaddr),
1136 TP_STRUCT__entry(
1137 __field(dev_t, dev)
1138 __field(ino_t, ino)
1139 __field(unsigned int, pgofs)
1140 __field(u32, blk)
1143 TP_fast_assign(
1144 __entry->dev = inode->i_sb->s_dev;
1145 __entry->ino = inode->i_ino;
1146 __entry->pgofs = pgofs;
1147 __entry->blk = blkaddr;
1150 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, blkaddr = %u",
1151 show_dev_ino(__entry),
1152 __entry->pgofs,
1153 __entry->blk)
1156 TRACE_EVENT(f2fs_shrink_extent_tree,
1158 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1159 unsigned int tree_cnt),
1161 TP_ARGS(sbi, node_cnt, tree_cnt),
1163 TP_STRUCT__entry(
1164 __field(dev_t, dev)
1165 __field(unsigned int, node_cnt)
1166 __field(unsigned int, tree_cnt)
1169 TP_fast_assign(
1170 __entry->dev = sbi->sb->s_dev;
1171 __entry->node_cnt = node_cnt;
1172 __entry->tree_cnt = tree_cnt;
1175 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
1176 show_dev(__entry),
1177 __entry->node_cnt,
1178 __entry->tree_cnt)
1181 TRACE_EVENT(f2fs_destroy_extent_tree,
1183 TP_PROTO(struct inode *inode, unsigned int node_cnt),
1185 TP_ARGS(inode, node_cnt),
1187 TP_STRUCT__entry(
1188 __field(dev_t, dev)
1189 __field(ino_t, ino)
1190 __field(unsigned int, node_cnt)
1193 TP_fast_assign(
1194 __entry->dev = inode->i_sb->s_dev;
1195 __entry->ino = inode->i_ino;
1196 __entry->node_cnt = node_cnt;
1199 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1200 show_dev_ino(__entry),
1201 __entry->node_cnt)
1204 #endif /* _TRACE_F2FS_H */
1206 /* This part must be outside protection */
1207 #include <trace/define_trace.h>