Skip to content

Commit d4d288b

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: adds a tracepoint for f2fs_submit_read_bio
This patch adds a tracepoint for f2fs_submit_read_bio. Signed-off-by: Chao Yu <chao2.yu@samsung.com> [Jaegeuk Kim: integrate tracepoints of f2fs_submit_read(_write)_bio] Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
1 parent 87b8872 commit d4d288b

3 files changed

Lines changed: 37 additions & 19 deletions

File tree

‎fs/f2fs/data.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,8 @@ void f2fs_submit_read_bio(struct f2fs_sb_info *sbi, int rw)
421421
if (!io->bio)
422422
return;
423423

424+
trace_f2fs_submit_read_bio(sbi->sb, rw, META, io->bio);
425+
424426
mutex_lock(&io->io_mutex);
425427
if (io->bio) {
426428
submit_bio(rw, io->bio);

‎fs/f2fs/segment.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,15 +844,16 @@ static void do_submit_bio(struct f2fs_sb_info *sbi,
844844

845845
if (type >= META_FLUSH)
846846
rw = WRITE_FLUSH_FUA;
847+
848+
trace_f2fs_submit_write_bio(sbi->sb, rw, btype, io->bio);
849+
847850
if (btype == META)
848851
rw |= REQ_META;
849852

850853
p = io->bio->bi_private;
851854
p->sbi = sbi;
852855
io->bio->bi_end_io = f2fs_end_io_write;
853856

854-
trace_f2fs_do_submit_bio(sbi->sb, btype, sync, io->bio);
855-
856857
if (type == META_FLUSH) {
857858
DECLARE_COMPLETION_ONSTACK(wait);
858859
p->is_sync = true;

‎include/trace/events/f2fs.h‎

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818

1919
#define show_bio_type(type) \
2020
__print_symbolic(type, \
21-
{ READ, "READ" }, \
22-
{ READA, "READAHEAD" }, \
23-
{ READ_SYNC, "READ_SYNC" }, \
24-
{ WRITE, "WRITE" }, \
25-
{ WRITE_SYNC, "WRITE_SYNC" }, \
26-
{ WRITE_FLUSH, "WRITE_FLUSH" }, \
27-
{ WRITE_FUA, "WRITE_FUA" })
21+
{ READ, "READ" }, \
22+
{ READA, "READAHEAD" }, \
23+
{ READ_SYNC, "READ_SYNC" }, \
24+
{ WRITE, "WRITE" }, \
25+
{ WRITE_SYNC, "WRITE_SYNC" }, \
26+
{ WRITE_FLUSH, "WRITE_FLUSH" }, \
27+
{ WRITE_FUA, "WRITE_FUA" }, \
28+
{ WRITE_FLUSH_FUA, "WRITE_FLUSH_FUA" })
2829

2930
#define show_data_type(type) \
3031
__print_symbolic(type, \
@@ -598,36 +599,50 @@ TRACE_EVENT(f2fs_reserve_new_block,
598599
__entry->ofs_in_node)
599600
);
600601

601-
TRACE_EVENT(f2fs_do_submit_bio,
602+
DECLARE_EVENT_CLASS(f2fs__submit_bio,
602603

603-
TP_PROTO(struct super_block *sb, int btype, bool sync, struct bio *bio),
604+
TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio),
604605

605-
TP_ARGS(sb, btype, sync, bio),
606+
TP_ARGS(sb, rw, type, bio),
606607

607608
TP_STRUCT__entry(
608609
__field(dev_t, dev)
609-
__field(int, btype)
610-
__field(bool, sync)
610+
__field(int, rw)
611+
__field(int, type)
611612
__field(sector_t, sector)
612613
__field(unsigned int, size)
613614
),
614615

615616
TP_fast_assign(
616617
__entry->dev = sb->s_dev;
617-
__entry->btype = btype;
618-
__entry->sync = sync;
618+
__entry->rw = rw;
619+
__entry->type = type;
619620
__entry->sector = bio->bi_sector;
620621
__entry->size = bio->bi_size;
621622
),
622623

623-
TP_printk("dev = (%d,%d), type = %s, io = %s, sector = %lld, size = %u",
624+
TP_printk("dev = (%d,%d), %s, %s, sector = %lld, size = %u",
624625
show_dev(__entry),
625-
show_block_type(__entry->btype),
626-
__entry->sync ? "sync" : "no sync",
626+
show_bio_type(__entry->rw),
627+
show_block_type(__entry->type),
627628
(unsigned long long)__entry->sector,
628629
__entry->size)
629630
);
630631

632+
DEFINE_EVENT(f2fs__submit_bio, f2fs_submit_write_bio,
633+
634+
TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio),
635+
636+
TP_ARGS(sb, rw, type, bio)
637+
);
638+
639+
DEFINE_EVENT(f2fs__submit_bio, f2fs_submit_read_bio,
640+
641+
TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio),
642+
643+
TP_ARGS(sb, rw, type, bio)
644+
);
645+
631646
DECLARE_EVENT_CLASS(f2fs__page,
632647

633648
TP_PROTO(struct page *page, int type),

0 commit comments

Comments
 (0)