f2fs: cleanup parameters for trace_f2fs_submit_{read_,write_,page_,page_m}bio with fio
[GitHub/exynos8895/android_kernel_samsung_universal8895.git] / include / trace / events / f2fs.h
index d06d44363fead134ddd097535c8422162cb0987d..13992f3c14453c6a663068e51e1a9baf0deb2bcb 100644 (file)
                { GC_GREEDY,    "Greedy" },                             \
                { GC_CB,        "Cost-Benefit" })
 
+#define show_cpreason(type)                                            \
+       __print_symbolic(type,                                          \
+               { CP_UMOUNT,    "Umount" },                             \
+               { CP_SYNC,      "Sync" },                               \
+               { CP_DISCARD,   "Discard" })
+
 struct victim_sel_policy;
 
 DECLARE_EVENT_CLASS(f2fs__inode,
@@ -434,38 +440,6 @@ TRACE_EVENT(f2fs_truncate_partial_nodes,
                __entry->err)
 );
 
-TRACE_EVENT_CONDITION(f2fs_submit_page_bio,
-
-       TP_PROTO(struct page *page, sector_t blkaddr, int type),
-
-       TP_ARGS(page, blkaddr, type),
-
-       TP_CONDITION(page->mapping),
-
-       TP_STRUCT__entry(
-               __field(dev_t,  dev)
-               __field(ino_t,  ino)
-               __field(pgoff_t,        index)
-               __field(sector_t,       blkaddr)
-               __field(int,    type)
-       ),
-
-       TP_fast_assign(
-               __entry->dev            = page->mapping->host->i_sb->s_dev;
-               __entry->ino            = page->mapping->host->i_ino;
-               __entry->index          = page->index;
-               __entry->blkaddr        = blkaddr;
-               __entry->type           = type;
-       ),
-
-       TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
-               "blkaddr = 0x%llx, bio_type = %s%s",
-               show_dev_ino(__entry),
-               (unsigned long)__entry->index,
-               (unsigned long long)__entry->blkaddr,
-               show_bio_type(__entry->type))
-);
-
 TRACE_EVENT(f2fs_get_data_block,
        TP_PROTO(struct inode *inode, sector_t iblock,
                                struct buffer_head *bh, int ret),
@@ -674,11 +648,63 @@ TRACE_EVENT(f2fs_reserve_new_block,
                __entry->ofs_in_node)
 );
 
+DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
+
+       TP_PROTO(struct page *page, struct f2fs_io_info *fio),
+
+       TP_ARGS(page, fio),
+
+       TP_STRUCT__entry(
+               __field(dev_t, dev)
+               __field(ino_t, ino)
+               __field(pgoff_t, index)
+               __field(block_t, blkaddr)
+               __field(int, rw)
+               __field(int, type)
+       ),
+
+       TP_fast_assign(
+               __entry->dev            = page->mapping->host->i_sb->s_dev;
+               __entry->ino            = page->mapping->host->i_ino;
+               __entry->index          = page->index;
+               __entry->blkaddr        = fio->blk_addr;
+               __entry->rw             = fio->rw;
+               __entry->type           = fio->type;
+       ),
+
+       TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
+               "blkaddr = 0x%llx, rw = %s%s, type = %s",
+               show_dev_ino(__entry),
+               (unsigned long)__entry->index,
+               (unsigned long long)__entry->blkaddr,
+               show_bio_type(__entry->rw),
+               show_block_type(__entry->type))
+);
+
+DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
+
+       TP_PROTO(struct page *page, struct f2fs_io_info *fio),
+
+       TP_ARGS(page, fio),
+
+       TP_CONDITION(page->mapping)
+);
+
+DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_mbio,
+
+       TP_PROTO(struct page *page, struct f2fs_io_info *fio),
+
+       TP_ARGS(page, fio),
+
+       TP_CONDITION(page->mapping)
+);
+
 DECLARE_EVENT_CLASS(f2fs__submit_bio,
 
-       TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio),
+       TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
+                                               struct bio *bio),
 
-       TP_ARGS(sb, rw, type, bio),
+       TP_ARGS(sb, fio, bio),
 
        TP_STRUCT__entry(
                __field(dev_t,  dev)
@@ -690,8 +716,8 @@ DECLARE_EVENT_CLASS(f2fs__submit_bio,
 
        TP_fast_assign(
                __entry->dev            = sb->s_dev;
-               __entry->rw             = rw;
-               __entry->type           = type;
+               __entry->rw             = fio->rw;
+               __entry->type           = fio->type;
                __entry->sector         = bio->bi_iter.bi_sector;
                __entry->size           = bio->bi_iter.bi_size;
        ),
@@ -706,18 +732,20 @@ DECLARE_EVENT_CLASS(f2fs__submit_bio,
 
 DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_write_bio,
 
-       TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio),
+       TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
+                                                       struct bio *bio),
 
-       TP_ARGS(sb, rw, type, bio),
+       TP_ARGS(sb, fio, bio),
 
        TP_CONDITION(bio)
 );
 
 DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_read_bio,
 
-       TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio),
+       TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
+                                                       struct bio *bio),
 
-       TP_ARGS(sb, rw, type, bio),
+       TP_ARGS(sb, fio, bio),
 
        TP_CONDITION(bio)
 );
@@ -910,59 +938,27 @@ TRACE_EVENT(f2fs_writepages,
                __entry->for_sync)
 );
 
-TRACE_EVENT(f2fs_submit_page_mbio,
-
-       TP_PROTO(struct page *page, int rw, int type, block_t blk_addr),
-
-       TP_ARGS(page, rw, type, blk_addr),
-
-       TP_STRUCT__entry(
-               __field(dev_t,  dev)
-               __field(ino_t,  ino)
-               __field(int, rw)
-               __field(int, type)
-               __field(pgoff_t, index)
-               __field(block_t, block)
-       ),
-
-       TP_fast_assign(
-               __entry->dev    = page->mapping->host->i_sb->s_dev;
-               __entry->ino    = page->mapping->host->i_ino;
-               __entry->rw     = rw;
-               __entry->type   = type;
-               __entry->index  = page->index;
-               __entry->block  = blk_addr;
-       ),
-
-       TP_printk("dev = (%d,%d), ino = %lu, %s%s, %s, index = %lu, blkaddr = 0x%llx",
-               show_dev_ino(__entry),
-               show_bio_type(__entry->rw),
-               show_block_type(__entry->type),
-               (unsigned long)__entry->index,
-               (unsigned long long)__entry->block)
-);
-
 TRACE_EVENT(f2fs_write_checkpoint,
 
-       TP_PROTO(struct super_block *sb, bool is_umount, char *msg),
+       TP_PROTO(struct super_block *sb, int reason, char *msg),
 
-       TP_ARGS(sb, is_umount, msg),
+       TP_ARGS(sb, reason, msg),
 
        TP_STRUCT__entry(
                __field(dev_t,  dev)
-               __field(bool,   is_umount)
+               __field(int,    reason)
                __field(char *, msg)
        ),
 
        TP_fast_assign(
                __entry->dev            = sb->s_dev;
-               __entry->is_umount      = is_umount;
+               __entry->reason         = reason;
                __entry->msg            = msg;
        ),
 
        TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
                show_dev(__entry),
-               __entry->is_umount ? "clean umount" : "consistency",
+               show_cpreason(__entry->reason),
                __entry->msg)
 );