From 26ccaca80bcbb1916d2135e93e0c4e7693177062 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 7 May 2020 13:30:10 -0700 Subject: [PATCH] scoutfs: add commit written counter Signed-off-by: Zach Brown --- kmod/src/counters.h | 5 +++-- kmod/src/trans.c | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kmod/src/counters.h b/kmod/src/counters.h index 74ec5147..acfe5c7a 100644 --- a/kmod/src/counters.h +++ b/kmod/src/counters.h @@ -95,10 +95,11 @@ EXPAND_COUNTER(trans_commit_fsync) \ EXPAND_COUNTER(trans_commit_full) \ EXPAND_COUNTER(trans_commit_sync_fs) \ - EXPAND_COUNTER(trans_commit_timer) + EXPAND_COUNTER(trans_commit_timer) \ + EXPAND_COUNTER(trans_commit_written) #define FIRST_COUNTER block_cache_access -#define LAST_COUNTER trans_commit_timer +#define LAST_COUNTER trans_commit_written #undef EXPAND_COUNTER #define EXPAND_COUNTER(which) struct percpu_counter which; diff --git a/kmod/src/trans.c b/kmod/src/trans.c index a3467aa6..11522c0a 100644 --- a/kmod/src/trans.c +++ b/kmod/src/trans.c @@ -169,6 +169,8 @@ void scoutfs_trans_write_func(struct work_struct *work) if (sbi->trans_deadline_expired) scoutfs_inc_counter(sb, trans_commit_timer); + scoutfs_inc_counter(sb, trans_commit_written); + ret = scoutfs_inode_walk_writeback(sb, true) ?: scoutfs_block_writer_write(sb, &tri->wri) ?: scoutfs_inode_walk_writeback(sb, false) ?: