1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Import upstream changesets for the output of the "zpool" command:

952 separate intent logs should be obvious in 'zpool iostat' output
1337 `zpool status -D' should tell if there are no DDT entries

References:
https://www.illumos.org/issues/952
https://www.illumos.org/issues/1337

Obtained from:	Illumos (issues 952, 1337; changesets 13384, 13432)
MFC after:	1 week
This commit is contained in:
Martin Matuska 2011-11-14 08:29:49 +00:00
parent cfb09e00e6
commit 3cfcf4ce74
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227497

View File

@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
#include <solaris.h>
@ -2206,10 +2207,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);
@ -2218,6 +2224,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
*/
@ -3565,10 +3596,16 @@ print_dedup_stats(nvlist_t *config)
* table continue processing the stats.
*/
if (nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_OBJ_STATS,
(uint64_t **)&ddo, &c) != 0 || ddo->ddo_count == 0)
(uint64_t **)&ddo, &c) != 0)
return;
(void) printf("\n");
(void) printf(gettext(" dedup: "));
if (ddo->ddo_count == 0) {
(void) printf(gettext("no DDT entries\n"));
return;
}
(void) printf("DDT entries %llu, size %llu on disk, %llu in core\n",
(u_longlong_t)ddo->ddo_count,
(u_longlong_t)ddo->ddo_dspace,