summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/debug.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-08-19 19:12:20 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-08-21 22:45:15 -0700
commit91c481fff92c705dd382f1f53c01e6b6b88507d0 (patch)
tree5a4192bcf89ce525bd9992cf879c16f886acf035 /fs/f2fs/debug.c
parente2b4e2bc8865e03eecd49caa9713a2402a96bba9 (diff)
downloadblackbird-obmc-linux-91c481fff92c705dd382f1f53c01e6b6b88507d0.tar.gz
blackbird-obmc-linux-91c481fff92c705dd382f1f53c01e6b6b88507d0.zip
f2fs: add largest/cached stat in extent cache
This patch adds to stat the hit count of largest/cached node for showing in debugfs. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/debug.c')
-rw-r--r--fs/f2fs/debug.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index bc215fd6c402..1a1a4c67a9bf 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -33,6 +33,8 @@ static void update_general_status(struct f2fs_sb_info *sbi)
int i;
/* validation check of the segment numbers */
+ si->hit_largest = atomic_read(&sbi->read_hit_largest);
+ si->hit_cached = atomic_read(&sbi->read_hit_cached);
si->hit_ext = atomic_read(&sbi->read_hit_ext);
si->total_ext = atomic_read(&sbi->total_hit_ext);
si->ext_tree = sbi->total_ext_tree;
@@ -279,8 +281,9 @@ static int stat_show(struct seq_file *s, void *v)
si->bg_data_blks);
seq_printf(s, " - node blocks : %d (%d)\n", si->node_blks,
si->bg_node_blks);
- seq_printf(s, "\nExtent Hit Ratio: %d / %d\n",
- si->hit_ext, si->total_ext);
+ seq_printf(s, "\nExtent Hit Ratio: L1-1:%d L1-2:%d L2:%d / %d\n",
+ si->hit_largest, si->hit_cached,
+ si->hit_ext, si->total_ext);
seq_printf(s, "\nExtent Tree Count: %d\n", si->ext_tree);
seq_printf(s, "\nExtent Node Count: %d\n", si->ext_node);
seq_puts(s, "\nBalancing F2FS Async:\n");
@@ -371,6 +374,8 @@ int f2fs_build_stats(struct f2fs_sb_info *sbi)
atomic_set(&sbi->total_hit_ext, 0);
atomic_set(&sbi->read_hit_ext, 0);
+ atomic_set(&sbi->read_hit_largest, 0);
+ atomic_set(&sbi->read_hit_cached, 0);
atomic_set(&sbi->inline_xattr, 0);
atomic_set(&sbi->inline_inode, 0);
OpenPOWER on IntegriCloud