Skip to content

Commit

Permalink
Illumos #952: separate intent logs should be obvious in 'zpool iostat…
Browse files Browse the repository at this point in the history
…' output

Reviewed by: Adam Leventhal <[email protected]>
Reviewed by: Matt Ahrens <[email protected]>
Reviewed by: Eric Schrock <[email protected]>
Reviewed by: Dan McDonald <[email protected]>
Reviewed by: Garrett D'Amore <[email protected]>
Approved by: Eric Schrock <[email protected]>

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

Ported-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #607
  • Loading branch information
mharsch authored and behlendorf committed Apr 27, 2012
1 parent ebf8e3a commit 187632d
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -2098,6 +2103,31 @@ print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv,
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
*/
Expand Down

0 comments on commit 187632d

Please sign in to comment.