f2fstat: add nat caches and free nids
authorChangman Lee <cm224.lee@samsung.com>
Thu, 13 Feb 2014 06:13:23 +0000 (15:13 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Fri, 14 Feb 2014 02:12:07 +0000 (11:12 +0900)
This patch shows nat caches and free nids using f2fs.

Signed-off-by: Changman Lee <cm224.lee@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
tools/f2fstat.c

index 73ad457..c9c1d30 100644 (file)
@@ -97,6 +97,7 @@ void f2fstat(struct options *opt)
                { "  - SITs",           &dirty_sit,             0 },
                { "  - Valid",          &valid_segs,            0 },
                { "  - dents",          &dirty_dents,           0 },
+               { "  - free_nids",      &free_nids,             0 },
                { "  - meta",           &dirty_meta,            KEY_META },
                { "  - nodes",          &dirty_node,            KEY_NODE },
                { "CP calls",           &cp,                    0 },
@@ -213,13 +214,13 @@ void parse_option(int argc, char *argv[], struct options *opt)
 
 void print_head(void)
 {
-       fprintf(stderr, "---utilization--- -----------main area-------- ---balancing async-- -gc- ---alloc--- -----memory-----\n");
-       fprintf(stderr, "util  node   data   free  valid  dirty prefree node  dent meta sit  cp   gc    ssr    lfs  total  node  meta\n");
+       fprintf(stderr, "---utilization--- -----------main area-------- ---------balancing async------- ---gc--- ---alloc--- -----memory-----\n");
+       fprintf(stderr, "util  node   data   free  valid  dirty prefree node  dent meta  sit   nat fnid  cp   gc    ssr    lfs  total  node  meta\n");
 }
 
 int main(int argc, char *argv[])
 {
-       char format[] = "%3ld %6ld %6ld %6ld %6ld %6ld %6ld %5ld %5ld %3ld %3ld %3ld %5ld %6ld %6ld %6ld %6ld %6ld\n";
+       char format[] = "%3ld %6ld %6ld %6ld %6ld %6ld %6ld %5ld %5ld %3ld %5ld %5ld %3ld %3ld %3ld %6ld %6ld %6ld %6ld %6ld\n";
        int head_interval;
        struct options opt = {
                .delay = 1,
@@ -241,7 +242,7 @@ int main(int argc, char *argv[])
 
                fprintf(stderr, format, util, used_node_blks, used_data_blks,
                        free_segs, valid_segs, dirty_segs, prefree_segs,
-                       dirty_node, dirty_dents, dirty_meta, dirty_sit,
+                       dirty_node, dirty_dents, dirty_meta, dirty_sit, nat_caches, free_nids,
                        cp, gc, ssr_blks, lfs_blks, memory_kb, node_kb, meta_kb);
 
                sleep(opt.delay);