From 91c481fff92c705dd382f1f53c01e6b6b88507d0 Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Wed, 19 Aug 2015 19:12:20 +0800 Subject: 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 Signed-off-by: Jaegeuk Kim --- fs/f2fs/debug.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'fs/f2fs/debug.c') 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); -- cgit v1.2.1