Skip to content

Commit 6442550

Browse files
naotakdave
authored andcommitted
btrfs: tracepoints: also show actual number of the outstanding extents
The btrfs_inode_mod_outstanding_extents trace event only shows the modified number to the number of outstanding extents. It would be helpful if we can see the resulting extent number as well. Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent c9e561c commit 6442550

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

fs/btrfs/btrfs_inode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static inline void btrfs_mod_outstanding_extents(struct btrfs_inode *inode,
332332
if (btrfs_is_free_space_inode(inode))
333333
return;
334334
trace_btrfs_inode_mod_outstanding_extents(inode->root, btrfs_ino(inode),
335-
mod);
335+
mod, inode->outstanding_extents);
336336
}
337337

338338
/*

include/trace/events/btrfs.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,25 +2011,27 @@ DEFINE_EVENT(btrfs__prelim_ref, btrfs_prelim_ref_insert,
20112011
);
20122012

20132013
TRACE_EVENT(btrfs_inode_mod_outstanding_extents,
2014-
TP_PROTO(const struct btrfs_root *root, u64 ino, int mod),
2014+
TP_PROTO(const struct btrfs_root *root, u64 ino, int mod, unsigned outstanding),
20152015

2016-
TP_ARGS(root, ino, mod),
2016+
TP_ARGS(root, ino, mod, outstanding),
20172017

20182018
TP_STRUCT__entry_btrfs(
20192019
__field( u64, root_objectid )
20202020
__field( u64, ino )
20212021
__field( int, mod )
2022+
__field( unsigned, outstanding )
20222023
),
20232024

20242025
TP_fast_assign_btrfs(root->fs_info,
20252026
__entry->root_objectid = root->root_key.objectid;
20262027
__entry->ino = ino;
20272028
__entry->mod = mod;
2029+
__entry->outstanding = outstanding;
20282030
),
20292031

2030-
TP_printk_btrfs("root=%llu(%s) ino=%llu mod=%d",
2032+
TP_printk_btrfs("root=%llu(%s) ino=%llu mod=%d outstanding=%u",
20312033
show_root_type(__entry->root_objectid),
2032-
__entry->ino, __entry->mod)
2034+
__entry->ino, __entry->mod, __entry->outstanding)
20332035
);
20342036

20352037
DECLARE_EVENT_CLASS(btrfs__block_group,

0 commit comments

Comments
 (0)