scoutfs: add counters for items written in level 0

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2018-04-27 13:28:08 -07:00
committed by Zach Brown
parent e227c6446e
commit 1c5d84fa3e
2 changed files with 9 additions and 3 deletions

View File

@@ -115,11 +115,12 @@
EXPAND_COUNTER(trans_commit_sync_fs) \
EXPAND_COUNTER(trans_commit_timer) \
EXPAND_COUNTER(trans_level0_seg_write_bytes) \
EXPAND_COUNTER(trans_level0_seg_writes)
EXPAND_COUNTER(trans_level0_seg_writes) \
EXPAND_COUNTER(trans_write_item) \
EXPAND_COUNTER(trans_write_deletion_item)
#define FIRST_COUNTER btree_read_error
#define LAST_COUNTER trans_level0_seg_writes
#define LAST_COUNTER trans_write_deletion_item
#undef EXPAND_COUNTER
#define EXPAND_COUNTER(which) struct percpu_counter which;

View File

@@ -1734,6 +1734,11 @@ int scoutfs_item_dirty_seg(struct super_block *sb, struct scoutfs_segment *seg)
/* trans reservation should have limited dirty */
BUG_ON(!appended);
if (item->deletion)
scoutfs_inc_counter(sb, trans_write_deletion_item);
else
scoutfs_inc_counter(sb, trans_write_item);
clear_item_dirty(sb, cac, item);
del = item;