f2fs: add a tracepoint for f2fs_issue_discard
authorJaegeuk Kim <jaegeuk.kim@samsung.com>
Tue, 12 Nov 2013 08:01:00 +0000 (17:01 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Mon, 23 Dec 2013 01:18:00 +0000 (10:18 +0900)
This patch adds a tracepoint for f2fs_issue_discard.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/segment.c
include/trace/events/f2fs.h

index c51fa4bee60bf087ea2e4482bc58807c7a3ba56b..cfc0eb4f24d528f8a62d217952fec617b48e2769 100644 (file)
@@ -272,6 +272,7 @@ static void f2fs_issue_discard(struct f2fs_sb_info *sbi,
        sector_t start = ((sector_t)blkstart) << sbi->log_sectors_per_block;
        sector_t len = ((sector_t)blklen) << sbi->log_sectors_per_block;
        blkdev_issue_discard(sbi->sb->s_bdev, start, len, GFP_NOFS, 0);
+       trace_f2fs_issue_discard(sbi->sb, blkstart, blklen);
 }
 
 static void add_discard_addrs(struct f2fs_sb_info *sbi,
index e0dc355fa3179658a2b99660fd6fca0ca0a80937..47ee70de7fedd0f72e1e0588234b3e7dab18ed2b 100644 (file)
@@ -727,6 +727,29 @@ TRACE_EVENT(f2fs_write_checkpoint,
                __entry->msg)
 );
 
+TRACE_EVENT(f2fs_issue_discard,
+
+       TP_PROTO(struct super_block *sb, block_t blkstart, block_t blklen),
+
+       TP_ARGS(sb, blkstart, blklen),
+
+       TP_STRUCT__entry(
+               __field(dev_t,  dev)
+               __field(block_t, blkstart)
+               __field(block_t, blklen)
+       ),
+
+       TP_fast_assign(
+               __entry->dev    = sb->s_dev;
+               __entry->blkstart = blkstart;
+               __entry->blklen = blklen;
+       ),
+
+       TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
+               show_dev(__entry),
+               (unsigned long long)__entry->blkstart,
+               (unsigned long long)__entry->blklen)
+);
 #endif /* _TRACE_F2FS_H */
 
  /* This part must be outside protection */