diff options
author | Qu Wenruo <wqu@suse.com> | 2017-12-12 15:34:35 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-03-31 02:01:05 +0200 |
commit | 4ee0d8832c2ecd08fd4ccbaa55484e6a500f2f34 (patch) | |
tree | e9bb320db4632705a96dee98fc36640c4be3b0cd /include/trace | |
parent | 8287475a20552af66b32c07704dbdbeeb898ac1f (diff) | |
download | linux-stable-4ee0d8832c2ecd08fd4ccbaa55484e6a500f2f34.tar.gz linux-stable-4ee0d8832c2ecd08fd4ccbaa55484e6a500f2f34.tar.bz2 linux-stable-4ee0d8832c2ecd08fd4ccbaa55484e6a500f2f34.zip |
btrfs: qgroup: Update trace events for metadata reservation
Now trace_qgroup_meta_reserve() will have extra type parameter.
And introduce two new trace events:
1) trace_qgroup_meta_free_all_pertrans()
For btrfs_qgroup_free_meta_all_pertrans()
2) trace_qgroup_meta_convert()
For btrfs_qgroup_convert_reserved_meta()
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/btrfs.h | 55 |
1 files changed, 53 insertions, 2 deletions
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index eee778ba1414..965c650a5273 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h @@ -1663,6 +1663,28 @@ TRACE_EVENT(qgroup_update_reserve, TRACE_EVENT(qgroup_meta_reserve, + TP_PROTO(struct btrfs_root *root, s64 diff, int type), + + TP_ARGS(root, diff, type), + + TP_STRUCT__entry_btrfs( + __field( u64, refroot ) + __field( s64, diff ) + __field( int, type ) + ), + + TP_fast_assign_btrfs(root->fs_info, + __entry->refroot = root->objectid; + __entry->diff = diff; + ), + + TP_printk_btrfs("refroot=%llu(%s) type=%s diff=%lld", + show_root_type(__entry->refroot), + show_qgroup_rsv_type(__entry->type), __entry->diff) +); + +TRACE_EVENT(qgroup_meta_convert, + TP_PROTO(struct btrfs_root *root, s64 diff), TP_ARGS(root, diff), @@ -1670,6 +1692,7 @@ TRACE_EVENT(qgroup_meta_reserve, TP_STRUCT__entry_btrfs( __field( u64, refroot ) __field( s64, diff ) + __field( int, type ) ), TP_fast_assign_btrfs(root->fs_info, @@ -1677,8 +1700,36 @@ TRACE_EVENT(qgroup_meta_reserve, __entry->diff = diff; ), - TP_printk_btrfs("refroot=%llu(%s) diff=%lld", - show_root_type(__entry->refroot), __entry->diff) + TP_printk_btrfs("refroot=%llu(%s) type=%s->%s diff=%lld", + show_root_type(__entry->refroot), + show_qgroup_rsv_type(BTRFS_QGROUP_RSV_META_PREALLOC), + show_qgroup_rsv_type(BTRFS_QGROUP_RSV_META_PERTRANS), + __entry->diff) +); + +TRACE_EVENT(qgroup_meta_free_all_pertrans, + + TP_PROTO(struct btrfs_root *root), + + TP_ARGS(root), + + TP_STRUCT__entry_btrfs( + __field( u64, refroot ) + __field( s64, diff ) + __field( int, type ) + ), + + TP_fast_assign_btrfs(root->fs_info, + __entry->refroot = root->objectid; + spin_lock(&root->qgroup_meta_rsv_lock); + __entry->diff = -(s64)root->qgroup_meta_rsv_pertrans; + spin_unlock(&root->qgroup_meta_rsv_lock); + __entry->type = BTRFS_QGROUP_RSV_META_PERTRANS; + ), + + TP_printk_btrfs("refroot=%llu(%s) type=%s diff=%lld", + show_root_type(__entry->refroot), + show_qgroup_rsv_type(__entry->type), __entry->diff) ); DECLARE_EVENT_CLASS(btrfs__prelim_ref, |