summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2011-11-14 08:29:49 +0000
committermm <mm@FreeBSD.org>2011-11-14 08:29:49 +0000
commitc416d11ddd7bb4cff6be0efc747de97adc90a2b3 (patch)
treeec90a9c5285a3c8b4c52f84e6b22437f787483c0 /cddl
parentfe73343e27407772b7f52898eb83bdbc6f68bdaa (diff)
downloadFreeBSD-src-c416d11ddd7bb4cff6be0efc747de97adc90a2b3.zip
FreeBSD-src-c416d11ddd7bb4cff6be0efc747de97adc90a2b3.tar.gz
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
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/cmd/zpool/zpool_main.c45
1 files changed, 41 insertions, 4 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
index 849f0e0..cb09d7b 100644
--- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
+++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
@@ -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);
@@ -2219,6 +2225,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,
@@ -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,
OpenPOWER on IntegriCloud