diff mbox

[3/3] ext4: add tracepoint in punching hole

Message ID 1345695941-15053-4-git-send-email-wenqing.lz@taobao.com
State Accepted, archived
Headers show

Commit Message

Zheng Liu Aug. 23, 2012, 4:25 a.m. UTC
From: Zheng Liu <wenqing.lz@taobao.com>

This patch adds a tracepoint in ext4_punch_hole.

CC: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 fs/ext4/inode.c             |    2 ++
 include/trace/events/ext4.h |   25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

Comments

Theodore Ts'o Jan. 17, 2013, 3:38 a.m. UTC | #1
On Thu, Aug 23, 2012 at 12:25:41PM +0800, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@taobao.com>
> 
> This patch adds a tracepoint in ext4_punch_hole.
> 
> CC: Lukas Czerner <lczerner@redhat.com>
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>

I'm still waiting for the next version of the indirect punch patches
(which you said you'd work on after the extent status patches, given
that I had noted other xfstest failures that were apparently caused by
these patches), but in the mean time, adding a tracepoint for
ext4_punch_hole() seem like it would make sense, so I've applied this
patch to the ext4 tree.

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Zheng Liu Jan. 18, 2013, 2:28 a.m. UTC | #2
On Wed, Jan 16, 2013 at 10:38:22PM -0500, Theodore Ts'o wrote:
> On Thu, Aug 23, 2012 at 12:25:41PM +0800, Zheng Liu wrote:
> > From: Zheng Liu <wenqing.lz@taobao.com>
> > 
> > This patch adds a tracepoint in ext4_punch_hole.
> > 
> > CC: Lukas Czerner <lczerner@redhat.com>
> > Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
> 
> I'm still waiting for the next version of the indirect punch patches
> (which you said you'd work on after the extent status patches, given
> that I had noted other xfstest failures that were apparently caused by
> these patches), but in the mean time, adding a tracepoint for
> ext4_punch_hole() seem like it would make sense, so I've applied this
> patch to the ext4 tree.

Oops, my apology.  I forgot to CC' patches [1] to you.  It is my fault.
This patch should be fine because there is no any changes.  I will
rebase the others against 3.8-rc3, and run xfstest to make sure that it
is OK.  Later I will resend them to the mailling list.

1. http://comments.gmane.org/gmane.comp.file-systems.ext4/35491

Thanks,
                                                - Zheng
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index dde62e0..169eab3 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3495,6 +3495,8 @@  int ext4_punch_hole(struct file *file, loff_t offset, loff_t length)
 	if (!S_ISREG(inode->i_mode))
 		return -EOPNOTSUPP;
 
+	trace_ext4_punch_hole(inode, offset, length);
+
 	if (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
 		return ext4_ind_punch_hole(file, offset, length);
 
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 69d8a69..58bec84 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -1311,6 +1311,31 @@  TRACE_EVENT(ext4_fallocate_exit,
 		  __entry->ret)
 );
 
+TRACE_EVENT(ext4_punch_hole,
+	TP_PROTO(struct inode *inode, loff_t offset, loff_t len),
+
+	TP_ARGS(inode, offset, len),
+
+	TP_STRUCT__entry(
+		__field(	dev_t,	dev			)
+		__field(	ino_t,	ino			)
+		__field(	loff_t,	offset			)
+		__field(	loff_t, len			)
+	),
+
+	TP_fast_assign(
+		__entry->dev	= inode->i_sb->s_dev;
+		__entry->ino	= inode->i_ino;
+		__entry->offset	= offset;
+		__entry->len	= len;
+	),
+
+	TP_printk("dev %d,%d ino %lu offset %lld len %lld",
+		  MAJOR(__entry->dev), MINOR(__entry->dev),
+		  (unsigned long) __entry->ino,
+		  __entry->offset, __entry->len)
+);
+
 TRACE_EVENT(ext4_unlink_enter,
 	TP_PROTO(struct inode *parent, struct dentry *dentry),