From dd96867b90a01e3eb9e8ec1a5cb486ccffa49d47 Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Sat, 12 Nov 2016 03:23:52 +0900 Subject: [PATCH] sbin/hammer: Cleanup zone statistics --- sbin/hammer/cmd_blockmap.c | 8 ++++---- sbin/hammer/cmd_show.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sbin/hammer/cmd_blockmap.c b/sbin/hammer/cmd_blockmap.c index d6bc636c86..b153fd981f 100644 --- a/sbin/hammer/cmd_blockmap.c +++ b/sbin/hammer/cmd_blockmap.c @@ -199,14 +199,14 @@ dump_blockmap(int zone) printf("\n"); } - if (VerboseOpt) + if (stats) hammer_add_zone_stat_layer2(stats, layer2); } } rel_buffer(buffer1); rel_buffer(buffer2); - if (VerboseOpt) { + if (stats) { hammer_print_zone_stat(stats); hammer_cleanup_zone_stat(stats); } @@ -546,7 +546,7 @@ dump_collect_table(void) } assert(RB_EMPTY(&CollectTree)); - if (VerboseOpt) { + if (stats) { hammer_print_zone_stat(stats); hammer_cleanup_zone_stat(stats); } @@ -586,7 +586,7 @@ dump_collect(collect_t collect, struct zone_stat *stats) (zone == HAMMER_ZONE_FREEMAP_INDEX) || hammer_is_zone2_mapped_index(zone)); } - if (VerboseOpt) + if (stats) hammer_add_zone_stat_layer2(stats, layer2); if (track2->zone != layer2->zone) { diff --git a/sbin/hammer/cmd_show.c b/sbin/hammer/cmd_show.c index 7c6a629f11..197ac4d134 100644 --- a/sbin/hammer/cmd_show.c +++ b/sbin/hammer/cmd_show.c @@ -148,7 +148,7 @@ hammer_cmd_show(const char *arg, int filter, int obfuscate, int indent) } print_btree(ondisk->vol0_btree_root); - if (VerboseOpt) { + if (stats) { hammer_print_zone_stat(stats); hammer_cleanup_zone_stat(stats); } @@ -228,7 +228,7 @@ print_btree_node(hammer_off_t node_offset, print_bigblock_fill(node_offset); printf(" {\n"); - if (VerboseOpt) + if (opt.stats) hammer_add_zone_stat(opt.stats, node_offset, sizeof(*node)); for (i = 0; i < node->count; ++i) { @@ -433,7 +433,7 @@ print_btree_elm(hammer_node_ondisk_t node, hammer_off_t node_offset, print_bigblock_fill(elm->leaf.data_offset); if (QuietOpt < 2) print_record(elm); - if (VerboseOpt) + if (opt.stats) hammer_add_zone_stat(opt.stats, elm->leaf.data_offset, elm->leaf.data_len); @@ -1066,7 +1066,7 @@ hammer_cmd_show_undo(void) printf(" <"); printf("\n"); - if (VerboseOpt) + if (stats) hammer_add_zone_stat(stats, scan_offset, hdr->hdr_size); if ((hdr->hdr_size & HAMMER_HEAD_ALIGN_MASK) || @@ -1082,7 +1082,7 @@ hammer_cmd_show_undo(void) } rel_buffer(data_buffer); - if (VerboseOpt) { + if (stats) { hammer_print_zone_stat(stats); hammer_cleanup_zone_stat(stats); } -- 2.11.4.GIT