Commit 20fda56b authored by Kinglong Mee's avatar Kinglong Mee Committed by Jaegeuk Kim

f2fs: make sure trace all f2fs_issue_flush

The root device's issue flush trace is missing,
add it and tracing the result from submit.

Fixes d50aaeec ("f2fs: show actual device info in tracepoints")
Signed-off-by: default avatarKinglong Mee <kinglongmee@gmail.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 8ff0971f
...@@ -441,7 +441,8 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi) ...@@ -441,7 +441,8 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi)
} }
} }
static int __submit_flush_wait(struct block_device *bdev) static int __submit_flush_wait(struct f2fs_sb_info *sbi,
struct block_device *bdev)
{ {
struct bio *bio = f2fs_bio_alloc(0); struct bio *bio = f2fs_bio_alloc(0);
int ret; int ret;
...@@ -450,24 +451,25 @@ static int __submit_flush_wait(struct block_device *bdev) ...@@ -450,24 +451,25 @@ static int __submit_flush_wait(struct block_device *bdev)
bio->bi_bdev = bdev; bio->bi_bdev = bdev;
ret = submit_bio_wait(bio); ret = submit_bio_wait(bio);
bio_put(bio); bio_put(bio);
trace_f2fs_issue_flush(bdev, test_opt(sbi, NOBARRIER),
test_opt(sbi, FLUSH_MERGE), ret);
return ret; return ret;
} }
static int submit_flush_wait(struct f2fs_sb_info *sbi) static int submit_flush_wait(struct f2fs_sb_info *sbi)
{ {
int ret = __submit_flush_wait(sbi->sb->s_bdev); int ret = __submit_flush_wait(sbi, sbi->sb->s_bdev);
int i; int i;
if (sbi->s_ndevs && !ret) { if (!sbi->s_ndevs || ret)
return ret;
for (i = 1; i < sbi->s_ndevs; i++) { for (i = 1; i < sbi->s_ndevs; i++) {
trace_f2fs_issue_flush(FDEV(i).bdev, ret = __submit_flush_wait(sbi, FDEV(i).bdev);
test_opt(sbi, NOBARRIER),
test_opt(sbi, FLUSH_MERGE));
ret = __submit_flush_wait(FDEV(i).bdev);
if (ret) if (ret)
break; break;
} }
}
return ret; return ret;
} }
......
...@@ -1176,26 +1176,29 @@ TRACE_EVENT(f2fs_issue_reset_zone, ...@@ -1176,26 +1176,29 @@ TRACE_EVENT(f2fs_issue_reset_zone,
TRACE_EVENT(f2fs_issue_flush, TRACE_EVENT(f2fs_issue_flush,
TP_PROTO(struct block_device *dev, unsigned int nobarrier, TP_PROTO(struct block_device *dev, unsigned int nobarrier,
unsigned int flush_merge), unsigned int flush_merge, int ret),
TP_ARGS(dev, nobarrier, flush_merge), TP_ARGS(dev, nobarrier, flush_merge, ret),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(dev_t, dev) __field(dev_t, dev)
__field(unsigned int, nobarrier) __field(unsigned int, nobarrier)
__field(unsigned int, flush_merge) __field(unsigned int, flush_merge)
__field(int, ret)
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = dev->bd_dev; __entry->dev = dev->bd_dev;
__entry->nobarrier = nobarrier; __entry->nobarrier = nobarrier;
__entry->flush_merge = flush_merge; __entry->flush_merge = flush_merge;
__entry->ret = ret;
), ),
TP_printk("dev = (%d,%d), %s %s", TP_printk("dev = (%d,%d), %s %s, ret = %d",
show_dev(__entry->dev), show_dev(__entry->dev),
__entry->nobarrier ? "skip (nobarrier)" : "issue", __entry->nobarrier ? "skip (nobarrier)" : "issue",
__entry->flush_merge ? " with flush_merge" : "") __entry->flush_merge ? " with flush_merge" : "",
__entry->ret)
); );
TRACE_EVENT(f2fs_lookup_extent_tree_start, TRACE_EVENT(f2fs_lookup_extent_tree_start,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment