aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ext4/ext4.h2
-rw-r--r--fs/ext4/extents.c44
-rw-r--r--fs/ext4/inode.c3
-rw-r--r--fs/ext4/migrate.c1
-rw-r--r--fs/ext4/move_extent.c1
-rw-r--r--include/trace/events/ext4.h398
6 files changed, 433 insertions, 16 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 21ea65d8bd46..751277a4890c 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2339,4 +2339,6 @@ extern void ext4_resize_end(struct super_block *sb);
2339 2339
2340#endif /* __KERNEL__ */ 2340#endif /* __KERNEL__ */
2341 2341
2342#include "ext4_extents.h"
2343
2342#endif /* _EXT4_H */ 2344#endif /* _EXT4_H */
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index c4e005864534..9b119308daea 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -42,7 +42,6 @@
42#include <asm/uaccess.h> 42#include <asm/uaccess.h>
43#include <linux/fiemap.h> 43#include <linux/fiemap.h>
44#include "ext4_jbd2.h" 44#include "ext4_jbd2.h"
45#include "ext4_extents.h"
46 45
47#include <trace/events/ext4.h> 46#include <trace/events/ext4.h>
48 47
@@ -1969,6 +1968,7 @@ ext4_ext_put_in_cache(struct inode *inode, ext4_lblk_t block,
1969 struct ext4_ext_cache *cex; 1968 struct ext4_ext_cache *cex;
1970 BUG_ON(len == 0); 1969 BUG_ON(len == 0);
1971 spin_lock(&EXT4_I(inode)->i_block_reservation_lock); 1970 spin_lock(&EXT4_I(inode)->i_block_reservation_lock);
1971 trace_ext4_ext_put_in_cache(inode, block, len, start);
1972 cex = &EXT4_I(inode)->i_cached_extent; 1972 cex = &EXT4_I(inode)->i_cached_extent;
1973 cex->ec_block = block; 1973 cex->ec_block = block;
1974 cex->ec_len = len; 1974 cex->ec_len = len;
@@ -2070,6 +2070,7 @@ errout:
2070 sbi->extent_cache_misses++; 2070 sbi->extent_cache_misses++;
2071 else 2071 else
2072 sbi->extent_cache_hits++; 2072 sbi->extent_cache_hits++;
2073 trace_ext4_ext_in_cache(inode, block, ret);
2073 spin_unlock(&EXT4_I(inode)->i_block_reservation_lock); 2074 spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
2074 return ret; 2075 return ret;
2075} 2076}
@@ -2137,6 +2138,8 @@ static int ext4_ext_rm_idx(handle_t *handle, struct inode *inode,
2137 if (err) 2138 if (err)
2138 return err; 2139 return err;
2139 ext_debug("index is empty, remove it, free block %llu\n", leaf); 2140 ext_debug("index is empty, remove it, free block %llu\n", leaf);
2141 trace_ext4_ext_rm_idx(inode, leaf);
2142
2140 ext4_free_blocks(handle, inode, NULL, leaf, 1, 2143 ext4_free_blocks(handle, inode, NULL, leaf, 1,
2141 EXT4_FREE_BLOCKS_METADATA | EXT4_FREE_BLOCKS_FORGET); 2144 EXT4_FREE_BLOCKS_METADATA | EXT4_FREE_BLOCKS_FORGET);
2142 return err; 2145 return err;
@@ -2222,6 +2225,7 @@ static int ext4_remove_blocks(handle_t *handle, struct inode *inode,
2222 */ 2225 */
2223 flags |= EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER; 2226 flags |= EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER;
2224 2227
2228 trace_ext4_remove_blocks(inode, ex, from, to, *partial_cluster);
2225 /* 2229 /*
2226 * If we have a partial cluster, and it's different from the 2230 * If we have a partial cluster, and it's different from the
2227 * cluster of the last block, we need to explicitly free the 2231 * cluster of the last block, we need to explicitly free the
@@ -2336,6 +2340,8 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode,
2336 ex_ee_block = le32_to_cpu(ex->ee_block); 2340 ex_ee_block = le32_to_cpu(ex->ee_block);
2337 ex_ee_len = ext4_ext_get_actual_len(ex); 2341 ex_ee_len = ext4_ext_get_actual_len(ex);
2338 2342
2343 trace_ext4_ext_rm_leaf(inode, start, ex, *partial_cluster);
2344
2339 while (ex >= EXT_FIRST_EXTENT(eh) && 2345 while (ex >= EXT_FIRST_EXTENT(eh) &&
2340 ex_ee_block + ex_ee_len > start) { 2346 ex_ee_block + ex_ee_len > start) {
2341 2347
@@ -2591,6 +2597,8 @@ static int ext4_ext_remove_space(struct inode *inode, ext4_lblk_t start)
2591again: 2597again:
2592 ext4_ext_invalidate_cache(inode); 2598 ext4_ext_invalidate_cache(inode);
2593 2599
2600 trace_ext4_ext_remove_space(inode, start, depth);
2601
2594 /* 2602 /*
2595 * We start scanning from right side, freeing all the blocks 2603 * We start scanning from right side, freeing all the blocks
2596 * after i_size and walking into the tree depth-wise. 2604 * after i_size and walking into the tree depth-wise.
@@ -2686,6 +2694,9 @@ again:
2686 } 2694 }
2687 } 2695 }
2688 2696
2697 trace_ext4_ext_remove_space_done(inode, start, depth, partial_cluster,
2698 path->p_hdr->eh_entries);
2699
2689 /* If we still have something in the partial cluster and we have removed 2700 /* If we still have something in the partial cluster and we have removed
2690 * even the first extent, then we should free the blocks in the partial 2701 * even the first extent, then we should free the blocks in the partial
2691 * cluster as well. */ 2702 * cluster as well. */
@@ -3300,6 +3311,10 @@ static int ext4_find_delalloc_range(struct inode *inode,
3300 * detect that here. 3311 * detect that here.
3301 */ 3312 */
3302 page_cache_release(page); 3313 page_cache_release(page);
3314 trace_ext4_find_delalloc_range(inode,
3315 lblk_start, lblk_end,
3316 search_hint_reverse,
3317 0, i);
3303 return 0; 3318 return 0;
3304 } 3319 }
3305 3320
@@ -3327,6 +3342,10 @@ static int ext4_find_delalloc_range(struct inode *inode,
3327 3342
3328 if (buffer_delay(bh)) { 3343 if (buffer_delay(bh)) {
3329 page_cache_release(page); 3344 page_cache_release(page);
3345 trace_ext4_find_delalloc_range(inode,
3346 lblk_start, lblk_end,
3347 search_hint_reverse,
3348 1, i);
3330 return 1; 3349 return 1;
3331 } 3350 }
3332 if (search_hint_reverse) 3351 if (search_hint_reverse)
@@ -3349,6 +3368,8 @@ nextpage:
3349 i = index << (PAGE_CACHE_SHIFT - inode->i_blkbits); 3368 i = index << (PAGE_CACHE_SHIFT - inode->i_blkbits);
3350 } 3369 }
3351 3370
3371 trace_ext4_find_delalloc_range(inode, lblk_start, lblk_end,
3372 search_hint_reverse, 0, 0);
3352 return 0; 3373 return 0;
3353} 3374}
3354 3375
@@ -3414,6 +3435,8 @@ get_reserved_cluster_alloc(struct inode *inode, ext4_lblk_t lblk_start,
3414 /* max possible clusters for this allocation */ 3435 /* max possible clusters for this allocation */
3415 allocated_clusters = alloc_cluster_end - alloc_cluster_start + 1; 3436 allocated_clusters = alloc_cluster_end - alloc_cluster_start + 1;
3416 3437
3438 trace_ext4_get_reserved_cluster_alloc(inode, lblk_start, num_blks);
3439
3417 /* Check towards left side */ 3440 /* Check towards left side */
3418 c_offset = lblk_start & (sbi->s_cluster_ratio - 1); 3441 c_offset = lblk_start & (sbi->s_cluster_ratio - 1);
3419 if (c_offset) { 3442 if (c_offset) {
@@ -3453,6 +3476,9 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode,
3453 flags, allocated); 3476 flags, allocated);
3454 ext4_ext_show_leaf(inode, path); 3477 ext4_ext_show_leaf(inode, path);
3455 3478
3479 trace_ext4_ext_handle_uninitialized_extents(inode, map, allocated,
3480 newblock);
3481
3456 /* get_block() before submit the IO, split the extent */ 3482 /* get_block() before submit the IO, split the extent */
3457 if ((flags & EXT4_GET_BLOCKS_PRE_IO)) { 3483 if ((flags & EXT4_GET_BLOCKS_PRE_IO)) {
3458 ret = ext4_split_unwritten_extents(handle, inode, map, 3484 ret = ext4_split_unwritten_extents(handle, inode, map,
@@ -3572,7 +3598,7 @@ out2:
3572 * get_implied_cluster_alloc - check to see if the requested 3598 * get_implied_cluster_alloc - check to see if the requested
3573 * allocation (in the map structure) overlaps with a cluster already 3599 * allocation (in the map structure) overlaps with a cluster already
3574 * allocated in an extent. 3600 * allocated in an extent.
3575 * @sbi The ext4-specific superblock structure 3601 * @sb The filesystem superblock structure
3576 * @map The requested lblk->pblk mapping 3602 * @map The requested lblk->pblk mapping
3577 * @ex The extent structure which might contain an implied 3603 * @ex The extent structure which might contain an implied
3578 * cluster allocation 3604 * cluster allocation
@@ -3609,11 +3635,12 @@ out2:
3609 * ext4_ext_map_blocks() will then allocate one or more new clusters 3635 * ext4_ext_map_blocks() will then allocate one or more new clusters
3610 * by calling ext4_mb_new_blocks(). 3636 * by calling ext4_mb_new_blocks().
3611 */ 3637 */
3612static int get_implied_cluster_alloc(struct ext4_sb_info *sbi, 3638static int get_implied_cluster_alloc(struct super_block *sb,
3613 struct ext4_map_blocks *map, 3639 struct ext4_map_blocks *map,
3614 struct ext4_extent *ex, 3640 struct ext4_extent *ex,
3615 struct ext4_ext_path *path) 3641 struct ext4_ext_path *path)
3616{ 3642{
3643 struct ext4_sb_info *sbi = EXT4_SB(sb);
3617 ext4_lblk_t c_offset = map->m_lblk & (sbi->s_cluster_ratio-1); 3644 ext4_lblk_t c_offset = map->m_lblk & (sbi->s_cluster_ratio-1);
3618 ext4_lblk_t ex_cluster_start, ex_cluster_end; 3645 ext4_lblk_t ex_cluster_start, ex_cluster_end;
3619 ext4_lblk_t rr_cluster_start, rr_cluster_end; 3646 ext4_lblk_t rr_cluster_start, rr_cluster_end;
@@ -3662,8 +3689,12 @@ static int get_implied_cluster_alloc(struct ext4_sb_info *sbi,
3662 ext4_lblk_t next = ext4_ext_next_allocated_block(path); 3689 ext4_lblk_t next = ext4_ext_next_allocated_block(path);
3663 map->m_len = min(map->m_len, next - map->m_lblk); 3690 map->m_len = min(map->m_len, next - map->m_lblk);
3664 } 3691 }
3692
3693 trace_ext4_get_implied_cluster_alloc_exit(sb, map, 1);
3665 return 1; 3694 return 1;
3666 } 3695 }
3696
3697 trace_ext4_get_implied_cluster_alloc_exit(sb, map, 0);
3667 return 0; 3698 return 0;
3668} 3699}
3669 3700
@@ -3772,6 +3803,9 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
3772 * we split out initialized portions during a write. 3803 * we split out initialized portions during a write.
3773 */ 3804 */
3774 ee_len = ext4_ext_get_actual_len(ex); 3805 ee_len = ext4_ext_get_actual_len(ex);
3806
3807 trace_ext4_ext_show_extent(inode, ee_block, ee_start, ee_len);
3808
3775 /* if found extent covers block, simply return it */ 3809 /* if found extent covers block, simply return it */
3776 if (in_range(map->m_lblk, ee_block, ee_len)) { 3810 if (in_range(map->m_lblk, ee_block, ee_len)) {
3777 ext4_fsblk_t partial_cluster = 0; 3811 ext4_fsblk_t partial_cluster = 0;
@@ -3912,7 +3946,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
3912 * by ext4_ext_find_extent() implies a cluster we can use. 3946 * by ext4_ext_find_extent() implies a cluster we can use.
3913 */ 3947 */
3914 if (cluster_offset && ex && 3948 if (cluster_offset && ex &&
3915 get_implied_cluster_alloc(sbi, map, ex, path)) { 3949 get_implied_cluster_alloc(inode->i_sb, map, ex, path)) {
3916 ar.len = allocated = map->m_len; 3950 ar.len = allocated = map->m_len;
3917 newblock = map->m_pblk; 3951 newblock = map->m_pblk;
3918 map->m_flags |= EXT4_MAP_FROM_CLUSTER; 3952 map->m_flags |= EXT4_MAP_FROM_CLUSTER;
@@ -3933,7 +3967,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
3933 /* Check if the extent after searching to the right implies a 3967 /* Check if the extent after searching to the right implies a
3934 * cluster we can use. */ 3968 * cluster we can use. */
3935 if ((sbi->s_cluster_ratio > 1) && ex2 && 3969 if ((sbi->s_cluster_ratio > 1) && ex2 &&
3936 get_implied_cluster_alloc(sbi, map, ex2, path)) { 3970 get_implied_cluster_alloc(inode->i_sb, map, ex2, path)) {
3937 ar.len = allocated = map->m_len; 3971 ar.len = allocated = map->m_len;
3938 newblock = map->m_pblk; 3972 newblock = map->m_pblk;
3939 map->m_flags |= EXT4_MAP_FROM_CLUSTER; 3973 map->m_flags |= EXT4_MAP_FROM_CLUSTER;
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 88dc63a01756..2dcd4fed96ec 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -42,7 +42,6 @@
42#include "ext4_jbd2.h" 42#include "ext4_jbd2.h"
43#include "xattr.h" 43#include "xattr.h"
44#include "acl.h" 44#include "acl.h"
45#include "ext4_extents.h"
46#include "truncate.h" 45#include "truncate.h"
47 46
48#include <trace/events/ext4.h> 47#include <trace/events/ext4.h>
@@ -268,7 +267,7 @@ void ext4_da_update_reserve_space(struct inode *inode,
268 struct ext4_inode_info *ei = EXT4_I(inode); 267 struct ext4_inode_info *ei = EXT4_I(inode);
269 268
270 spin_lock(&ei->i_block_reservation_lock); 269 spin_lock(&ei->i_block_reservation_lock);
271 trace_ext4_da_update_reserve_space(inode, used); 270 trace_ext4_da_update_reserve_space(inode, used, quota_claim);
272 if (unlikely(used > ei->i_reserved_data_blocks)) { 271 if (unlikely(used > ei->i_reserved_data_blocks)) {
273 ext4_msg(inode->i_sb, KERN_NOTICE, "%s: ino %lu, used %d " 272 ext4_msg(inode->i_sb, KERN_NOTICE, "%s: ino %lu, used %d "
274 "with only %d reserved data blocks\n", 273 "with only %d reserved data blocks\n",
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
index b57b98fb44d1..6f07a06f2437 100644
--- a/fs/ext4/migrate.c
+++ b/fs/ext4/migrate.c
@@ -15,7 +15,6 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include "ext4_jbd2.h" 17#include "ext4_jbd2.h"
18#include "ext4_extents.h"
19 18
20/* 19/*
21 * The contiguous blocks details which can be 20 * The contiguous blocks details which can be
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index f57455a1b1b2..c5826c623e7a 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -17,7 +17,6 @@
17#include <linux/quotaops.h> 17#include <linux/quotaops.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include "ext4_jbd2.h" 19#include "ext4_jbd2.h"
20#include "ext4_extents.h"
21#include "ext4.h" 20#include "ext4.h"
22 21
23/** 22/**
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index b50a54736242..c9a341e385a3 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -12,6 +12,8 @@ struct ext4_allocation_request;
12struct ext4_prealloc_space; 12struct ext4_prealloc_space;
13struct ext4_inode_info; 13struct ext4_inode_info;
14struct mpage_da_data; 14struct mpage_da_data;
15struct ext4_map_blocks;
16struct ext4_extent;
15 17
16#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) 18#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
17 19
@@ -1032,9 +1034,9 @@ TRACE_EVENT(ext4_forget,
1032); 1034);
1033 1035
1034TRACE_EVENT(ext4_da_update_reserve_space, 1036TRACE_EVENT(ext4_da_update_reserve_space,
1035 TP_PROTO(struct inode *inode, int used_blocks), 1037 TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
1036 1038
1037 TP_ARGS(inode, used_blocks), 1039 TP_ARGS(inode, used_blocks, quota_claim),
1038 1040
1039 TP_STRUCT__entry( 1041 TP_STRUCT__entry(
1040 __field( dev_t, dev ) 1042 __field( dev_t, dev )
@@ -1045,6 +1047,7 @@ TRACE_EVENT(ext4_da_update_reserve_space,
1045 __field( int, reserved_data_blocks ) 1047 __field( int, reserved_data_blocks )
1046 __field( int, reserved_meta_blocks ) 1048 __field( int, reserved_meta_blocks )
1047 __field( int, allocated_meta_blocks ) 1049 __field( int, allocated_meta_blocks )
1050 __field( int, quota_claim )
1048 ), 1051 ),
1049 1052
1050 TP_fast_assign( 1053 TP_fast_assign(
@@ -1053,19 +1056,24 @@ TRACE_EVENT(ext4_da_update_reserve_space,
1053 __entry->mode = inode->i_mode; 1056 __entry->mode = inode->i_mode;
1054 __entry->i_blocks = inode->i_blocks; 1057 __entry->i_blocks = inode->i_blocks;
1055 __entry->used_blocks = used_blocks; 1058 __entry->used_blocks = used_blocks;
1056 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks; 1059 __entry->reserved_data_blocks =
1057 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; 1060 EXT4_I(inode)->i_reserved_data_blocks;
1058 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks; 1061 __entry->reserved_meta_blocks =
1062 EXT4_I(inode)->i_reserved_meta_blocks;
1063 __entry->allocated_meta_blocks =
1064 EXT4_I(inode)->i_allocated_meta_blocks;
1065 __entry->quota_claim = quota_claim;
1059 ), 1066 ),
1060 1067
1061 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d " 1068 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
1062 "reserved_data_blocks %d reserved_meta_blocks %d " 1069 "reserved_data_blocks %d reserved_meta_blocks %d "
1063 "allocated_meta_blocks %d", 1070 "allocated_meta_blocks %d quota_claim %d",
1064 MAJOR(__entry->dev), MINOR(__entry->dev), 1071 MAJOR(__entry->dev), MINOR(__entry->dev),
1065 (unsigned long) __entry->ino, 1072 (unsigned long) __entry->ino,
1066 __entry->mode, __entry->i_blocks, 1073 __entry->mode, __entry->i_blocks,
1067 __entry->used_blocks, __entry->reserved_data_blocks, 1074 __entry->used_blocks, __entry->reserved_data_blocks,
1068 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 1075 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks,
1076 __entry->quota_claim)
1069); 1077);
1070 1078
1071TRACE_EVENT(ext4_da_reserve_space, 1079TRACE_EVENT(ext4_da_reserve_space,
@@ -1589,6 +1597,382 @@ DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
1589 TP_ARGS(sb, group, start, len) 1597 TP_ARGS(sb, group, start, len)
1590); 1598);
1591 1599
1600TRACE_EVENT(ext4_ext_handle_uninitialized_extents,
1601 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1602 unsigned int allocated, ext4_fsblk_t newblock),
1603
1604 TP_ARGS(inode, map, allocated, newblock),
1605
1606 TP_STRUCT__entry(
1607 __field( ino_t, ino )
1608 __field( dev_t, dev )
1609 __field( ext4_lblk_t, lblk )
1610 __field( ext4_fsblk_t, pblk )
1611 __field( unsigned int, len )
1612 __field( int, flags )
1613 __field( unsigned int, allocated )
1614 __field( ext4_fsblk_t, newblk )
1615 ),
1616
1617 TP_fast_assign(
1618 __entry->ino = inode->i_ino;
1619 __entry->dev = inode->i_sb->s_dev;
1620 __entry->lblk = map->m_lblk;
1621 __entry->pblk = map->m_pblk;
1622 __entry->len = map->m_len;
1623 __entry->flags = map->m_flags;
1624 __entry->allocated = allocated;
1625 __entry->newblk = newblock;
1626 ),
1627
1628 TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %d"
1629 "allocated %d newblock %llu",
1630 MAJOR(__entry->dev), MINOR(__entry->dev),
1631 (unsigned long) __entry->ino,
1632 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk,
1633 __entry->len, __entry->flags,
1634 (unsigned int) __entry->allocated,
1635 (unsigned long long) __entry->newblk)
1636);
1637
1638TRACE_EVENT(ext4_get_implied_cluster_alloc_exit,
1639 TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret),
1640
1641 TP_ARGS(sb, map, ret),
1642
1643 TP_STRUCT__entry(
1644 __field( dev_t, dev )
1645 __field( ext4_lblk_t, lblk )
1646 __field( ext4_fsblk_t, pblk )
1647 __field( unsigned int, len )
1648 __field( unsigned int, flags )
1649 __field( int, ret )
1650 ),
1651
1652 TP_fast_assign(
1653 __entry->dev = sb->s_dev;
1654 __entry->lblk = map->m_lblk;
1655 __entry->pblk = map->m_pblk;
1656 __entry->len = map->m_len;
1657 __entry->flags = map->m_flags;
1658 __entry->ret = ret;
1659 ),
1660
1661 TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %u ret %d",
1662 MAJOR(__entry->dev), MINOR(__entry->dev),
1663 __entry->lblk, (unsigned long long) __entry->pblk,
1664 __entry->len, __entry->flags, __entry->ret)
1665);
1666
1667TRACE_EVENT(ext4_ext_put_in_cache,
1668 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len,
1669 ext4_fsblk_t start),
1670
1671 TP_ARGS(inode, lblk, len, start),
1672
1673 TP_STRUCT__entry(
1674 __field( ino_t, ino )
1675 __field( dev_t, dev )
1676 __field( ext4_lblk_t, lblk )
1677 __field( unsigned int, len )
1678 __field( ext4_fsblk_t, start )
1679 ),
1680
1681 TP_fast_assign(
1682 __entry->ino = inode->i_ino;
1683 __entry->dev = inode->i_sb->s_dev;
1684 __entry->lblk = lblk;
1685 __entry->len = len;
1686 __entry->start = start;
1687 ),
1688
1689 TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu",
1690 MAJOR(__entry->dev), MINOR(__entry->dev),
1691 (unsigned long) __entry->ino,
1692 (unsigned) __entry->lblk,
1693 __entry->len,
1694 (unsigned long long) __entry->start)
1695);
1696
1697TRACE_EVENT(ext4_ext_in_cache,
1698 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret),
1699
1700 TP_ARGS(inode, lblk, ret),
1701
1702 TP_STRUCT__entry(
1703 __field( ino_t, ino )
1704 __field( dev_t, dev )
1705 __field( ext4_lblk_t, lblk )
1706 __field( int, ret )
1707 ),
1708
1709 TP_fast_assign(
1710 __entry->ino = inode->i_ino;
1711 __entry->dev = inode->i_sb->s_dev;
1712 __entry->lblk = lblk;
1713 __entry->ret = ret;
1714 ),
1715
1716 TP_printk("dev %d,%d ino %lu lblk %u ret %d",
1717 MAJOR(__entry->dev), MINOR(__entry->dev),
1718 (unsigned long) __entry->ino,
1719 (unsigned) __entry->lblk,
1720 __entry->ret)
1721
1722);
1723
1724TRACE_EVENT(ext4_find_delalloc_range,
1725 TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to,
1726 int reverse, int found, ext4_lblk_t found_blk),
1727
1728 TP_ARGS(inode, from, to, reverse, found, found_blk),
1729
1730 TP_STRUCT__entry(
1731 __field( ino_t, ino )
1732 __field( dev_t, dev )
1733 __field( ext4_lblk_t, from )
1734 __field( ext4_lblk_t, to )
1735 __field( int, reverse )
1736 __field( int, found )
1737 __field( ext4_lblk_t, found_blk )
1738 ),
1739
1740 TP_fast_assign(
1741 __entry->ino = inode->i_ino;
1742 __entry->dev = inode->i_sb->s_dev;
1743 __entry->from = from;
1744 __entry->to = to;
1745 __entry->reverse = reverse;
1746 __entry->found = found;
1747 __entry->found_blk = found_blk;
1748 ),
1749
1750 TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d "
1751 "(blk = %u)",
1752 MAJOR(__entry->dev), MINOR(__entry->dev),
1753 (unsigned long) __entry->ino,
1754 (unsigned) __entry->from, (unsigned) __entry->to,
1755 __entry->reverse, __entry->found,
1756 (unsigned) __entry->found_blk)
1757);
1758
1759TRACE_EVENT(ext4_get_reserved_cluster_alloc,
1760 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len),
1761
1762 TP_ARGS(inode, lblk, len),
1763
1764 TP_STRUCT__entry(
1765 __field( ino_t, ino )
1766 __field( dev_t, dev )
1767 __field( ext4_lblk_t, lblk )
1768 __field( unsigned int, len )
1769 ),
1770
1771 TP_fast_assign(
1772 __entry->ino = inode->i_ino;
1773 __entry->dev = inode->i_sb->s_dev;
1774 __entry->lblk = lblk;
1775 __entry->len = len;
1776 ),
1777
1778 TP_printk("dev %d,%d ino %lu lblk %u len %u",
1779 MAJOR(__entry->dev), MINOR(__entry->dev),
1780 (unsigned long) __entry->ino,
1781 (unsigned) __entry->lblk,
1782 __entry->len)
1783);
1784
1785TRACE_EVENT(ext4_ext_show_extent,
1786 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk,
1787 unsigned short len),
1788
1789 TP_ARGS(inode, lblk, pblk, len),
1790
1791 TP_STRUCT__entry(
1792 __field( ino_t, ino )
1793 __field( dev_t, dev )
1794 __field( ext4_lblk_t, lblk )
1795 __field( ext4_fsblk_t, pblk )
1796 __field( unsigned short, len )
1797 ),
1798
1799 TP_fast_assign(
1800 __entry->ino = inode->i_ino;
1801 __entry->dev = inode->i_sb->s_dev;
1802 __entry->lblk = lblk;
1803 __entry->pblk = pblk;
1804 __entry->len = len;
1805 ),
1806
1807 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u",
1808 MAJOR(__entry->dev), MINOR(__entry->dev),
1809 (unsigned long) __entry->ino,
1810 (unsigned) __entry->lblk,
1811 (unsigned long long) __entry->pblk,
1812 (unsigned short) __entry->len)
1813);
1814
1815TRACE_EVENT(ext4_remove_blocks,
1816 TP_PROTO(struct inode *inode, struct ext4_extent *ex,
1817 ext4_lblk_t from, ext4_fsblk_t to,
1818 ext4_fsblk_t partial_cluster),
1819
1820 TP_ARGS(inode, ex, from, to, partial_cluster),
1821
1822 TP_STRUCT__entry(
1823 __field( ino_t, ino )
1824 __field( dev_t, dev )
1825 __field( ext4_lblk_t, ee_lblk )
1826 __field( ext4_fsblk_t, ee_pblk )
1827 __field( unsigned short, ee_len )
1828 __field( ext4_lblk_t, from )
1829 __field( ext4_lblk_t, to )
1830 __field( ext4_fsblk_t, partial )
1831 ),
1832
1833 TP_fast_assign(
1834 __entry->ino = inode->i_ino;
1835 __entry->dev = inode->i_sb->s_dev;
1836 __entry->ee_lblk = cpu_to_le32(ex->ee_block);
1837 __entry->ee_pblk = ext4_ext_pblock(ex);
1838 __entry->ee_len = ext4_ext_get_actual_len(ex);
1839 __entry->from = from;
1840 __entry->to = to;
1841 __entry->partial = partial_cluster;
1842 ),
1843
1844 TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
1845 "from %u to %u partial_cluster %u",
1846 MAJOR(__entry->dev), MINOR(__entry->dev),
1847 (unsigned long) __entry->ino,
1848 (unsigned) __entry->ee_lblk,
1849 (unsigned long long) __entry->ee_pblk,
1850 (unsigned short) __entry->ee_len,
1851 (unsigned) __entry->from,
1852 (unsigned) __entry->to,
1853 (unsigned) __entry->partial)
1854);
1855
1856TRACE_EVENT(ext4_ext_rm_leaf,
1857 TP_PROTO(struct inode *inode, ext4_lblk_t start,
1858 struct ext4_extent *ex, ext4_fsblk_t partial_cluster),
1859
1860 TP_ARGS(inode, start, ex, partial_cluster),
1861
1862 TP_STRUCT__entry(
1863 __field( ino_t, ino )
1864 __field( dev_t, dev )
1865 __field( ext4_lblk_t, start )
1866 __field( ext4_lblk_t, ee_lblk )
1867 __field( ext4_fsblk_t, ee_pblk )
1868 __field( short, ee_len )
1869 __field( ext4_fsblk_t, partial )
1870 ),
1871
1872 TP_fast_assign(
1873 __entry->ino = inode->i_ino;
1874 __entry->dev = inode->i_sb->s_dev;
1875 __entry->start = start;
1876 __entry->ee_lblk = le32_to_cpu(ex->ee_block);
1877 __entry->ee_pblk = ext4_ext_pblock(ex);
1878 __entry->ee_len = ext4_ext_get_actual_len(ex);
1879 __entry->partial = partial_cluster;
1880 ),
1881
1882 TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
1883 "partial_cluster %u",
1884 MAJOR(__entry->dev), MINOR(__entry->dev),
1885 (unsigned long) __entry->ino,
1886 (unsigned) __entry->start,
1887 (unsigned) __entry->ee_lblk,
1888 (unsigned long long) __entry->ee_pblk,
1889 (unsigned short) __entry->ee_len,
1890 (unsigned) __entry->partial)
1891);
1892
1893TRACE_EVENT(ext4_ext_rm_idx,
1894 TP_PROTO(struct inode *inode, ext4_fsblk_t pblk),
1895
1896 TP_ARGS(inode, pblk),
1897
1898 TP_STRUCT__entry(
1899 __field( ino_t, ino )
1900 __field( dev_t, dev )
1901 __field( ext4_fsblk_t, pblk )
1902 ),
1903
1904 TP_fast_assign(
1905 __entry->ino = inode->i_ino;
1906 __entry->dev = inode->i_sb->s_dev;
1907 __entry->pblk = pblk;
1908 ),
1909
1910 TP_printk("dev %d,%d ino %lu index_pblk %llu",
1911 MAJOR(__entry->dev), MINOR(__entry->dev),
1912 (unsigned long) __entry->ino,
1913 (unsigned long long) __entry->pblk)
1914);
1915
1916TRACE_EVENT(ext4_ext_remove_space,
1917 TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth),
1918
1919 TP_ARGS(inode, start, depth),
1920
1921 TP_STRUCT__entry(
1922 __field( ino_t, ino )
1923 __field( dev_t, dev )
1924 __field( ext4_lblk_t, start )
1925 __field( int, depth )
1926 ),
1927
1928 TP_fast_assign(
1929 __entry->ino = inode->i_ino;
1930 __entry->dev = inode->i_sb->s_dev;
1931 __entry->start = start;
1932 __entry->depth = depth;
1933 ),
1934
1935 TP_printk("dev %d,%d ino %lu since %u depth %d",
1936 MAJOR(__entry->dev), MINOR(__entry->dev),
1937 (unsigned long) __entry->ino,
1938 (unsigned) __entry->start,
1939 __entry->depth)
1940);
1941
1942TRACE_EVENT(ext4_ext_remove_space_done,
1943 TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth,
1944 ext4_lblk_t partial, unsigned short eh_entries),
1945
1946 TP_ARGS(inode, start, depth, partial, eh_entries),
1947
1948 TP_STRUCT__entry(
1949 __field( ino_t, ino )
1950 __field( dev_t, dev )
1951 __field( ext4_lblk_t, start )
1952 __field( int, depth )
1953 __field( ext4_lblk_t, partial )
1954 __field( unsigned short, eh_entries )
1955 ),
1956
1957 TP_fast_assign(
1958 __entry->ino = inode->i_ino;
1959 __entry->dev = inode->i_sb->s_dev;
1960 __entry->start = start;
1961 __entry->depth = depth;
1962 __entry->partial = partial;
1963 __entry->eh_entries = eh_entries;
1964 ),
1965
1966 TP_printk("dev %d,%d ino %lu since %u depth %d partial %u "
1967 "remaining_entries %u",
1968 MAJOR(__entry->dev), MINOR(__entry->dev),
1969 (unsigned long) __entry->ino,
1970 (unsigned) __entry->start,
1971 __entry->depth,
1972 (unsigned) __entry->partial,
1973 (unsigned short) __entry->eh_entries)
1974);
1975
1592#endif /* _TRACE_EXT4_H */ 1976#endif /* _TRACE_EXT4_H */
1593 1977
1594/* This part must be outside protection */ 1978/* This part must be outside protection */