aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/f2fs/segment.c5
-rw-r--r--include/trace/events/f2fs.h67
2 files changed, 72 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 7c67ec2b63c0..0a652848a9f8 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -18,6 +18,7 @@
18#include "f2fs.h" 18#include "f2fs.h"
19#include "segment.h" 19#include "segment.h"
20#include "node.h" 20#include "node.h"
21#include <trace/events/f2fs.h>
21 22
22/* 23/*
23 * This function balances dirty node and dentry pages. 24 * This function balances dirty node and dentry pages.
@@ -691,6 +692,9 @@ static void do_submit_bio(struct f2fs_sb_info *sbi,
691 struct bio_private *p = sbi->bio[btype]->bi_private; 692 struct bio_private *p = sbi->bio[btype]->bi_private;
692 p->sbi = sbi; 693 p->sbi = sbi;
693 sbi->bio[btype]->bi_end_io = f2fs_end_io_write; 694 sbi->bio[btype]->bi_end_io = f2fs_end_io_write;
695
696 trace_f2fs_do_submit_bio(sbi->sb, btype, sync, sbi->bio[btype]);
697
694 if (type == META_FLUSH) { 698 if (type == META_FLUSH) {
695 DECLARE_COMPLETION_ONSTACK(wait); 699 DECLARE_COMPLETION_ONSTACK(wait);
696 p->is_sync = true; 700 p->is_sync = true;
@@ -745,6 +749,7 @@ alloc_new:
745 sbi->last_block_in_bio[type] = blk_addr; 749 sbi->last_block_in_bio[type] = blk_addr;
746 750
747 up_write(&sbi->bio_sem); 751 up_write(&sbi->bio_sem);
752 trace_f2fs_submit_write_page(page, blk_addr, type);
748} 753}
749 754
750static bool __has_curseg_space(struct f2fs_sb_info *sbi, int type) 755static bool __has_curseg_space(struct f2fs_sb_info *sbi, int type)
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index 56b6240e6c01..ae2da92e0768 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -8,6 +8,14 @@
8 8
9#define show_dev(entry) MAJOR(entry->dev), MINOR(entry->dev) 9#define show_dev(entry) MAJOR(entry->dev), MINOR(entry->dev)
10#define show_dev_ino(entry) show_dev(entry), (unsigned long)entry->ino 10#define show_dev_ino(entry) show_dev(entry), (unsigned long)entry->ino
11
12#define show_block_type(type) \
13 __print_symbolic(type, \
14 { NODE, "NODE" }, \
15 { DATA, "DATA" }, \
16 { META, "META" }, \
17 { META_FLUSH, "META_FLUSH" })
18
11#define show_bio_type(type) \ 19#define show_bio_type(type) \
12 __print_symbolic(type, \ 20 __print_symbolic(type, \
13 { READ, "READ" }, \ 21 { READ, "READ" }, \
@@ -578,6 +586,65 @@ TRACE_EVENT(f2fs_reserve_new_block,
578 __entry->ofs_in_node) 586 __entry->ofs_in_node)
579); 587);
580 588
589TRACE_EVENT(f2fs_do_submit_bio,
590
591 TP_PROTO(struct super_block *sb, int btype, bool sync, struct bio *bio),
592
593 TP_ARGS(sb, btype, sync, bio),
594
595 TP_STRUCT__entry(
596 __field(dev_t, dev)
597 __field(int, btype)
598 __field(bool, sync)
599 __field(sector_t, sector)
600 __field(unsigned int, size)
601 ),
602
603 TP_fast_assign(
604 __entry->dev = sb->s_dev;
605 __entry->btype = btype;
606 __entry->sync = sync;
607 __entry->sector = bio->bi_sector;
608 __entry->size = bio->bi_size;
609 ),
610
611 TP_printk("dev = (%d,%d), type = %s, io = %s, sector = %lld, size = %u",
612 show_dev(__entry),
613 show_block_type(__entry->btype),
614 __entry->sync ? "sync" : "no sync",
615 (unsigned long long)__entry->sector,
616 __entry->size)
617);
618
619TRACE_EVENT(f2fs_submit_write_page,
620
621 TP_PROTO(struct page *page, block_t blk_addr, int type),
622
623 TP_ARGS(page, blk_addr, type),
624
625 TP_STRUCT__entry(
626 __field(dev_t, dev)
627 __field(ino_t, ino)
628 __field(int, type)
629 __field(pgoff_t, index)
630 __field(block_t, block)
631 ),
632
633 TP_fast_assign(
634 __entry->dev = page->mapping->host->i_sb->s_dev;
635 __entry->ino = page->mapping->host->i_ino;
636 __entry->type = type;
637 __entry->index = page->index;
638 __entry->block = blk_addr;
639 ),
640
641 TP_printk("dev = (%d,%d), ino = %lu, %s, index = %lu, blkaddr = 0x%llx",
642 show_dev_ino(__entry),
643 show_block_type(__entry->type),
644 (unsigned long)__entry->index,
645 (unsigned long long)__entry->block)
646);
647
581#endif /* _TRACE_F2FS_H */ 648#endif /* _TRACE_F2FS_H */
582 649
583 /* This part must be outside protection */ 650 /* This part must be outside protection */