Illumos #952: separate intent logs should be obvious in 'zpool iostat' output

Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Eric Schrock <eric.schrock@delphix.com>
Reviewed by: Dan McDonald <danmcd@nexenta.com>
Reviewed by: Garrett D'Amore <garrett@nexenta.com>
Approved by: Eric Schrock <eric.schrock@delphix.com>

Refererce to Illumos issue:
  https://www.illumos.org/issues/952

Ported-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #607
This commit is contained in:
Mike Harsch 2012-04-23 17:52:50 -04:00 committed by Brian Behlendorf
parent ebf8e3a237
commit 187632dcef
1 changed files with 33 additions and 3 deletions

View File

@ -2086,10 +2086,15 @@ print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv,
return; return;
for (c = 0; c < children; c++) { 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], (void) nvlist_lookup_uint64(newchild[c], ZPOOL_CONFIG_IS_HOLE,
ZPOOL_CONFIG_IS_HOLE, &ishole) == 0 && ishole) &ishole);
(void) nvlist_lookup_uint64(newchild[c], ZPOOL_CONFIG_IS_LOG,
&islog);
if (ishole || islog)
continue; continue;
vname = zpool_vdev_name(g_zfs, zhp, newchild[c], B_FALSE); vname = zpool_vdev_name(g_zfs, zhp, newchild[c], B_FALSE);
@ -2098,6 +2103,31 @@ print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv,
free(vname); free(vname);
} }
/*
* 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 * Include level 2 ARC devices in iostat output
*/ */