Skip to contentSkip to conversation

f2fs: adds a tracepoint for f2fs_submit_read_bio

PATCH In review Chao Yu 2 participants 2 messages Nov 20, 2013 – Nov 24, 2013

Subsystems (3)
lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 2/2 f2fs: adds a tracepoint for f2fs_submit_read_bio

This patch adds a tracepoint for f2fs_submit_read_bio.

---
 fs/f2fs/data.c              |    2 ++
 include/trace/events/f2fs.h |   27 +++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)
fs/f2fs/data.c +2 -0
index 0ca93be..c9e9d79 100644
@@ -407,6 +407,8 @@ void f2fs_submit_read_bio(struct f2fs_sb_info *sbi, int rw)
 	if (!io->bio)
 		return;
 
+	trace_f2fs_submit_read_bio(sbi->sb, rw, io->bio);
+
 	mutex_lock(&io->io_mutex);
 	if (io->bio) {
 		submit_bio(rw, io->bio);
include/trace/events/f2fs.h +27 -0
index 571f39a..ac970e3 100644
@@ -453,6 +453,33 @@ TRACE_EVENT_CONDITION(f2fs_readpage,
 		show_bio_type(__entry->type))
 );
 
+TRACE_EVENT(f2fs_submit_read_bio,
+
+	TP_PROTO(struct super_block *sb, int rw, struct bio *bio),
+
+	TP_ARGS(sb, rw, bio),
+
+	TP_STRUCT__entry(
+		__field(dev_t,	dev)
+		__field(int,	rw)
+		__field(sector_t,	sector)
+		__field(unsigned int,	size)
+	),
+
+	TP_fast_assign(
+		__entry->dev		= sb->s_dev;
+		__entry->rw		= rw;
+		__entry->sector		= bio->bi_sector;
+		__entry->size		= bio->bi_size;
+	),
+
+	TP_printk("dev = (%d,%d), bio_type = %s, sector = %lld, size = %u",
+		show_dev(__entry),
+		show_bio_type(__entry->rw),
+		(unsigned long long)__entry->sector,
+		__entry->size)
+);
+
 TRACE_EVENT(f2fs_submit_read_page,
 
 	TP_PROTO(struct page *page, block_t blk_addr, int rw),
Signature · 1 line
1.7.9.5
#1 lore raw

Hi,

Again, this tracepoint alos can be integrated with write_bios like this.

Quoted 1 line

From e0360910b24624e40d92eb2e1949914339b83881 Mon Sep 17 00:00:00 2001

From: Chao Yu <[email protected]>
Date: Sun, 24 Nov 2013 12:36:42 +0900
Subject: [PATCH] f2fs: adds a tracepoint for f2fs_submit_read_bio

This patch adds a tracepoint for f2fs_submit_read_bio.

[Jaegeuk Kim: integrate tracepoints of f2fs_submit_read(_write)_bio]
---
 fs/f2fs/data.c              |  2 ++
 fs/f2fs/segment.c           |  5 +++--
 include/trace/events/f2fs.h | 49
+++++++++++++++++++++++++++++----------------
 3 files changed, 37 insertions(+), 19 deletions(-)
fs/f2fs/data.c +0 -0
index cdb342e..7117220 100644
@@ -421,6 +421,8 @@ void f2fs_submit_read_bio(struct f2fs_sb_info *sbi,

int rw)
if (!io->bio)
return;

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

fs/f2fs/segment.c +3 -2
index 264a5ff..3aad374 100644
@@ -846,6 +846,9 @@ static void do_submit_bio(struct f2fs_sb_info *sbi,
 
 	if (type >= META_FLUSH)
 		rw = WRITE_FLUSH_FUA;
+
+	trace_f2fs_submit_write_bio(sbi->sb, rw, btype, io->bio);
+
 	if (btype == META)
 		rw |= REQ_META;
 
@@ -853,8 +856,6 @@ static void do_submit_bio(struct f2fs_sb_info *sbi,
 	p->sbi = sbi;
 	io->bio->bi_end_io = f2fs_end_io_write;
 
-	trace_f2fs_do_submit_bio(sbi->sb, btype, sync, io->bio);
-
 	if (type == META_FLUSH) {
 		DECLARE_COMPLETION_ONSTACK(wait);
 		p->is_sync = true;
include/trace/events/f2fs.h +9 -9
index 73cc5f0..1f59f5d 100644
@@ -18,13 +18,14 @@
 
 #define show_bio_type(type)						\
 	__print_symbolic(type,						\
-		{ READ, 	"READ" },				\
-		{ READA, 	"READAHEAD" },				\
-		{ READ_SYNC, 	"READ_SYNC" },				\
-		{ WRITE, 	"WRITE" },				\
-		{ WRITE_SYNC, 	"WRITE_SYNC" },				\
-		{ WRITE_FLUSH,	"WRITE_FLUSH" },			\
-		{ WRITE_FUA, 	"WRITE_FUA" })
+		{ READ, 		"READ" },			\
+		{ READA, 		"READAHEAD" },			\
+		{ READ_SYNC, 		"READ_SYNC" },			\
+		{ WRITE, 		"WRITE" },			\
+		{ WRITE_SYNC, 		"WRITE_SYNC" },			\
+		{ WRITE_FLUSH,		"WRITE_FLUSH" },		\
+		{ WRITE_FUA, 		"WRITE_FUA" },			\
+		{ WRITE_FLUSH_FUA,	"WRITE_FLUSH_FUA" })
 
 #define show_data_type(type)						\
 	__print_symbolic(type,						\
@@ -598,36 +599,50 @@ TRACE_EVENT(f2fs_reserve_new_block,
 		__entry->ofs_in_node)
 );
 
-TRACE_EVENT(f2fs_do_submit_bio,
+DECLARE_EVENT_CLASS(f2fs__submit_bio,
 
-	TP_PROTO(struct super_block *sb, int btype, bool sync, struct bio

*bio),
+ TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio),

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

TP_STRUCT__entry(
__field(dev_t, dev)
- __field(int, btype)
- __field(bool, sync)
+ __field(int, rw)
+ __field(int, type)
__field(sector_t, sector)
__field(unsigned int, size)
),

TP_fast_assign(
__entry->dev = sb->s_dev;
- __entry->btype = btype;
- __entry->sync = sync;
+ __entry->rw = rw;
+ __entry->type = type;
__entry->sector = bio->bi_sector;
__entry->size = bio->bi_size;
),

- TP_printk("dev = (%d,%d), type = %s, io = %s, sector = %lld, size = %
u",
+ TP_printk("dev = (%d,%d), %s, %s, sector = %lld, size = %u",
show_dev(__entry),
- show_block_type(__entry->btype),
- __entry->sync ? "sync" : "no sync",
+ show_bio_type(__entry->rw),
+ show_block_type(__entry->type),
(unsigned long long)__entry->sector, __entry->size)
);

+DEFINE_EVENT(f2fs__submit_bio, f2fs_submit_write_bio, +
+ TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio),
+
+ TP_ARGS(sb, rw, type, bio)
+);
+
+DEFINE_EVENT(f2fs__submit_bio, f2fs_submit_read_bio, +
+ TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio),
+
+ TP_ARGS(sb, rw, type, bio)
+);
+
DECLARE_EVENT_CLASS(f2fs__page,

TP_PROTO(struct page *page, int type),

Signature · 15 lines
1.8.4.474.g128a96c



-- 
Jaegeuk Kim
Samsung


------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk