sbin/hammer: Make hammer show support zone statistics
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Thu, 23 Jul 2015 20:35:50 +0000 (05:35 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Fri, 24 Jul 2015 20:22:52 +0000 (05:22 +0900)
commite9976f43cdc0359bfbbecf8170aeaf345fe76235
treef1ad340e9671a3a337f9fbf8d6b842a340b47a13
parent284b6ac2233b48babbf2e87b06195473e0681e93
sbin/hammer: Make hammer show support zone statistics

- Update zone statistics while iterating btree and
  print them after btree-walk is done.

- The zone statistics is enabled when -v is specified just
  like hammer checkmap.

- hammer show's statistics use elm->leaf.data_len for used
  bytes, so it could have different number from blockmap/
  checkmap statistics (blockmap/checkmap statistics will
  have the same or higher used bytes as well as percentage).

- Newly added item count is always 0 on blockmap/checkmap
  statistics while it has >0 for zone 8,9,10,11 for show.
  Both hammer blockmap/checkmap are not aware of items in
  each big-block so they can't count items. The idea of
  item is countable only when iterating btree.
sbin/hammer/cmd_show.c
sbin/hammer/hammer_util.h
sbin/hammer/misc.c