From: Mike Harsch Date: Mon, 23 Apr 2012 21:52:50 +0000 (-0400) Subject: Illumos #952: separate intent logs should be obvious in 'zpool iostat' output X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=commitdiff_plain;h=187632dcef255acfbeff203d96b00904eb1e1c0a;p=zfs.git Illumos #952: separate intent logs should be obvious in 'zpool iostat' output Reviewed by: Adam Leventhal Reviewed by: Matt Ahrens Reviewed by: Eric Schrock Reviewed by: Dan McDonald Reviewed by: Garrett D'Amore Approved by: Eric Schrock Refererce to Illumos issue: https://www.illumos.org/issues/952 Ported-by: Richard Yao Signed-off-by: Brian Behlendorf Closes #607 --- diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 5dbb119..a6c5a47 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -2086,10 +2086,15 @@ print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv, return; for (c = 0; c < children; c++) { - uint64_t ishole = B_FALSE; + uint64_t ishole = B_FALSE, islog = B_FALSE; - if (nvlist_lookup_uint64(newchild[c], - ZPOOL_CONFIG_IS_HOLE, &ishole) == 0 && ishole) + (void) nvlist_lookup_uint64(newchild[c], ZPOOL_CONFIG_IS_HOLE, + &ishole); + + (void) nvlist_lookup_uint64(newchild[c], ZPOOL_CONFIG_IS_LOG, + &islog); + + if (ishole || islog) continue; vname = zpool_vdev_name(g_zfs, zhp, newchild[c], B_FALSE); @@ -2099,6 +2104,31 @@ print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv, } /* + * Log device section + */ + + if (num_logs(newnv) > 0) { + (void) printf("%-*s - - - - - " + "-\n", cb->cb_namewidth, "logs"); + + for (c = 0; c < children; c++) { + uint64_t islog = B_FALSE; + (void) nvlist_lookup_uint64(newchild[c], + ZPOOL_CONFIG_IS_LOG, &islog); + + if (islog) { + vname = zpool_vdev_name(g_zfs, zhp, newchild[c], + B_FALSE); + print_vdev_stats(zhp, vname, oldnv ? + oldchild[c] : NULL, newchild[c], + cb, depth + 2); + free(vname); + } + } + + } + + /* * Include level 2 ARC devices in iostat output */ if (nvlist_lookup_nvlist_array(newnv, ZPOOL_CONFIG_L2CACHE,