Skip to content

Commit 1c2238b

Browse files
Jaegeuk Kimpundiramit
authored andcommitted
f2fs: add submit_bio tracepoint
commit 554b5125f5cfca6653461fd52bad24d4ef35ec29 upstream. This patch adds final submit_bio() tracepoint. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 919fe37 commit 1c2238b

2 files changed

Lines changed: 38 additions & 19 deletions

File tree

fs/f2fs/data.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ static inline void __submit_bio(struct f2fs_sb_info *sbi,
176176
current->plug && (type == DATA || type == NODE))
177177
blk_finish_plug(current->plug);
178178
}
179+
if (is_read_io(bio_op(bio)))
180+
trace_f2fs_submit_read_bio(sbi->sb, type, bio);
181+
else
182+
trace_f2fs_submit_write_bio(sbi->sb, type, bio);
179183
submit_bio(0, bio);
180184
}
181185

@@ -186,12 +190,12 @@ static void __submit_merged_bio(struct f2fs_bio_info *io)
186190
if (!io->bio)
187191
return;
188192

193+
bio_set_op_attrs(io->bio, fio->op, fio->op_flags);
194+
189195
if (is_read_io(fio->op))
190-
trace_f2fs_submit_read_bio(io->sbi->sb, fio, io->bio);
196+
trace_f2fs_prepare_read_bio(io->sbi->sb, fio->type, io->bio);
191197
else
192-
trace_f2fs_submit_write_bio(io->sbi->sb, fio, io->bio);
193-
194-
bio_set_op_attrs(io->bio, fio->op, fio->op_flags);
198+
trace_f2fs_prepare_write_bio(io->sbi->sb, fio->type, io->bio);
195199

196200
__submit_bio(io->sbi, io->bio, fio->type);
197201
io->bio = NULL;

include/trace/events/f2fs.h

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -779,12 +779,11 @@ DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_mbio,
779779
TP_CONDITION(page->mapping)
780780
);
781781

782-
DECLARE_EVENT_CLASS(f2fs__submit_bio,
782+
DECLARE_EVENT_CLASS(f2fs__bio,
783783

784-
TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
785-
struct bio *bio),
784+
TP_PROTO(struct super_block *sb, int type, struct bio *bio),
786785

787-
TP_ARGS(sb, fio, bio),
786+
TP_ARGS(sb, type, bio),
788787

789788
TP_STRUCT__entry(
790789
__field(dev_t, dev)
@@ -797,9 +796,9 @@ DECLARE_EVENT_CLASS(f2fs__submit_bio,
797796

798797
TP_fast_assign(
799798
__entry->dev = sb->s_dev;
800-
__entry->op = fio->op;
801-
__entry->op_flags = fio->op_flags;
802-
__entry->type = fio->type;
799+
__entry->op = bio_op(bio);
800+
__entry->op_flags = bio->bi_rw;
801+
__entry->type = type;
803802
__entry->sector = bio->bi_iter.bi_sector;
804803
__entry->size = bio->bi_iter.bi_size;
805804
),
@@ -812,22 +811,38 @@ DECLARE_EVENT_CLASS(f2fs__submit_bio,
812811
__entry->size)
813812
);
814813

815-
DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_write_bio,
814+
DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio,
815+
816+
TP_PROTO(struct super_block *sb, int type, struct bio *bio),
817+
818+
TP_ARGS(sb, type, bio),
819+
820+
TP_CONDITION(bio)
821+
);
822+
823+
DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio,
824+
825+
TP_PROTO(struct super_block *sb, int type, struct bio *bio),
826+
827+
TP_ARGS(sb, type, bio),
828+
829+
TP_CONDITION(bio)
830+
);
831+
832+
DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_read_bio,
816833

817-
TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
818-
struct bio *bio),
834+
TP_PROTO(struct super_block *sb, int type, struct bio *bio),
819835

820-
TP_ARGS(sb, fio, bio),
836+
TP_ARGS(sb, type, bio),
821837

822838
TP_CONDITION(bio)
823839
);
824840

825-
DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_read_bio,
841+
DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio,
826842

827-
TP_PROTO(struct super_block *sb, struct f2fs_io_info *fio,
828-
struct bio *bio),
843+
TP_PROTO(struct super_block *sb, int type, struct bio *bio),
829844

830-
TP_ARGS(sb, fio, bio),
845+
TP_ARGS(sb, type, bio),
831846

832847
TP_CONDITION(bio)
833848
);

0 commit comments

Comments
 (0)