diff options
author | Jiaying Zhang <jiayingz@google.com> | 2011-03-21 21:38:05 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-03-21 21:38:05 -0400 |
commit | 0562e0bad483d10e9651fbb8f21dc3d0bad57374 (patch) | |
tree | 19f6597f92c028badcb6df360ccac22240378e25 /fs/ext4/extents.c | |
parent | 4596fe07679ff0fae904515691ea747467614871 (diff) |
ext4: add more tracepoints and use dev_t in the trace buffer
- Add more ext4 tracepoints.
- Change ext4 tracepoints to use dev_t field with MAJOR/MINOR macros
so that we can save 4 bytes in the ring buffer on some platforms.
- Add sync_mode to ext4_da_writepages, ext4_da_write_pages, and
ext4_da_writepages_result tracepoints. Also remove for_reclaim
field from ext4_da_writepages since it is usually not very useful.
Signed-off-by: Jiaying Zhang <jiayingz@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 9ea1bc64ca6d..f46f6e3c02d7 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -44,6 +44,8 @@ | |||
44 | #include "ext4_jbd2.h" | 44 | #include "ext4_jbd2.h" |
45 | #include "ext4_extents.h" | 45 | #include "ext4_extents.h" |
46 | 46 | ||
47 | #include <trace/events/ext4.h> | ||
48 | |||
47 | static int ext4_ext_truncate_extend_restart(handle_t *handle, | 49 | static int ext4_ext_truncate_extend_restart(handle_t *handle, |
48 | struct inode *inode, | 50 | struct inode *inode, |
49 | int needed) | 51 | int needed) |
@@ -664,6 +666,8 @@ ext4_ext_find_extent(struct inode *inode, ext4_lblk_t block, | |||
664 | if (unlikely(!bh)) | 666 | if (unlikely(!bh)) |
665 | goto err; | 667 | goto err; |
666 | if (!bh_uptodate_or_lock(bh)) { | 668 | if (!bh_uptodate_or_lock(bh)) { |
669 | trace_ext4_ext_load_extent(inode, block, | ||
670 | path[ppos].p_block); | ||
667 | if (bh_submit_read(bh) < 0) { | 671 | if (bh_submit_read(bh) < 0) { |
668 | put_bh(bh); | 672 | put_bh(bh); |
669 | goto err; | 673 | goto err; |
@@ -3297,7 +3301,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, | |||
3297 | struct ext4_ext_path *path = NULL; | 3301 | struct ext4_ext_path *path = NULL; |
3298 | struct ext4_extent_header *eh; | 3302 | struct ext4_extent_header *eh; |
3299 | struct ext4_extent newex, *ex; | 3303 | struct ext4_extent newex, *ex; |
3300 | ext4_fsblk_t newblock; | 3304 | ext4_fsblk_t newblock = 0; |
3301 | int err = 0, depth, ret; | 3305 | int err = 0, depth, ret; |
3302 | unsigned int allocated = 0; | 3306 | unsigned int allocated = 0; |
3303 | struct ext4_allocation_request ar; | 3307 | struct ext4_allocation_request ar; |
@@ -3305,6 +3309,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, | |||
3305 | 3309 | ||
3306 | ext_debug("blocks %u/%u requested for inode %lu\n", | 3310 | ext_debug("blocks %u/%u requested for inode %lu\n", |
3307 | map->m_lblk, map->m_len, inode->i_ino); | 3311 | map->m_lblk, map->m_len, inode->i_ino); |
3312 | trace_ext4_ext_map_blocks_enter(inode, map->m_lblk, map->m_len, flags); | ||
3308 | 3313 | ||
3309 | /* check in cache */ | 3314 | /* check in cache */ |
3310 | if (ext4_ext_in_cache(inode, map->m_lblk, &newex)) { | 3315 | if (ext4_ext_in_cache(inode, map->m_lblk, &newex)) { |
@@ -3525,6 +3530,8 @@ out2: | |||
3525 | ext4_ext_drop_refs(path); | 3530 | ext4_ext_drop_refs(path); |
3526 | kfree(path); | 3531 | kfree(path); |
3527 | } | 3532 | } |
3533 | trace_ext4_ext_map_blocks_exit(inode, map->m_lblk, | ||
3534 | newblock, map->m_len, err ? err : allocated); | ||
3528 | return err ? err : allocated; | 3535 | return err ? err : allocated; |
3529 | } | 3536 | } |
3530 | 3537 | ||
@@ -3658,6 +3665,7 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len) | |||
3658 | if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) | 3665 | if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) |
3659 | return -EOPNOTSUPP; | 3666 | return -EOPNOTSUPP; |
3660 | 3667 | ||
3668 | trace_ext4_fallocate_enter(inode, offset, len, mode); | ||
3661 | map.m_lblk = offset >> blkbits; | 3669 | map.m_lblk = offset >> blkbits; |
3662 | /* | 3670 | /* |
3663 | * We can't just convert len to max_blocks because | 3671 | * We can't just convert len to max_blocks because |
@@ -3673,6 +3681,7 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len) | |||
3673 | ret = inode_newsize_ok(inode, (len + offset)); | 3681 | ret = inode_newsize_ok(inode, (len + offset)); |
3674 | if (ret) { | 3682 | if (ret) { |
3675 | mutex_unlock(&inode->i_mutex); | 3683 | mutex_unlock(&inode->i_mutex); |
3684 | trace_ext4_fallocate_exit(inode, offset, max_blocks, ret); | ||
3676 | return ret; | 3685 | return ret; |
3677 | } | 3686 | } |
3678 | retry: | 3687 | retry: |
@@ -3717,6 +3726,8 @@ retry: | |||
3717 | goto retry; | 3726 | goto retry; |
3718 | } | 3727 | } |
3719 | mutex_unlock(&inode->i_mutex); | 3728 | mutex_unlock(&inode->i_mutex); |
3729 | trace_ext4_fallocate_exit(inode, offset, max_blocks, | ||
3730 | ret > 0 ? ret2 : ret); | ||
3720 | return ret > 0 ? ret2 : ret; | 3731 | return ret > 0 ? ret2 : ret; |
3721 | } | 3732 | } |
3722 | 3733 | ||