aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/qgroup.c
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.de>2016-03-29 20:19:55 -0400
committerDavid Sterba <dsterba@suse.com>2016-04-04 10:29:22 -0400
commit0f5dcf8de974db5970d48d12a202997baa2846a1 (patch)
tree46fcf009452af19d1c76b5f06d4facdfc3f98064 /fs/btrfs/qgroup.c
parentc79b4713304f812d3d6c95826fc3e5fc2c0b0c14 (diff)
btrfs: Add qgroup tracing
This patch adds tracepoints to the qgroup code on both the reporting side (insert_dirty_extents) and the accounting side. Taken together it allows us to see what qgroup operations have happened, and what their result was. Signed-off-by: Mark Fasheh <mfasheh@suse.de> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/qgroup.c')
-rw-r--r--fs/btrfs/qgroup.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 7173360eea7a..9e119552ed32 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1463,6 +1463,7 @@ struct btrfs_qgroup_extent_record
1463 u64 bytenr = record->bytenr; 1463 u64 bytenr = record->bytenr;
1464 1464
1465 assert_spin_locked(&delayed_refs->lock); 1465 assert_spin_locked(&delayed_refs->lock);
1466 trace_btrfs_qgroup_insert_dirty_extent(record);
1466 1467
1467 while (*p) { 1468 while (*p) {
1468 parent_node = *p; 1469 parent_node = *p;
@@ -1594,6 +1595,9 @@ static int qgroup_update_counters(struct btrfs_fs_info *fs_info,
1594 cur_old_count = btrfs_qgroup_get_old_refcnt(qg, seq); 1595 cur_old_count = btrfs_qgroup_get_old_refcnt(qg, seq);
1595 cur_new_count = btrfs_qgroup_get_new_refcnt(qg, seq); 1596 cur_new_count = btrfs_qgroup_get_new_refcnt(qg, seq);
1596 1597
1598 trace_qgroup_update_counters(qg->qgroupid, cur_old_count,
1599 cur_new_count);
1600
1597 /* Rfer update part */ 1601 /* Rfer update part */
1598 if (cur_old_count == 0 && cur_new_count > 0) { 1602 if (cur_old_count == 0 && cur_new_count > 0) {
1599 qg->rfer += num_bytes; 1603 qg->rfer += num_bytes;
@@ -1683,6 +1687,9 @@ btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans,
1683 goto out_free; 1687 goto out_free;
1684 BUG_ON(!fs_info->quota_root); 1688 BUG_ON(!fs_info->quota_root);
1685 1689
1690 trace_btrfs_qgroup_account_extent(bytenr, num_bytes, nr_old_roots,
1691 nr_new_roots);
1692
1686 qgroups = ulist_alloc(GFP_NOFS); 1693 qgroups = ulist_alloc(GFP_NOFS);
1687 if (!qgroups) { 1694 if (!qgroups) {
1688 ret = -ENOMEM; 1695 ret = -ENOMEM;
@@ -1752,6 +1759,8 @@ int btrfs_qgroup_account_extents(struct btrfs_trans_handle *trans,
1752 record = rb_entry(node, struct btrfs_qgroup_extent_record, 1759 record = rb_entry(node, struct btrfs_qgroup_extent_record,
1753 node); 1760 node);
1754 1761
1762 trace_btrfs_qgroup_account_extents(record);
1763
1755 if (!ret) { 1764 if (!ret) {
1756 /* 1765 /*
1757 * Use (u64)-1 as time_seq to do special search, which 1766 * Use (u64)-1 as time_seq to do special search, which