Skip to content

Commit

Permalink
ext4: add tracepoint in punching hole
Browse files Browse the repository at this point in the history
This patch adds a tracepoint in ext4_punch_hole.

CC: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Zheng Liu authored and Theodore Ts'o committed Jan 17, 2013
1 parent 7f51186 commit aaddea8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3567,6 +3567,8 @@ int ext4_punch_hole(struct file *file, loff_t offset, loff_t length)
return -EOPNOTSUPP;
}

trace_ext4_punch_hole(inode, offset, length);

return ext4_ext_punch_hole(file, offset, length);
}

Expand Down
25 changes: 25 additions & 0 deletions include/trace/events/ext4.h
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,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),

Expand Down

0 comments on commit aaddea8

Please sign in to comment.