Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / include / trace / events / f2fs.h
blob6f77a2755abbfa89b4ab93467d69d36364650693
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(dev) MAJOR(dev), MINOR(dev)
10 #define show_dev_ino(entry) show_dev(entry->dev), (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(INMEM_INVALIDATE);
19 TRACE_DEFINE_ENUM(INMEM_REVOKE);
20 TRACE_DEFINE_ENUM(IPU);
21 TRACE_DEFINE_ENUM(OPU);
22 TRACE_DEFINE_ENUM(HOT);
23 TRACE_DEFINE_ENUM(WARM);
24 TRACE_DEFINE_ENUM(COLD);
25 TRACE_DEFINE_ENUM(CURSEG_HOT_DATA);
26 TRACE_DEFINE_ENUM(CURSEG_WARM_DATA);
27 TRACE_DEFINE_ENUM(CURSEG_COLD_DATA);
28 TRACE_DEFINE_ENUM(CURSEG_HOT_NODE);
29 TRACE_DEFINE_ENUM(CURSEG_WARM_NODE);
30 TRACE_DEFINE_ENUM(CURSEG_COLD_NODE);
31 TRACE_DEFINE_ENUM(NO_CHECK_TYPE);
32 TRACE_DEFINE_ENUM(GC_GREEDY);
33 TRACE_DEFINE_ENUM(GC_CB);
34 TRACE_DEFINE_ENUM(FG_GC);
35 TRACE_DEFINE_ENUM(BG_GC);
36 TRACE_DEFINE_ENUM(LFS);
37 TRACE_DEFINE_ENUM(SSR);
38 TRACE_DEFINE_ENUM(__REQ_RAHEAD);
39 TRACE_DEFINE_ENUM(__REQ_SYNC);
40 TRACE_DEFINE_ENUM(__REQ_IDLE);
41 TRACE_DEFINE_ENUM(__REQ_PREFLUSH);
42 TRACE_DEFINE_ENUM(__REQ_FUA);
43 TRACE_DEFINE_ENUM(__REQ_PRIO);
44 TRACE_DEFINE_ENUM(__REQ_META);
45 TRACE_DEFINE_ENUM(CP_UMOUNT);
46 TRACE_DEFINE_ENUM(CP_FASTBOOT);
47 TRACE_DEFINE_ENUM(CP_SYNC);
48 TRACE_DEFINE_ENUM(CP_RECOVERY);
49 TRACE_DEFINE_ENUM(CP_DISCARD);
50 TRACE_DEFINE_ENUM(CP_TRIMMED);
52 #define show_block_type(type) \
53 __print_symbolic(type, \
54 { NODE, "NODE" }, \
55 { DATA, "DATA" }, \
56 { META, "META" }, \
57 { META_FLUSH, "META_FLUSH" }, \
58 { INMEM, "INMEM" }, \
59 { INMEM_DROP, "INMEM_DROP" }, \
60 { INMEM_INVALIDATE, "INMEM_INVALIDATE" }, \
61 { INMEM_REVOKE, "INMEM_REVOKE" }, \
62 { IPU, "IN-PLACE" }, \
63 { OPU, "OUT-OF-PLACE" })
65 #define show_block_temp(temp) \
66 __print_symbolic(temp, \
67 { HOT, "HOT" }, \
68 { WARM, "WARM" }, \
69 { COLD, "COLD" })
71 #define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_META | REQ_PRIO | \
72 REQ_PREFLUSH | REQ_FUA)
73 #define F2FS_BIO_FLAG_MASK(t) (t & F2FS_OP_FLAGS)
75 #define show_bio_type(op,op_flags) show_bio_op(op), \
76 show_bio_op_flags(op_flags)
78 #define show_bio_op(op) \
79 __print_symbolic(op, \
80 { REQ_OP_READ, "READ" }, \
81 { REQ_OP_WRITE, "WRITE" }, \
82 { REQ_OP_FLUSH, "FLUSH" }, \
83 { REQ_OP_DISCARD, "DISCARD" }, \
84 { REQ_OP_ZONE_REPORT, "ZONE_REPORT" }, \
85 { 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" })
90 #define show_bio_op_flags(flags) \
91 __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" })
99 #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" })
109 #define show_file_type(type) \
110 __print_symbolic(type, \
111 { 0, "FILE" }, \
112 { 1, "DIR" })
114 #define show_gc_type(type) \
115 __print_symbolic(type, \
116 { FG_GC, "Foreground GC" }, \
117 { BG_GC, "Background GC" })
119 #define show_alloc_mode(type) \
120 __print_symbolic(type, \
121 { LFS, "LFS-mode" }, \
122 { SSR, "SSR-mode" })
124 #define show_victim_policy(type) \
125 __print_symbolic(type, \
126 { GC_GREEDY, "Greedy" }, \
127 { GC_CB, "Cost-Benefit" })
129 #define show_cpreason(type) \
130 __print_flags(type, "|", \
131 { CP_UMOUNT, "Umount" }, \
132 { CP_FASTBOOT, "Fastboot" }, \
133 { CP_SYNC, "Sync" }, \
134 { CP_RECOVERY, "Recovery" }, \
135 { CP_DISCARD, "Discard" }, \
136 { CP_UMOUNT, "Umount" }, \
137 { CP_TRIMMED, "Trimmed" })
139 struct victim_sel_policy;
140 struct f2fs_map_blocks;
142 DECLARE_EVENT_CLASS(f2fs__inode,
144 TP_PROTO(struct inode *inode),
146 TP_ARGS(inode),
148 TP_STRUCT__entry(
149 __field(dev_t, dev)
150 __field(ino_t, ino)
151 __field(ino_t, pino)
152 __field(umode_t, mode)
153 __field(loff_t, size)
154 __field(unsigned int, nlink)
155 __field(blkcnt_t, blocks)
156 __field(__u8, advise)
159 TP_fast_assign(
160 __entry->dev = inode->i_sb->s_dev;
161 __entry->ino = inode->i_ino;
162 __entry->pino = F2FS_I(inode)->i_pino;
163 __entry->mode = inode->i_mode;
164 __entry->nlink = inode->i_nlink;
165 __entry->size = inode->i_size;
166 __entry->blocks = inode->i_blocks;
167 __entry->advise = F2FS_I(inode)->i_advise;
170 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
171 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
172 show_dev_ino(__entry),
173 (unsigned long)__entry->pino,
174 __entry->mode,
175 __entry->size,
176 (unsigned int)__entry->nlink,
177 (unsigned long long)__entry->blocks,
178 (unsigned char)__entry->advise)
181 DECLARE_EVENT_CLASS(f2fs__inode_exit,
183 TP_PROTO(struct inode *inode, int ret),
185 TP_ARGS(inode, ret),
187 TP_STRUCT__entry(
188 __field(dev_t, dev)
189 __field(ino_t, ino)
190 __field(int, ret)
193 TP_fast_assign(
194 __entry->dev = inode->i_sb->s_dev;
195 __entry->ino = inode->i_ino;
196 __entry->ret = ret;
199 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
200 show_dev_ino(__entry),
201 __entry->ret)
204 DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
206 TP_PROTO(struct inode *inode),
208 TP_ARGS(inode)
211 TRACE_EVENT(f2fs_sync_file_exit,
213 TP_PROTO(struct inode *inode, int need_cp, int datasync, int ret),
215 TP_ARGS(inode, need_cp, datasync, ret),
217 TP_STRUCT__entry(
218 __field(dev_t, dev)
219 __field(ino_t, ino)
220 __field(int, need_cp)
221 __field(int, datasync)
222 __field(int, ret)
225 TP_fast_assign(
226 __entry->dev = inode->i_sb->s_dev;
227 __entry->ino = inode->i_ino;
228 __entry->need_cp = need_cp;
229 __entry->datasync = datasync;
230 __entry->ret = ret;
233 TP_printk("dev = (%d,%d), ino = %lu, checkpoint is %s, "
234 "datasync = %d, ret = %d",
235 show_dev_ino(__entry),
236 __entry->need_cp ? "needed" : "not needed",
237 __entry->datasync,
238 __entry->ret)
241 TRACE_EVENT(f2fs_sync_fs,
243 TP_PROTO(struct super_block *sb, int wait),
245 TP_ARGS(sb, wait),
247 TP_STRUCT__entry(
248 __field(dev_t, dev)
249 __field(int, dirty)
250 __field(int, wait)
253 TP_fast_assign(
254 __entry->dev = sb->s_dev;
255 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
256 __entry->wait = wait;
259 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
260 show_dev(__entry->dev),
261 __entry->dirty ? "dirty" : "not dirty",
262 __entry->wait)
265 DEFINE_EVENT(f2fs__inode, f2fs_iget,
267 TP_PROTO(struct inode *inode),
269 TP_ARGS(inode)
272 DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
274 TP_PROTO(struct inode *inode, int ret),
276 TP_ARGS(inode, ret)
279 DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
281 TP_PROTO(struct inode *inode),
283 TP_ARGS(inode)
286 DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
288 TP_PROTO(struct inode *inode, int ret),
290 TP_ARGS(inode, ret)
293 TRACE_EVENT(f2fs_unlink_enter,
295 TP_PROTO(struct inode *dir, struct dentry *dentry),
297 TP_ARGS(dir, dentry),
299 TP_STRUCT__entry(
300 __field(dev_t, dev)
301 __field(ino_t, ino)
302 __field(loff_t, size)
303 __field(blkcnt_t, blocks)
304 __field(const char *, name)
307 TP_fast_assign(
308 __entry->dev = dir->i_sb->s_dev;
309 __entry->ino = dir->i_ino;
310 __entry->size = dir->i_size;
311 __entry->blocks = dir->i_blocks;
312 __entry->name = dentry->d_name.name;
315 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
316 "i_blocks = %llu, name = %s",
317 show_dev_ino(__entry),
318 __entry->size,
319 (unsigned long long)__entry->blocks,
320 __entry->name)
323 DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
325 TP_PROTO(struct inode *inode, int ret),
327 TP_ARGS(inode, ret)
330 DEFINE_EVENT(f2fs__inode_exit, f2fs_drop_inode,
332 TP_PROTO(struct inode *inode, int ret),
334 TP_ARGS(inode, ret)
337 DEFINE_EVENT(f2fs__inode, f2fs_truncate,
339 TP_PROTO(struct inode *inode),
341 TP_ARGS(inode)
344 TRACE_EVENT(f2fs_truncate_data_blocks_range,
346 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
348 TP_ARGS(inode, nid, ofs, free),
350 TP_STRUCT__entry(
351 __field(dev_t, dev)
352 __field(ino_t, ino)
353 __field(nid_t, nid)
354 __field(unsigned int, ofs)
355 __field(int, free)
358 TP_fast_assign(
359 __entry->dev = inode->i_sb->s_dev;
360 __entry->ino = inode->i_ino;
361 __entry->nid = nid;
362 __entry->ofs = ofs;
363 __entry->free = free;
366 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
367 show_dev_ino(__entry),
368 (unsigned int)__entry->nid,
369 __entry->ofs,
370 __entry->free)
373 DECLARE_EVENT_CLASS(f2fs__truncate_op,
375 TP_PROTO(struct inode *inode, u64 from),
377 TP_ARGS(inode, from),
379 TP_STRUCT__entry(
380 __field(dev_t, dev)
381 __field(ino_t, ino)
382 __field(loff_t, size)
383 __field(blkcnt_t, blocks)
384 __field(u64, from)
387 TP_fast_assign(
388 __entry->dev = inode->i_sb->s_dev;
389 __entry->ino = inode->i_ino;
390 __entry->size = inode->i_size;
391 __entry->blocks = inode->i_blocks;
392 __entry->from = from;
395 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
396 "start file offset = %llu",
397 show_dev_ino(__entry),
398 __entry->size,
399 (unsigned long long)__entry->blocks,
400 (unsigned long long)__entry->from)
403 DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
405 TP_PROTO(struct inode *inode, u64 from),
407 TP_ARGS(inode, from)
410 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
412 TP_PROTO(struct inode *inode, int ret),
414 TP_ARGS(inode, ret)
417 DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
419 TP_PROTO(struct inode *inode, u64 from),
421 TP_ARGS(inode, from)
424 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
426 TP_PROTO(struct inode *inode, int ret),
428 TP_ARGS(inode, ret)
431 DECLARE_EVENT_CLASS(f2fs__truncate_node,
433 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
435 TP_ARGS(inode, nid, blk_addr),
437 TP_STRUCT__entry(
438 __field(dev_t, dev)
439 __field(ino_t, ino)
440 __field(nid_t, nid)
441 __field(block_t, blk_addr)
444 TP_fast_assign(
445 __entry->dev = inode->i_sb->s_dev;
446 __entry->ino = inode->i_ino;
447 __entry->nid = nid;
448 __entry->blk_addr = blk_addr;
451 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
452 show_dev_ino(__entry),
453 (unsigned int)__entry->nid,
454 (unsigned long long)__entry->blk_addr)
457 DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
459 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
461 TP_ARGS(inode, nid, blk_addr)
464 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
466 TP_PROTO(struct inode *inode, int ret),
468 TP_ARGS(inode, ret)
471 DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
473 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
475 TP_ARGS(inode, nid, blk_addr)
478 TRACE_EVENT(f2fs_truncate_partial_nodes,
480 TP_PROTO(struct inode *inode, nid_t nid[], int depth, int err),
482 TP_ARGS(inode, nid, depth, err),
484 TP_STRUCT__entry(
485 __field(dev_t, dev)
486 __field(ino_t, ino)
487 __field(nid_t, nid[3])
488 __field(int, depth)
489 __field(int, err)
492 TP_fast_assign(
493 __entry->dev = inode->i_sb->s_dev;
494 __entry->ino = inode->i_ino;
495 __entry->nid[0] = nid[0];
496 __entry->nid[1] = nid[1];
497 __entry->nid[2] = nid[2];
498 __entry->depth = depth;
499 __entry->err = err;
502 TP_printk("dev = (%d,%d), ino = %lu, "
503 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
504 show_dev_ino(__entry),
505 (unsigned int)__entry->nid[0],
506 (unsigned int)__entry->nid[1],
507 (unsigned int)__entry->nid[2],
508 __entry->depth,
509 __entry->err)
512 TRACE_EVENT(f2fs_map_blocks,
513 TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret),
515 TP_ARGS(inode, map, ret),
517 TP_STRUCT__entry(
518 __field(dev_t, dev)
519 __field(ino_t, ino)
520 __field(block_t, m_lblk)
521 __field(block_t, m_pblk)
522 __field(unsigned int, m_len)
523 __field(int, ret)
526 TP_fast_assign(
527 __entry->dev = inode->i_sb->s_dev;
528 __entry->ino = inode->i_ino;
529 __entry->m_lblk = map->m_lblk;
530 __entry->m_pblk = map->m_pblk;
531 __entry->m_len = map->m_len;
532 __entry->ret = ret;
535 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
536 "start blkaddr = 0x%llx, len = 0x%llx, err = %d",
537 show_dev_ino(__entry),
538 (unsigned long long)__entry->m_lblk,
539 (unsigned long long)__entry->m_pblk,
540 (unsigned long long)__entry->m_len,
541 __entry->ret)
544 TRACE_EVENT(f2fs_background_gc,
546 TP_PROTO(struct super_block *sb, long wait_ms,
547 unsigned int prefree, unsigned int free),
549 TP_ARGS(sb, wait_ms, prefree, free),
551 TP_STRUCT__entry(
552 __field(dev_t, dev)
553 __field(long, wait_ms)
554 __field(unsigned int, prefree)
555 __field(unsigned int, free)
558 TP_fast_assign(
559 __entry->dev = sb->s_dev;
560 __entry->wait_ms = wait_ms;
561 __entry->prefree = prefree;
562 __entry->free = free;
565 TP_printk("dev = (%d,%d), wait_ms = %ld, prefree = %u, free = %u",
566 show_dev(__entry->dev),
567 __entry->wait_ms,
568 __entry->prefree,
569 __entry->free)
572 TRACE_EVENT(f2fs_get_victim,
574 TP_PROTO(struct super_block *sb, int type, int gc_type,
575 struct victim_sel_policy *p, unsigned int pre_victim,
576 unsigned int prefree, unsigned int free),
578 TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
580 TP_STRUCT__entry(
581 __field(dev_t, dev)
582 __field(int, type)
583 __field(int, gc_type)
584 __field(int, alloc_mode)
585 __field(int, gc_mode)
586 __field(unsigned int, victim)
587 __field(unsigned int, cost)
588 __field(unsigned int, ofs_unit)
589 __field(unsigned int, pre_victim)
590 __field(unsigned int, prefree)
591 __field(unsigned int, free)
594 TP_fast_assign(
595 __entry->dev = sb->s_dev;
596 __entry->type = type;
597 __entry->gc_type = gc_type;
598 __entry->alloc_mode = p->alloc_mode;
599 __entry->gc_mode = p->gc_mode;
600 __entry->victim = p->min_segno;
601 __entry->cost = p->min_cost;
602 __entry->ofs_unit = p->ofs_unit;
603 __entry->pre_victim = pre_victim;
604 __entry->prefree = prefree;
605 __entry->free = free;
608 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), "
609 "victim = %u, cost = %u, ofs_unit = %u, "
610 "pre_victim_secno = %d, prefree = %u, free = %u",
611 show_dev(__entry->dev),
612 show_data_type(__entry->type),
613 show_gc_type(__entry->gc_type),
614 show_alloc_mode(__entry->alloc_mode),
615 show_victim_policy(__entry->gc_mode),
616 __entry->victim,
617 __entry->cost,
618 __entry->ofs_unit,
619 (int)__entry->pre_victim,
620 __entry->prefree,
621 __entry->free)
624 TRACE_EVENT(f2fs_fallocate,
626 TP_PROTO(struct inode *inode, int mode,
627 loff_t offset, loff_t len, int ret),
629 TP_ARGS(inode, mode, offset, len, ret),
631 TP_STRUCT__entry(
632 __field(dev_t, dev)
633 __field(ino_t, ino)
634 __field(int, mode)
635 __field(loff_t, offset)
636 __field(loff_t, len)
637 __field(loff_t, size)
638 __field(blkcnt_t, blocks)
639 __field(int, ret)
642 TP_fast_assign(
643 __entry->dev = inode->i_sb->s_dev;
644 __entry->ino = inode->i_ino;
645 __entry->mode = mode;
646 __entry->offset = offset;
647 __entry->len = len;
648 __entry->size = inode->i_size;
649 __entry->blocks = inode->i_blocks;
650 __entry->ret = ret;
653 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
654 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
655 show_dev_ino(__entry),
656 __entry->mode,
657 (unsigned long long)__entry->offset,
658 (unsigned long long)__entry->len,
659 (unsigned long long)__entry->size,
660 (unsigned long long)__entry->blocks,
661 __entry->ret)
664 TRACE_EVENT(f2fs_direct_IO_enter,
666 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
668 TP_ARGS(inode, offset, len, rw),
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)
678 TP_fast_assign(
679 __entry->dev = inode->i_sb->s_dev;
680 __entry->ino = inode->i_ino;
681 __entry->pos = offset;
682 __entry->len = len;
683 __entry->rw = rw;
686 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
687 show_dev_ino(__entry),
688 __entry->pos,
689 __entry->len,
690 __entry->rw)
693 TRACE_EVENT(f2fs_direct_IO_exit,
695 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
696 int rw, int ret),
698 TP_ARGS(inode, offset, len, rw, ret),
700 TP_STRUCT__entry(
701 __field(dev_t, dev)
702 __field(ino_t, ino)
703 __field(loff_t, pos)
704 __field(unsigned long, len)
705 __field(int, rw)
706 __field(int, ret)
709 TP_fast_assign(
710 __entry->dev = inode->i_sb->s_dev;
711 __entry->ino = inode->i_ino;
712 __entry->pos = offset;
713 __entry->len = len;
714 __entry->rw = rw;
715 __entry->ret = ret;
718 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
719 "rw = %d ret = %d",
720 show_dev_ino(__entry),
721 __entry->pos,
722 __entry->len,
723 __entry->rw,
724 __entry->ret)
727 TRACE_EVENT(f2fs_reserve_new_blocks,
729 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node,
730 blkcnt_t count),
732 TP_ARGS(inode, nid, ofs_in_node, count),
734 TP_STRUCT__entry(
735 __field(dev_t, dev)
736 __field(nid_t, nid)
737 __field(unsigned int, ofs_in_node)
738 __field(blkcnt_t, count)
741 TP_fast_assign(
742 __entry->dev = inode->i_sb->s_dev;
743 __entry->nid = nid;
744 __entry->ofs_in_node = ofs_in_node;
745 __entry->count = count;
748 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu",
749 show_dev(__entry->dev),
750 (unsigned int)__entry->nid,
751 __entry->ofs_in_node,
752 (unsigned long long)__entry->count)
755 DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
757 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
759 TP_ARGS(page, fio),
761 TP_STRUCT__entry(
762 __field(dev_t, dev)
763 __field(ino_t, ino)
764 __field(pgoff_t, index)
765 __field(block_t, old_blkaddr)
766 __field(block_t, new_blkaddr)
767 __field(int, op)
768 __field(int, op_flags)
769 __field(int, temp)
770 __field(int, type)
773 TP_fast_assign(
774 __entry->dev = page->mapping->host->i_sb->s_dev;
775 __entry->ino = page->mapping->host->i_ino;
776 __entry->index = page->index;
777 __entry->old_blkaddr = fio->old_blkaddr;
778 __entry->new_blkaddr = fio->new_blkaddr;
779 __entry->op = fio->op;
780 __entry->op_flags = fio->op_flags;
781 __entry->temp = fio->temp;
782 __entry->type = fio->type;
785 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
786 "oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s",
787 show_dev_ino(__entry),
788 (unsigned long)__entry->index,
789 (unsigned long long)__entry->old_blkaddr,
790 (unsigned long long)__entry->new_blkaddr,
791 show_bio_type(__entry->op, __entry->op_flags),
792 show_block_temp(__entry->temp),
793 show_block_type(__entry->type))
796 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
798 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
800 TP_ARGS(page, fio),
802 TP_CONDITION(page->mapping)
805 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_write,
807 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
809 TP_ARGS(page, fio),
811 TP_CONDITION(page->mapping)
814 DECLARE_EVENT_CLASS(f2fs__bio,
816 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
818 TP_ARGS(sb, type, bio),
820 TP_STRUCT__entry(
821 __field(dev_t, dev)
822 __field(dev_t, target)
823 __field(int, op)
824 __field(int, op_flags)
825 __field(int, type)
826 __field(sector_t, sector)
827 __field(unsigned int, size)
830 TP_fast_assign(
831 __entry->dev = sb->s_dev;
832 __entry->target = bio->bi_bdev->bd_dev;
833 __entry->op = bio_op(bio);
834 __entry->op_flags = bio->bi_opf;
835 __entry->type = type;
836 __entry->sector = bio->bi_iter.bi_sector;
837 __entry->size = bio->bi_iter.bi_size;
840 TP_printk("dev = (%d,%d)/(%d,%d), rw = %s(%s), %s, sector = %lld, size = %u",
841 show_dev(__entry->target),
842 show_dev(__entry->dev),
843 show_bio_type(__entry->op, __entry->op_flags),
844 show_block_type(__entry->type),
845 (unsigned long long)__entry->sector,
846 __entry->size)
849 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio,
851 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
853 TP_ARGS(sb, type, bio),
855 TP_CONDITION(bio)
858 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio,
860 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
862 TP_ARGS(sb, type, bio),
864 TP_CONDITION(bio)
867 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_read_bio,
869 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
871 TP_ARGS(sb, type, bio),
873 TP_CONDITION(bio)
876 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio,
878 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
880 TP_ARGS(sb, type, bio),
882 TP_CONDITION(bio)
885 TRACE_EVENT(f2fs_write_begin,
887 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
888 unsigned int flags),
890 TP_ARGS(inode, pos, len, flags),
892 TP_STRUCT__entry(
893 __field(dev_t, dev)
894 __field(ino_t, ino)
895 __field(loff_t, pos)
896 __field(unsigned int, len)
897 __field(unsigned int, flags)
900 TP_fast_assign(
901 __entry->dev = inode->i_sb->s_dev;
902 __entry->ino = inode->i_ino;
903 __entry->pos = pos;
904 __entry->len = len;
905 __entry->flags = flags;
908 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
909 show_dev_ino(__entry),
910 (unsigned long long)__entry->pos,
911 __entry->len,
912 __entry->flags)
915 TRACE_EVENT(f2fs_write_end,
917 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
918 unsigned int copied),
920 TP_ARGS(inode, pos, len, copied),
922 TP_STRUCT__entry(
923 __field(dev_t, dev)
924 __field(ino_t, ino)
925 __field(loff_t, pos)
926 __field(unsigned int, len)
927 __field(unsigned int, copied)
930 TP_fast_assign(
931 __entry->dev = inode->i_sb->s_dev;
932 __entry->ino = inode->i_ino;
933 __entry->pos = pos;
934 __entry->len = len;
935 __entry->copied = copied;
938 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
939 show_dev_ino(__entry),
940 (unsigned long long)__entry->pos,
941 __entry->len,
942 __entry->copied)
945 DECLARE_EVENT_CLASS(f2fs__page,
947 TP_PROTO(struct page *page, int type),
949 TP_ARGS(page, type),
951 TP_STRUCT__entry(
952 __field(dev_t, dev)
953 __field(ino_t, ino)
954 __field(int, type)
955 __field(int, dir)
956 __field(pgoff_t, index)
957 __field(int, dirty)
958 __field(int, uptodate)
961 TP_fast_assign(
962 __entry->dev = page->mapping->host->i_sb->s_dev;
963 __entry->ino = page->mapping->host->i_ino;
964 __entry->type = type;
965 __entry->dir = S_ISDIR(page->mapping->host->i_mode);
966 __entry->index = page->index;
967 __entry->dirty = PageDirty(page);
968 __entry->uptodate = PageUptodate(page);
971 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
972 "dirty = %d, uptodate = %d",
973 show_dev_ino(__entry),
974 show_block_type(__entry->type),
975 show_file_type(__entry->dir),
976 (unsigned long)__entry->index,
977 __entry->dirty,
978 __entry->uptodate)
981 DEFINE_EVENT(f2fs__page, f2fs_writepage,
983 TP_PROTO(struct page *page, int type),
985 TP_ARGS(page, type)
988 DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
990 TP_PROTO(struct page *page, int type),
992 TP_ARGS(page, type)
995 DEFINE_EVENT(f2fs__page, f2fs_readpage,
997 TP_PROTO(struct page *page, int type),
999 TP_ARGS(page, type)
1002 DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
1004 TP_PROTO(struct page *page, int type),
1006 TP_ARGS(page, type)
1009 DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
1011 TP_PROTO(struct page *page, int type),
1013 TP_ARGS(page, type)
1016 DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
1018 TP_PROTO(struct page *page, int type),
1020 TP_ARGS(page, type)
1023 DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
1025 TP_PROTO(struct page *page, int type),
1027 TP_ARGS(page, type)
1030 TRACE_EVENT(f2fs_writepages,
1032 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
1034 TP_ARGS(inode, wbc, type),
1036 TP_STRUCT__entry(
1037 __field(dev_t, dev)
1038 __field(ino_t, ino)
1039 __field(int, type)
1040 __field(int, dir)
1041 __field(long, nr_to_write)
1042 __field(long, pages_skipped)
1043 __field(loff_t, range_start)
1044 __field(loff_t, range_end)
1045 __field(pgoff_t, writeback_index)
1046 __field(int, sync_mode)
1047 __field(char, for_kupdate)
1048 __field(char, for_background)
1049 __field(char, tagged_writepages)
1050 __field(char, for_reclaim)
1051 __field(char, range_cyclic)
1052 __field(char, for_sync)
1055 TP_fast_assign(
1056 __entry->dev = inode->i_sb->s_dev;
1057 __entry->ino = inode->i_ino;
1058 __entry->type = type;
1059 __entry->dir = S_ISDIR(inode->i_mode);
1060 __entry->nr_to_write = wbc->nr_to_write;
1061 __entry->pages_skipped = wbc->pages_skipped;
1062 __entry->range_start = wbc->range_start;
1063 __entry->range_end = wbc->range_end;
1064 __entry->writeback_index = inode->i_mapping->writeback_index;
1065 __entry->sync_mode = wbc->sync_mode;
1066 __entry->for_kupdate = wbc->for_kupdate;
1067 __entry->for_background = wbc->for_background;
1068 __entry->tagged_writepages = wbc->tagged_writepages;
1069 __entry->for_reclaim = wbc->for_reclaim;
1070 __entry->range_cyclic = wbc->range_cyclic;
1071 __entry->for_sync = wbc->for_sync;
1074 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1075 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1076 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1077 show_dev_ino(__entry),
1078 show_block_type(__entry->type),
1079 show_file_type(__entry->dir),
1080 __entry->nr_to_write,
1081 __entry->pages_skipped,
1082 __entry->range_start,
1083 __entry->range_end,
1084 (unsigned long)__entry->writeback_index,
1085 __entry->sync_mode,
1086 __entry->for_kupdate,
1087 __entry->for_background,
1088 __entry->tagged_writepages,
1089 __entry->for_reclaim,
1090 __entry->range_cyclic,
1091 __entry->for_sync)
1094 TRACE_EVENT(f2fs_readpages,
1096 TP_PROTO(struct inode *inode, struct page *page, unsigned int nrpage),
1098 TP_ARGS(inode, page, nrpage),
1100 TP_STRUCT__entry(
1101 __field(dev_t, dev)
1102 __field(ino_t, ino)
1103 __field(pgoff_t, start)
1104 __field(unsigned int, nrpage)
1107 TP_fast_assign(
1108 __entry->dev = inode->i_sb->s_dev;
1109 __entry->ino = inode->i_ino;
1110 __entry->start = page->index;
1111 __entry->nrpage = nrpage;
1114 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1115 show_dev_ino(__entry),
1116 (unsigned long)__entry->start,
1117 __entry->nrpage)
1120 TRACE_EVENT(f2fs_write_checkpoint,
1122 TP_PROTO(struct super_block *sb, int reason, char *msg),
1124 TP_ARGS(sb, reason, msg),
1126 TP_STRUCT__entry(
1127 __field(dev_t, dev)
1128 __field(int, reason)
1129 __field(char *, msg)
1132 TP_fast_assign(
1133 __entry->dev = sb->s_dev;
1134 __entry->reason = reason;
1135 __entry->msg = msg;
1138 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
1139 show_dev(__entry->dev),
1140 show_cpreason(__entry->reason),
1141 __entry->msg)
1144 DECLARE_EVENT_CLASS(f2fs_discard,
1146 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1148 TP_ARGS(dev, blkstart, blklen),
1150 TP_STRUCT__entry(
1151 __field(dev_t, dev)
1152 __field(block_t, blkstart)
1153 __field(block_t, blklen)
1156 TP_fast_assign(
1157 __entry->dev = dev->bd_dev;
1158 __entry->blkstart = blkstart;
1159 __entry->blklen = blklen;
1162 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
1163 show_dev(__entry->dev),
1164 (unsigned long long)__entry->blkstart,
1165 (unsigned long long)__entry->blklen)
1168 DEFINE_EVENT(f2fs_discard, f2fs_queue_discard,
1170 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1172 TP_ARGS(dev, blkstart, blklen)
1175 DEFINE_EVENT(f2fs_discard, f2fs_issue_discard,
1177 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1179 TP_ARGS(dev, blkstart, blklen)
1182 TRACE_EVENT(f2fs_issue_reset_zone,
1184 TP_PROTO(struct block_device *dev, block_t blkstart),
1186 TP_ARGS(dev, blkstart),
1188 TP_STRUCT__entry(
1189 __field(dev_t, dev)
1190 __field(block_t, blkstart)
1193 TP_fast_assign(
1194 __entry->dev = dev->bd_dev;
1195 __entry->blkstart = blkstart;
1198 TP_printk("dev = (%d,%d), reset zone at block = 0x%llx",
1199 show_dev(__entry->dev),
1200 (unsigned long long)__entry->blkstart)
1203 TRACE_EVENT(f2fs_issue_flush,
1205 TP_PROTO(struct block_device *dev, unsigned int nobarrier,
1206 unsigned int flush_merge, int ret),
1208 TP_ARGS(dev, nobarrier, flush_merge, ret),
1210 TP_STRUCT__entry(
1211 __field(dev_t, dev)
1212 __field(unsigned int, nobarrier)
1213 __field(unsigned int, flush_merge)
1214 __field(int, ret)
1217 TP_fast_assign(
1218 __entry->dev = dev->bd_dev;
1219 __entry->nobarrier = nobarrier;
1220 __entry->flush_merge = flush_merge;
1221 __entry->ret = ret;
1224 TP_printk("dev = (%d,%d), %s %s, ret = %d",
1225 show_dev(__entry->dev),
1226 __entry->nobarrier ? "skip (nobarrier)" : "issue",
1227 __entry->flush_merge ? " with flush_merge" : "",
1228 __entry->ret)
1231 TRACE_EVENT(f2fs_lookup_extent_tree_start,
1233 TP_PROTO(struct inode *inode, unsigned int pgofs),
1235 TP_ARGS(inode, pgofs),
1237 TP_STRUCT__entry(
1238 __field(dev_t, dev)
1239 __field(ino_t, ino)
1240 __field(unsigned int, pgofs)
1243 TP_fast_assign(
1244 __entry->dev = inode->i_sb->s_dev;
1245 __entry->ino = inode->i_ino;
1246 __entry->pgofs = pgofs;
1249 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1250 show_dev_ino(__entry),
1251 __entry->pgofs)
1254 TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1256 TP_PROTO(struct inode *inode, unsigned int pgofs,
1257 struct extent_info *ei),
1259 TP_ARGS(inode, pgofs, ei),
1261 TP_CONDITION(ei),
1263 TP_STRUCT__entry(
1264 __field(dev_t, dev)
1265 __field(ino_t, ino)
1266 __field(unsigned int, pgofs)
1267 __field(unsigned int, fofs)
1268 __field(u32, blk)
1269 __field(unsigned int, len)
1272 TP_fast_assign(
1273 __entry->dev = inode->i_sb->s_dev;
1274 __entry->ino = inode->i_ino;
1275 __entry->pgofs = pgofs;
1276 __entry->fofs = ei->fofs;
1277 __entry->blk = ei->blk;
1278 __entry->len = ei->len;
1281 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1282 "ext_info(fofs: %u, blk: %u, len: %u)",
1283 show_dev_ino(__entry),
1284 __entry->pgofs,
1285 __entry->fofs,
1286 __entry->blk,
1287 __entry->len)
1290 TRACE_EVENT(f2fs_update_extent_tree_range,
1292 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1293 unsigned int len),
1295 TP_ARGS(inode, pgofs, blkaddr, len),
1297 TP_STRUCT__entry(
1298 __field(dev_t, dev)
1299 __field(ino_t, ino)
1300 __field(unsigned int, pgofs)
1301 __field(u32, blk)
1302 __field(unsigned int, len)
1305 TP_fast_assign(
1306 __entry->dev = inode->i_sb->s_dev;
1307 __entry->ino = inode->i_ino;
1308 __entry->pgofs = pgofs;
1309 __entry->blk = blkaddr;
1310 __entry->len = len;
1313 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1314 "blkaddr = %u, len = %u",
1315 show_dev_ino(__entry),
1316 __entry->pgofs,
1317 __entry->blk,
1318 __entry->len)
1321 TRACE_EVENT(f2fs_shrink_extent_tree,
1323 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1324 unsigned int tree_cnt),
1326 TP_ARGS(sbi, node_cnt, tree_cnt),
1328 TP_STRUCT__entry(
1329 __field(dev_t, dev)
1330 __field(unsigned int, node_cnt)
1331 __field(unsigned int, tree_cnt)
1334 TP_fast_assign(
1335 __entry->dev = sbi->sb->s_dev;
1336 __entry->node_cnt = node_cnt;
1337 __entry->tree_cnt = tree_cnt;
1340 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
1341 show_dev(__entry->dev),
1342 __entry->node_cnt,
1343 __entry->tree_cnt)
1346 TRACE_EVENT(f2fs_destroy_extent_tree,
1348 TP_PROTO(struct inode *inode, unsigned int node_cnt),
1350 TP_ARGS(inode, node_cnt),
1352 TP_STRUCT__entry(
1353 __field(dev_t, dev)
1354 __field(ino_t, ino)
1355 __field(unsigned int, node_cnt)
1358 TP_fast_assign(
1359 __entry->dev = inode->i_sb->s_dev;
1360 __entry->ino = inode->i_ino;
1361 __entry->node_cnt = node_cnt;
1364 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1365 show_dev_ino(__entry),
1366 __entry->node_cnt)
1369 DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
1371 TP_PROTO(struct super_block *sb, int type, s64 count),
1373 TP_ARGS(sb, type, count),
1375 TP_STRUCT__entry(
1376 __field(dev_t, dev)
1377 __field(int, type)
1378 __field(s64, count)
1381 TP_fast_assign(
1382 __entry->dev = sb->s_dev;
1383 __entry->type = type;
1384 __entry->count = count;
1387 TP_printk("dev = (%d,%d), %s, dirty count = %lld",
1388 show_dev(__entry->dev),
1389 show_file_type(__entry->type),
1390 __entry->count)
1393 DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
1395 TP_PROTO(struct super_block *sb, int type, s64 count),
1397 TP_ARGS(sb, type, count)
1400 DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
1402 TP_PROTO(struct super_block *sb, int type, s64 count),
1404 TP_ARGS(sb, type, count)
1407 #endif /* _TRACE_F2FS_H */
1409 /* This part must be outside protection */
1410 #include <trace/define_trace.h>