perf hists: Move sort__has_sym into struct perf_hpp_list
[linux/fpc-iii.git] / include / trace / events / f2fs.h
blob0f565845707bb338e32f619ebbfa0121b65d0fe9
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(INMEM);
17 TRACE_DEFINE_ENUM(INMEM_DROP);
18 TRACE_DEFINE_ENUM(IPU);
19 TRACE_DEFINE_ENUM(OPU);
20 TRACE_DEFINE_ENUM(CURSEG_HOT_DATA);
21 TRACE_DEFINE_ENUM(CURSEG_WARM_DATA);
22 TRACE_DEFINE_ENUM(CURSEG_COLD_DATA);
23 TRACE_DEFINE_ENUM(CURSEG_HOT_NODE);
24 TRACE_DEFINE_ENUM(CURSEG_WARM_NODE);
25 TRACE_DEFINE_ENUM(CURSEG_COLD_NODE);
26 TRACE_DEFINE_ENUM(NO_CHECK_TYPE);
27 TRACE_DEFINE_ENUM(GC_GREEDY);
28 TRACE_DEFINE_ENUM(GC_CB);
29 TRACE_DEFINE_ENUM(FG_GC);
30 TRACE_DEFINE_ENUM(BG_GC);
31 TRACE_DEFINE_ENUM(LFS);
32 TRACE_DEFINE_ENUM(SSR);
33 TRACE_DEFINE_ENUM(__REQ_RAHEAD);
34 TRACE_DEFINE_ENUM(__REQ_WRITE);
35 TRACE_DEFINE_ENUM(__REQ_SYNC);
36 TRACE_DEFINE_ENUM(__REQ_NOIDLE);
37 TRACE_DEFINE_ENUM(__REQ_FLUSH);
38 TRACE_DEFINE_ENUM(__REQ_FUA);
39 TRACE_DEFINE_ENUM(__REQ_PRIO);
40 TRACE_DEFINE_ENUM(__REQ_META);
41 TRACE_DEFINE_ENUM(CP_UMOUNT);
42 TRACE_DEFINE_ENUM(CP_FASTBOOT);
43 TRACE_DEFINE_ENUM(CP_SYNC);
44 TRACE_DEFINE_ENUM(CP_RECOVERY);
45 TRACE_DEFINE_ENUM(CP_DISCARD);
47 #define show_block_type(type) \
48 __print_symbolic(type, \
49 { NODE, "NODE" }, \
50 { DATA, "DATA" }, \
51 { META, "META" }, \
52 { META_FLUSH, "META_FLUSH" }, \
53 { INMEM, "INMEM" }, \
54 { INMEM_DROP, "INMEM_DROP" }, \
55 { INMEM_REVOKE, "INMEM_REVOKE" }, \
56 { IPU, "IN-PLACE" }, \
57 { OPU, "OUT-OF-PLACE" })
59 #define F2FS_BIO_MASK(t) (t & (READA | WRITE_FLUSH_FUA))
60 #define F2FS_BIO_EXTRA_MASK(t) (t & (REQ_META | REQ_PRIO))
62 #define show_bio_type(type) show_bio_base(type), show_bio_extra(type)
64 #define show_bio_base(type) \
65 __print_symbolic(F2FS_BIO_MASK(type), \
66 { READ, "READ" }, \
67 { READA, "READAHEAD" }, \
68 { READ_SYNC, "READ_SYNC" }, \
69 { WRITE, "WRITE" }, \
70 { WRITE_SYNC, "WRITE_SYNC" }, \
71 { WRITE_FLUSH, "WRITE_FLUSH" }, \
72 { WRITE_FUA, "WRITE_FUA" }, \
73 { WRITE_FLUSH_FUA, "WRITE_FLUSH_FUA" })
75 #define show_bio_extra(type) \
76 __print_symbolic(F2FS_BIO_EXTRA_MASK(type), \
77 { REQ_META, "(M)" }, \
78 { REQ_PRIO, "(P)" }, \
79 { REQ_META | REQ_PRIO, "(MP)" }, \
80 { 0, " \b" })
82 #define show_data_type(type) \
83 __print_symbolic(type, \
84 { CURSEG_HOT_DATA, "Hot DATA" }, \
85 { CURSEG_WARM_DATA, "Warm DATA" }, \
86 { CURSEG_COLD_DATA, "Cold DATA" }, \
87 { CURSEG_HOT_NODE, "Hot NODE" }, \
88 { CURSEG_WARM_NODE, "Warm NODE" }, \
89 { CURSEG_COLD_NODE, "Cold NODE" }, \
90 { NO_CHECK_TYPE, "No TYPE" })
92 #define show_file_type(type) \
93 __print_symbolic(type, \
94 { 0, "FILE" }, \
95 { 1, "DIR" })
97 #define show_gc_type(type) \
98 __print_symbolic(type, \
99 { FG_GC, "Foreground GC" }, \
100 { BG_GC, "Background GC" })
102 #define show_alloc_mode(type) \
103 __print_symbolic(type, \
104 { LFS, "LFS-mode" }, \
105 { SSR, "SSR-mode" })
107 #define show_victim_policy(type) \
108 __print_symbolic(type, \
109 { GC_GREEDY, "Greedy" }, \
110 { GC_CB, "Cost-Benefit" })
112 #define show_cpreason(type) \
113 __print_symbolic(type, \
114 { CP_UMOUNT, "Umount" }, \
115 { CP_FASTBOOT, "Fastboot" }, \
116 { CP_SYNC, "Sync" }, \
117 { CP_RECOVERY, "Recovery" }, \
118 { CP_DISCARD, "Discard" })
120 struct victim_sel_policy;
121 struct f2fs_map_blocks;
123 DECLARE_EVENT_CLASS(f2fs__inode,
125 TP_PROTO(struct inode *inode),
127 TP_ARGS(inode),
129 TP_STRUCT__entry(
130 __field(dev_t, dev)
131 __field(ino_t, ino)
132 __field(ino_t, pino)
133 __field(umode_t, mode)
134 __field(loff_t, size)
135 __field(unsigned int, nlink)
136 __field(blkcnt_t, blocks)
137 __field(__u8, advise)
140 TP_fast_assign(
141 __entry->dev = inode->i_sb->s_dev;
142 __entry->ino = inode->i_ino;
143 __entry->pino = F2FS_I(inode)->i_pino;
144 __entry->mode = inode->i_mode;
145 __entry->nlink = inode->i_nlink;
146 __entry->size = inode->i_size;
147 __entry->blocks = inode->i_blocks;
148 __entry->advise = F2FS_I(inode)->i_advise;
151 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
152 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
153 show_dev_ino(__entry),
154 (unsigned long)__entry->pino,
155 __entry->mode,
156 __entry->size,
157 (unsigned int)__entry->nlink,
158 (unsigned long long)__entry->blocks,
159 (unsigned char)__entry->advise)
162 DECLARE_EVENT_CLASS(f2fs__inode_exit,
164 TP_PROTO(struct inode *inode, int ret),
166 TP_ARGS(inode, ret),
168 TP_STRUCT__entry(
169 __field(dev_t, dev)
170 __field(ino_t, ino)
171 __field(int, ret)
174 TP_fast_assign(
175 __entry->dev = inode->i_sb->s_dev;
176 __entry->ino = inode->i_ino;
177 __entry->ret = ret;
180 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
181 show_dev_ino(__entry),
182 __entry->ret)
185 DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
187 TP_PROTO(struct inode *inode),
189 TP_ARGS(inode)
192 TRACE_EVENT(f2fs_sync_file_exit,
194 TP_PROTO(struct inode *inode, int need_cp, int datasync, int ret),
196 TP_ARGS(inode, need_cp, datasync, ret),
198 TP_STRUCT__entry(
199 __field(dev_t, dev)
200 __field(ino_t, ino)
201 __field(int, need_cp)
202 __field(int, datasync)
203 __field(int, ret)
206 TP_fast_assign(
207 __entry->dev = inode->i_sb->s_dev;
208 __entry->ino = inode->i_ino;
209 __entry->need_cp = need_cp;
210 __entry->datasync = datasync;
211 __entry->ret = ret;
214 TP_printk("dev = (%d,%d), ino = %lu, checkpoint is %s, "
215 "datasync = %d, ret = %d",
216 show_dev_ino(__entry),
217 __entry->need_cp ? "needed" : "not needed",
218 __entry->datasync,
219 __entry->ret)
222 TRACE_EVENT(f2fs_sync_fs,
224 TP_PROTO(struct super_block *sb, int wait),
226 TP_ARGS(sb, wait),
228 TP_STRUCT__entry(
229 __field(dev_t, dev)
230 __field(int, dirty)
231 __field(int, wait)
234 TP_fast_assign(
235 __entry->dev = sb->s_dev;
236 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
237 __entry->wait = wait;
240 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
241 show_dev(__entry),
242 __entry->dirty ? "dirty" : "not dirty",
243 __entry->wait)
246 DEFINE_EVENT(f2fs__inode, f2fs_iget,
248 TP_PROTO(struct inode *inode),
250 TP_ARGS(inode)
253 DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
255 TP_PROTO(struct inode *inode, int ret),
257 TP_ARGS(inode, ret)
260 DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
262 TP_PROTO(struct inode *inode),
264 TP_ARGS(inode)
267 DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
269 TP_PROTO(struct inode *inode, int ret),
271 TP_ARGS(inode, ret)
274 TRACE_EVENT(f2fs_unlink_enter,
276 TP_PROTO(struct inode *dir, struct dentry *dentry),
278 TP_ARGS(dir, dentry),
280 TP_STRUCT__entry(
281 __field(dev_t, dev)
282 __field(ino_t, ino)
283 __field(loff_t, size)
284 __field(blkcnt_t, blocks)
285 __field(const char *, name)
288 TP_fast_assign(
289 __entry->dev = dir->i_sb->s_dev;
290 __entry->ino = dir->i_ino;
291 __entry->size = dir->i_size;
292 __entry->blocks = dir->i_blocks;
293 __entry->name = dentry->d_name.name;
296 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
297 "i_blocks = %llu, name = %s",
298 show_dev_ino(__entry),
299 __entry->size,
300 (unsigned long long)__entry->blocks,
301 __entry->name)
304 DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
306 TP_PROTO(struct inode *inode, int ret),
308 TP_ARGS(inode, ret)
311 DEFINE_EVENT(f2fs__inode, f2fs_truncate,
313 TP_PROTO(struct inode *inode),
315 TP_ARGS(inode)
318 TRACE_EVENT(f2fs_truncate_data_blocks_range,
320 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
322 TP_ARGS(inode, nid, ofs, free),
324 TP_STRUCT__entry(
325 __field(dev_t, dev)
326 __field(ino_t, ino)
327 __field(nid_t, nid)
328 __field(unsigned int, ofs)
329 __field(int, free)
332 TP_fast_assign(
333 __entry->dev = inode->i_sb->s_dev;
334 __entry->ino = inode->i_ino;
335 __entry->nid = nid;
336 __entry->ofs = ofs;
337 __entry->free = free;
340 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
341 show_dev_ino(__entry),
342 (unsigned int)__entry->nid,
343 __entry->ofs,
344 __entry->free)
347 DECLARE_EVENT_CLASS(f2fs__truncate_op,
349 TP_PROTO(struct inode *inode, u64 from),
351 TP_ARGS(inode, from),
353 TP_STRUCT__entry(
354 __field(dev_t, dev)
355 __field(ino_t, ino)
356 __field(loff_t, size)
357 __field(blkcnt_t, blocks)
358 __field(u64, from)
361 TP_fast_assign(
362 __entry->dev = inode->i_sb->s_dev;
363 __entry->ino = inode->i_ino;
364 __entry->size = inode->i_size;
365 __entry->blocks = inode->i_blocks;
366 __entry->from = from;
369 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
370 "start file offset = %llu",
371 show_dev_ino(__entry),
372 __entry->size,
373 (unsigned long long)__entry->blocks,
374 (unsigned long long)__entry->from)
377 DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
379 TP_PROTO(struct inode *inode, u64 from),
381 TP_ARGS(inode, from)
384 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
386 TP_PROTO(struct inode *inode, int ret),
388 TP_ARGS(inode, ret)
391 DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
393 TP_PROTO(struct inode *inode, u64 from),
395 TP_ARGS(inode, from)
398 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
400 TP_PROTO(struct inode *inode, int ret),
402 TP_ARGS(inode, ret)
405 DECLARE_EVENT_CLASS(f2fs__truncate_node,
407 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
409 TP_ARGS(inode, nid, blk_addr),
411 TP_STRUCT__entry(
412 __field(dev_t, dev)
413 __field(ino_t, ino)
414 __field(nid_t, nid)
415 __field(block_t, blk_addr)
418 TP_fast_assign(
419 __entry->dev = inode->i_sb->s_dev;
420 __entry->ino = inode->i_ino;
421 __entry->nid = nid;
422 __entry->blk_addr = blk_addr;
425 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
426 show_dev_ino(__entry),
427 (unsigned int)__entry->nid,
428 (unsigned long long)__entry->blk_addr)
431 DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
433 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
435 TP_ARGS(inode, nid, blk_addr)
438 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
440 TP_PROTO(struct inode *inode, int ret),
442 TP_ARGS(inode, ret)
445 DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
447 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
449 TP_ARGS(inode, nid, blk_addr)
452 TRACE_EVENT(f2fs_truncate_partial_nodes,
454 TP_PROTO(struct inode *inode, nid_t nid[], int depth, int err),
456 TP_ARGS(inode, nid, depth, err),
458 TP_STRUCT__entry(
459 __field(dev_t, dev)
460 __field(ino_t, ino)
461 __field(nid_t, nid[3])
462 __field(int, depth)
463 __field(int, err)
466 TP_fast_assign(
467 __entry->dev = inode->i_sb->s_dev;
468 __entry->ino = inode->i_ino;
469 __entry->nid[0] = nid[0];
470 __entry->nid[1] = nid[1];
471 __entry->nid[2] = nid[2];
472 __entry->depth = depth;
473 __entry->err = err;
476 TP_printk("dev = (%d,%d), ino = %lu, "
477 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
478 show_dev_ino(__entry),
479 (unsigned int)__entry->nid[0],
480 (unsigned int)__entry->nid[1],
481 (unsigned int)__entry->nid[2],
482 __entry->depth,
483 __entry->err)
486 TRACE_EVENT(f2fs_map_blocks,
487 TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret),
489 TP_ARGS(inode, map, ret),
491 TP_STRUCT__entry(
492 __field(dev_t, dev)
493 __field(ino_t, ino)
494 __field(block_t, m_lblk)
495 __field(block_t, m_pblk)
496 __field(unsigned int, m_len)
497 __field(int, ret)
500 TP_fast_assign(
501 __entry->dev = inode->i_sb->s_dev;
502 __entry->ino = inode->i_ino;
503 __entry->m_lblk = map->m_lblk;
504 __entry->m_pblk = map->m_pblk;
505 __entry->m_len = map->m_len;
506 __entry->ret = ret;
509 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
510 "start blkaddr = 0x%llx, len = 0x%llx, err = %d",
511 show_dev_ino(__entry),
512 (unsigned long long)__entry->m_lblk,
513 (unsigned long long)__entry->m_pblk,
514 (unsigned long long)__entry->m_len,
515 __entry->ret)
518 TRACE_EVENT(f2fs_background_gc,
520 TP_PROTO(struct super_block *sb, long wait_ms,
521 unsigned int prefree, unsigned int free),
523 TP_ARGS(sb, wait_ms, prefree, free),
525 TP_STRUCT__entry(
526 __field(dev_t, dev)
527 __field(long, wait_ms)
528 __field(unsigned int, prefree)
529 __field(unsigned int, free)
532 TP_fast_assign(
533 __entry->dev = sb->s_dev;
534 __entry->wait_ms = wait_ms;
535 __entry->prefree = prefree;
536 __entry->free = free;
539 TP_printk("dev = (%d,%d), wait_ms = %ld, prefree = %u, free = %u",
540 show_dev(__entry),
541 __entry->wait_ms,
542 __entry->prefree,
543 __entry->free)
546 TRACE_EVENT(f2fs_get_victim,
548 TP_PROTO(struct super_block *sb, int type, int gc_type,
549 struct victim_sel_policy *p, unsigned int pre_victim,
550 unsigned int prefree, unsigned int free),
552 TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
554 TP_STRUCT__entry(
555 __field(dev_t, dev)
556 __field(int, type)
557 __field(int, gc_type)
558 __field(int, alloc_mode)
559 __field(int, gc_mode)
560 __field(unsigned int, victim)
561 __field(unsigned int, ofs_unit)
562 __field(unsigned int, pre_victim)
563 __field(unsigned int, prefree)
564 __field(unsigned int, free)
567 TP_fast_assign(
568 __entry->dev = sb->s_dev;
569 __entry->type = type;
570 __entry->gc_type = gc_type;
571 __entry->alloc_mode = p->alloc_mode;
572 __entry->gc_mode = p->gc_mode;
573 __entry->victim = p->min_segno;
574 __entry->ofs_unit = p->ofs_unit;
575 __entry->pre_victim = pre_victim;
576 __entry->prefree = prefree;
577 __entry->free = free;
580 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), victim = %u "
581 "ofs_unit = %u, pre_victim_secno = %d, prefree = %u, free = %u",
582 show_dev(__entry),
583 show_data_type(__entry->type),
584 show_gc_type(__entry->gc_type),
585 show_alloc_mode(__entry->alloc_mode),
586 show_victim_policy(__entry->gc_mode),
587 __entry->victim,
588 __entry->ofs_unit,
589 (int)__entry->pre_victim,
590 __entry->prefree,
591 __entry->free)
594 TRACE_EVENT(f2fs_fallocate,
596 TP_PROTO(struct inode *inode, int mode,
597 loff_t offset, loff_t len, int ret),
599 TP_ARGS(inode, mode, offset, len, ret),
601 TP_STRUCT__entry(
602 __field(dev_t, dev)
603 __field(ino_t, ino)
604 __field(int, mode)
605 __field(loff_t, offset)
606 __field(loff_t, len)
607 __field(loff_t, size)
608 __field(blkcnt_t, blocks)
609 __field(int, ret)
612 TP_fast_assign(
613 __entry->dev = inode->i_sb->s_dev;
614 __entry->ino = inode->i_ino;
615 __entry->mode = mode;
616 __entry->offset = offset;
617 __entry->len = len;
618 __entry->size = inode->i_size;
619 __entry->blocks = inode->i_blocks;
620 __entry->ret = ret;
623 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
624 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
625 show_dev_ino(__entry),
626 __entry->mode,
627 (unsigned long long)__entry->offset,
628 (unsigned long long)__entry->len,
629 (unsigned long long)__entry->size,
630 (unsigned long long)__entry->blocks,
631 __entry->ret)
634 TRACE_EVENT(f2fs_direct_IO_enter,
636 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
638 TP_ARGS(inode, offset, len, rw),
640 TP_STRUCT__entry(
641 __field(dev_t, dev)
642 __field(ino_t, ino)
643 __field(loff_t, pos)
644 __field(unsigned long, len)
645 __field(int, rw)
648 TP_fast_assign(
649 __entry->dev = inode->i_sb->s_dev;
650 __entry->ino = inode->i_ino;
651 __entry->pos = offset;
652 __entry->len = len;
653 __entry->rw = rw;
656 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
657 show_dev_ino(__entry),
658 __entry->pos,
659 __entry->len,
660 __entry->rw)
663 TRACE_EVENT(f2fs_direct_IO_exit,
665 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
666 int rw, int ret),
668 TP_ARGS(inode, offset, len, rw, ret),
670 TP_STRUCT__entry(
671 __field(dev_t, dev)
672 __field(ino_t, ino)
673 __field(loff_t, pos)
674 __field(unsigned long, len)
675 __field(int, rw)
676 __field(int, ret)
679 TP_fast_assign(
680 __entry->dev = inode->i_sb->s_dev;
681 __entry->ino = inode->i_ino;
682 __entry->pos = offset;
683 __entry->len = len;
684 __entry->rw = rw;
685 __entry->ret = ret;
688 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
689 "rw = %d ret = %d",
690 show_dev_ino(__entry),
691 __entry->pos,
692 __entry->len,
693 __entry->rw,
694 __entry->ret)
697 TRACE_EVENT(f2fs_reserve_new_block,
699 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node),
701 TP_ARGS(inode, nid, ofs_in_node),
703 TP_STRUCT__entry(
704 __field(dev_t, dev)
705 __field(nid_t, nid)
706 __field(unsigned int, ofs_in_node)
709 TP_fast_assign(
710 __entry->dev = inode->i_sb->s_dev;
711 __entry->nid = nid;
712 __entry->ofs_in_node = ofs_in_node;
715 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u",
716 show_dev(__entry),
717 (unsigned int)__entry->nid,
718 __entry->ofs_in_node)
721 DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
723 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
725 TP_ARGS(page, fio),
727 TP_STRUCT__entry(
728 __field(dev_t, dev)
729 __field(ino_t, ino)
730 __field(pgoff_t, index)
731 __field(block_t, old_blkaddr)
732 __field(block_t, new_blkaddr)
733 __field(int, rw)
734 __field(int, type)
737 TP_fast_assign(
738 __entry->dev = page->mapping->host->i_sb->s_dev;
739 __entry->ino = page->mapping->host->i_ino;
740 __entry->index = page->index;
741 __entry->old_blkaddr = fio->old_blkaddr;
742 __entry->new_blkaddr = fio->new_blkaddr;
743 __entry->rw = fio->rw;
744 __entry->type = fio->type;
747 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
748 "oldaddr = 0x%llx, newaddr = 0x%llx rw = %s%s, type = %s",
749 show_dev_ino(__entry),
750 (unsigned long)__entry->index,
751 (unsigned long long)__entry->old_blkaddr,
752 (unsigned long long)__entry->new_blkaddr,
753 show_bio_type(__entry->rw),
754 show_block_type(__entry->type))
757 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
759 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
761 TP_ARGS(page, fio),
763 TP_CONDITION(page->mapping)
766 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_mbio,
768 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
770 TP_ARGS(page, fio),
772 TP_CONDITION(page->mapping)
775 DECLARE_EVENT_CLASS(f2fs__submit_bio,
777 TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
778 struct bio *bio),
780 TP_ARGS(sb, fio, bio),
782 TP_STRUCT__entry(
783 __field(dev_t, dev)
784 __field(int, rw)
785 __field(int, type)
786 __field(sector_t, sector)
787 __field(unsigned int, size)
790 TP_fast_assign(
791 __entry->dev = sb->s_dev;
792 __entry->rw = fio->rw;
793 __entry->type = fio->type;
794 __entry->sector = bio->bi_iter.bi_sector;
795 __entry->size = bio->bi_iter.bi_size;
798 TP_printk("dev = (%d,%d), %s%s, %s, sector = %lld, size = %u",
799 show_dev(__entry),
800 show_bio_type(__entry->rw),
801 show_block_type(__entry->type),
802 (unsigned long long)__entry->sector,
803 __entry->size)
806 DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_write_bio,
808 TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
809 struct bio *bio),
811 TP_ARGS(sb, fio, bio),
813 TP_CONDITION(bio)
816 DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_read_bio,
818 TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
819 struct bio *bio),
821 TP_ARGS(sb, fio, bio),
823 TP_CONDITION(bio)
826 TRACE_EVENT(f2fs_write_begin,
828 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
829 unsigned int flags),
831 TP_ARGS(inode, pos, len, flags),
833 TP_STRUCT__entry(
834 __field(dev_t, dev)
835 __field(ino_t, ino)
836 __field(loff_t, pos)
837 __field(unsigned int, len)
838 __field(unsigned int, flags)
841 TP_fast_assign(
842 __entry->dev = inode->i_sb->s_dev;
843 __entry->ino = inode->i_ino;
844 __entry->pos = pos;
845 __entry->len = len;
846 __entry->flags = flags;
849 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
850 show_dev_ino(__entry),
851 (unsigned long long)__entry->pos,
852 __entry->len,
853 __entry->flags)
856 TRACE_EVENT(f2fs_write_end,
858 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
859 unsigned int copied),
861 TP_ARGS(inode, pos, len, copied),
863 TP_STRUCT__entry(
864 __field(dev_t, dev)
865 __field(ino_t, ino)
866 __field(loff_t, pos)
867 __field(unsigned int, len)
868 __field(unsigned int, copied)
871 TP_fast_assign(
872 __entry->dev = inode->i_sb->s_dev;
873 __entry->ino = inode->i_ino;
874 __entry->pos = pos;
875 __entry->len = len;
876 __entry->copied = copied;
879 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
880 show_dev_ino(__entry),
881 (unsigned long long)__entry->pos,
882 __entry->len,
883 __entry->copied)
886 DECLARE_EVENT_CLASS(f2fs__page,
888 TP_PROTO(struct page *page, int type),
890 TP_ARGS(page, type),
892 TP_STRUCT__entry(
893 __field(dev_t, dev)
894 __field(ino_t, ino)
895 __field(int, type)
896 __field(int, dir)
897 __field(pgoff_t, index)
898 __field(int, dirty)
899 __field(int, uptodate)
902 TP_fast_assign(
903 __entry->dev = page->mapping->host->i_sb->s_dev;
904 __entry->ino = page->mapping->host->i_ino;
905 __entry->type = type;
906 __entry->dir = S_ISDIR(page->mapping->host->i_mode);
907 __entry->index = page->index;
908 __entry->dirty = PageDirty(page);
909 __entry->uptodate = PageUptodate(page);
912 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
913 "dirty = %d, uptodate = %d",
914 show_dev_ino(__entry),
915 show_block_type(__entry->type),
916 show_file_type(__entry->dir),
917 (unsigned long)__entry->index,
918 __entry->dirty,
919 __entry->uptodate)
922 DEFINE_EVENT(f2fs__page, f2fs_writepage,
924 TP_PROTO(struct page *page, int type),
926 TP_ARGS(page, type)
929 DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
931 TP_PROTO(struct page *page, int type),
933 TP_ARGS(page, type)
936 DEFINE_EVENT(f2fs__page, f2fs_readpage,
938 TP_PROTO(struct page *page, int type),
940 TP_ARGS(page, type)
943 DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
945 TP_PROTO(struct page *page, int type),
947 TP_ARGS(page, type)
950 DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
952 TP_PROTO(struct page *page, int type),
954 TP_ARGS(page, type)
957 DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
959 TP_PROTO(struct page *page, int type),
961 TP_ARGS(page, type)
964 DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
966 TP_PROTO(struct page *page, int type),
968 TP_ARGS(page, type)
971 TRACE_EVENT(f2fs_writepages,
973 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
975 TP_ARGS(inode, wbc, type),
977 TP_STRUCT__entry(
978 __field(dev_t, dev)
979 __field(ino_t, ino)
980 __field(int, type)
981 __field(int, dir)
982 __field(long, nr_to_write)
983 __field(long, pages_skipped)
984 __field(loff_t, range_start)
985 __field(loff_t, range_end)
986 __field(pgoff_t, writeback_index)
987 __field(int, sync_mode)
988 __field(char, for_kupdate)
989 __field(char, for_background)
990 __field(char, tagged_writepages)
991 __field(char, for_reclaim)
992 __field(char, range_cyclic)
993 __field(char, for_sync)
996 TP_fast_assign(
997 __entry->dev = inode->i_sb->s_dev;
998 __entry->ino = inode->i_ino;
999 __entry->type = type;
1000 __entry->dir = S_ISDIR(inode->i_mode);
1001 __entry->nr_to_write = wbc->nr_to_write;
1002 __entry->pages_skipped = wbc->pages_skipped;
1003 __entry->range_start = wbc->range_start;
1004 __entry->range_end = wbc->range_end;
1005 __entry->writeback_index = inode->i_mapping->writeback_index;
1006 __entry->sync_mode = wbc->sync_mode;
1007 __entry->for_kupdate = wbc->for_kupdate;
1008 __entry->for_background = wbc->for_background;
1009 __entry->tagged_writepages = wbc->tagged_writepages;
1010 __entry->for_reclaim = wbc->for_reclaim;
1011 __entry->range_cyclic = wbc->range_cyclic;
1012 __entry->for_sync = wbc->for_sync;
1015 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1016 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1017 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1018 show_dev_ino(__entry),
1019 show_block_type(__entry->type),
1020 show_file_type(__entry->dir),
1021 __entry->nr_to_write,
1022 __entry->pages_skipped,
1023 __entry->range_start,
1024 __entry->range_end,
1025 (unsigned long)__entry->writeback_index,
1026 __entry->sync_mode,
1027 __entry->for_kupdate,
1028 __entry->for_background,
1029 __entry->tagged_writepages,
1030 __entry->for_reclaim,
1031 __entry->range_cyclic,
1032 __entry->for_sync)
1035 TRACE_EVENT(f2fs_readpages,
1037 TP_PROTO(struct inode *inode, struct page *page, unsigned int nrpage),
1039 TP_ARGS(inode, page, nrpage),
1041 TP_STRUCT__entry(
1042 __field(dev_t, dev)
1043 __field(ino_t, ino)
1044 __field(pgoff_t, start)
1045 __field(unsigned int, nrpage)
1048 TP_fast_assign(
1049 __entry->dev = inode->i_sb->s_dev;
1050 __entry->ino = inode->i_ino;
1051 __entry->start = page->index;
1052 __entry->nrpage = nrpage;
1055 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1056 show_dev_ino(__entry),
1057 (unsigned long)__entry->start,
1058 __entry->nrpage)
1061 TRACE_EVENT(f2fs_write_checkpoint,
1063 TP_PROTO(struct super_block *sb, int reason, char *msg),
1065 TP_ARGS(sb, reason, msg),
1067 TP_STRUCT__entry(
1068 __field(dev_t, dev)
1069 __field(int, reason)
1070 __field(char *, msg)
1073 TP_fast_assign(
1074 __entry->dev = sb->s_dev;
1075 __entry->reason = reason;
1076 __entry->msg = msg;
1079 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
1080 show_dev(__entry),
1081 show_cpreason(__entry->reason),
1082 __entry->msg)
1085 TRACE_EVENT(f2fs_issue_discard,
1087 TP_PROTO(struct super_block *sb, block_t blkstart, block_t blklen),
1089 TP_ARGS(sb, blkstart, blklen),
1091 TP_STRUCT__entry(
1092 __field(dev_t, dev)
1093 __field(block_t, blkstart)
1094 __field(block_t, blklen)
1097 TP_fast_assign(
1098 __entry->dev = sb->s_dev;
1099 __entry->blkstart = blkstart;
1100 __entry->blklen = blklen;
1103 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
1104 show_dev(__entry),
1105 (unsigned long long)__entry->blkstart,
1106 (unsigned long long)__entry->blklen)
1109 TRACE_EVENT(f2fs_issue_flush,
1111 TP_PROTO(struct super_block *sb, unsigned int nobarrier,
1112 unsigned int flush_merge),
1114 TP_ARGS(sb, nobarrier, flush_merge),
1116 TP_STRUCT__entry(
1117 __field(dev_t, dev)
1118 __field(unsigned int, nobarrier)
1119 __field(unsigned int, flush_merge)
1122 TP_fast_assign(
1123 __entry->dev = sb->s_dev;
1124 __entry->nobarrier = nobarrier;
1125 __entry->flush_merge = flush_merge;
1128 TP_printk("dev = (%d,%d), %s %s",
1129 show_dev(__entry),
1130 __entry->nobarrier ? "skip (nobarrier)" : "issue",
1131 __entry->flush_merge ? " with flush_merge" : "")
1134 TRACE_EVENT(f2fs_lookup_extent_tree_start,
1136 TP_PROTO(struct inode *inode, unsigned int pgofs),
1138 TP_ARGS(inode, pgofs),
1140 TP_STRUCT__entry(
1141 __field(dev_t, dev)
1142 __field(ino_t, ino)
1143 __field(unsigned int, pgofs)
1146 TP_fast_assign(
1147 __entry->dev = inode->i_sb->s_dev;
1148 __entry->ino = inode->i_ino;
1149 __entry->pgofs = pgofs;
1152 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1153 show_dev_ino(__entry),
1154 __entry->pgofs)
1157 TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1159 TP_PROTO(struct inode *inode, unsigned int pgofs,
1160 struct extent_info *ei),
1162 TP_ARGS(inode, pgofs, ei),
1164 TP_CONDITION(ei),
1166 TP_STRUCT__entry(
1167 __field(dev_t, dev)
1168 __field(ino_t, ino)
1169 __field(unsigned int, pgofs)
1170 __field(unsigned int, fofs)
1171 __field(u32, blk)
1172 __field(unsigned int, len)
1175 TP_fast_assign(
1176 __entry->dev = inode->i_sb->s_dev;
1177 __entry->ino = inode->i_ino;
1178 __entry->pgofs = pgofs;
1179 __entry->fofs = ei->fofs;
1180 __entry->blk = ei->blk;
1181 __entry->len = ei->len;
1184 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1185 "ext_info(fofs: %u, blk: %u, len: %u)",
1186 show_dev_ino(__entry),
1187 __entry->pgofs,
1188 __entry->fofs,
1189 __entry->blk,
1190 __entry->len)
1193 TRACE_EVENT(f2fs_update_extent_tree_range,
1195 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1196 unsigned int len),
1198 TP_ARGS(inode, pgofs, blkaddr, len),
1200 TP_STRUCT__entry(
1201 __field(dev_t, dev)
1202 __field(ino_t, ino)
1203 __field(unsigned int, pgofs)
1204 __field(u32, blk)
1205 __field(unsigned int, len)
1208 TP_fast_assign(
1209 __entry->dev = inode->i_sb->s_dev;
1210 __entry->ino = inode->i_ino;
1211 __entry->pgofs = pgofs;
1212 __entry->blk = blkaddr;
1213 __entry->len = len;
1216 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1217 "blkaddr = %u, len = %u",
1218 show_dev_ino(__entry),
1219 __entry->pgofs,
1220 __entry->blk,
1221 __entry->len)
1224 TRACE_EVENT(f2fs_shrink_extent_tree,
1226 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1227 unsigned int tree_cnt),
1229 TP_ARGS(sbi, node_cnt, tree_cnt),
1231 TP_STRUCT__entry(
1232 __field(dev_t, dev)
1233 __field(unsigned int, node_cnt)
1234 __field(unsigned int, tree_cnt)
1237 TP_fast_assign(
1238 __entry->dev = sbi->sb->s_dev;
1239 __entry->node_cnt = node_cnt;
1240 __entry->tree_cnt = tree_cnt;
1243 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
1244 show_dev(__entry),
1245 __entry->node_cnt,
1246 __entry->tree_cnt)
1249 TRACE_EVENT(f2fs_destroy_extent_tree,
1251 TP_PROTO(struct inode *inode, unsigned int node_cnt),
1253 TP_ARGS(inode, node_cnt),
1255 TP_STRUCT__entry(
1256 __field(dev_t, dev)
1257 __field(ino_t, ino)
1258 __field(unsigned int, node_cnt)
1261 TP_fast_assign(
1262 __entry->dev = inode->i_sb->s_dev;
1263 __entry->ino = inode->i_ino;
1264 __entry->node_cnt = node_cnt;
1267 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1268 show_dev_ino(__entry),
1269 __entry->node_cnt)
1272 DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
1274 TP_PROTO(struct super_block *sb, int type, int count),
1276 TP_ARGS(sb, type, count),
1278 TP_STRUCT__entry(
1279 __field(dev_t, dev)
1280 __field(int, type)
1281 __field(int, count)
1284 TP_fast_assign(
1285 __entry->dev = sb->s_dev;
1286 __entry->type = type;
1287 __entry->count = count;
1290 TP_printk("dev = (%d,%d), %s, dirty count = %d",
1291 show_dev(__entry),
1292 show_file_type(__entry->type),
1293 __entry->count)
1296 DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
1298 TP_PROTO(struct super_block *sb, int type, int count),
1300 TP_ARGS(sb, type, count)
1303 DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
1305 TP_PROTO(struct super_block *sb, int type, int count),
1307 TP_ARGS(sb, type, count)
1310 #endif /* _TRACE_F2FS_H */
1312 /* This part must be outside protection */
1313 #include <trace/define_trace.h>