usr/src/cmd/mdb/common/modules/zfs/zfs.c
changeset 13700 2889e2596bd6
parent 13315 23dca344544a
child 13780 6da32a929222
equal deleted inserted replaced
13699:733714f4dc24 13700:2889e2596bd6
    19  * CDDL HEADER END
    19  * CDDL HEADER END
    20  */
    20  */
    21 /*
    21 /*
    22  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    22  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    23  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
    23  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
       
    24  * Copyright (c) 2012 by Delphix. All rights reserved.
    24  */
    25  */
    25 
    26 
    26 /* Portions Copyright 2010 Robert Milkowski */
    27 /* Portions Copyright 2010 Robert Milkowski */
    27 
    28 
    28 #include <mdb/mdb_ctf.h>
    29 #include <mdb/mdb_ctf.h>
  1235 			aux = "VERS_NEWER";
  1236 			aux = "VERS_NEWER";
  1236 			break;
  1237 			break;
  1237 		case VDEV_AUX_VERSION_OLDER:
  1238 		case VDEV_AUX_VERSION_OLDER:
  1238 			aux = "VERS_OLDER";
  1239 			aux = "VERS_OLDER";
  1239 			break;
  1240 			break;
       
  1241 		case VDEV_AUX_UNSUP_FEAT:
       
  1242 			aux = "UNSUP_FEAT";
       
  1243 			break;
  1240 		case VDEV_AUX_SPARED:
  1244 		case VDEV_AUX_SPARED:
  1241 			aux = "SPARED";
  1245 			aux = "SPARED";
  1242 			break;
  1246 			break;
  1243 		case VDEV_AUX_ERR_EXCEEDED:
  1247 		case VDEV_AUX_ERR_EXCEEDED:
  1244 			aux = "ERR_EXCEEDED";
  1248 			aux = "ERR_EXCEEDED";
  2180 		mdb_warn("failed to read data at %p;", addr);
  2184 		mdb_warn("failed to read data at %p;", addr);
  2181 		mdb_printf("maybe no stats? run \"zpool scrub\" first.");
  2185 		mdb_printf("maybe no stats? run \"zpool scrub\" first.");
  2182 		return (DCMD_ERR);
  2186 		return (DCMD_ERR);
  2183 	}
  2187 	}
  2184 
  2188 
  2185 	tzb = &stats.zab_type[DN_MAX_LEVELS][DMU_OT_NUMTYPES];
  2189 	tzb = &stats.zab_type[DN_MAX_LEVELS][DMU_OT_TOTAL];
  2186 	if (tzb->zb_gangs != 0) {
  2190 	if (tzb->zb_gangs != 0) {
  2187 		mdb_printf("Ganged blocks: %llu\n",
  2191 		mdb_printf("Ganged blocks: %llu\n",
  2188 		    (longlong_t)tzb->zb_gangs);
  2192 		    (longlong_t)tzb->zb_gangs);
  2189 	}
  2193 	}
  2190 
  2194 
  2196 	}
  2200 	}
  2197 
  2201 
  2198 	mdb_printf("\nBlocks\tLSIZE\tPSIZE\tASIZE"
  2202 	mdb_printf("\nBlocks\tLSIZE\tPSIZE\tASIZE"
  2199 	    "\t  avg\t comp\t%%Total\tType\n");
  2203 	    "\t  avg\t comp\t%%Total\tType\n");
  2200 
  2204 
  2201 	for (t = 0; t <= DMU_OT_NUMTYPES; t++) {
  2205 	for (t = 0; t <= DMU_OT_TOTAL; t++) {
  2202 		char csize[NICENUM_BUFLEN], lsize[NICENUM_BUFLEN];
  2206 		char csize[NICENUM_BUFLEN], lsize[NICENUM_BUFLEN];
  2203 		char psize[NICENUM_BUFLEN], asize[NICENUM_BUFLEN];
  2207 		char psize[NICENUM_BUFLEN], asize[NICENUM_BUFLEN];
  2204 		char avg[NICENUM_BUFLEN];
  2208 		char avg[NICENUM_BUFLEN];
  2205 		char comp[NICENUM_BUFLEN], pct[NICENUM_BUFLEN];
  2209 		char comp[NICENUM_BUFLEN], pct[NICENUM_BUFLEN];
  2206 		char typename[64];
  2210 		char typename[64];
  2207 		int l;
  2211 		int l;
  2208 
  2212 
  2209 
  2213 
  2210 		if (t == DMU_OT_DEFERRED)
  2214 		if (t == DMU_OT_DEFERRED)
  2211 			strcpy(typename, "deferred free");
  2215 			strcpy(typename, "deferred free");
       
  2216 		else if (t == DMU_OT_OTHER)
       
  2217 			strcpy(typename, "other");
  2212 		else if (t == DMU_OT_TOTAL)
  2218 		else if (t == DMU_OT_TOTAL)
  2213 			strcpy(typename, "Total");
  2219 			strcpy(typename, "Total");
  2214 		else if (mdb_readstr(typename, sizeof (typename),
  2220 		else if (mdb_readstr(typename, sizeof (typename),
  2215 		    (uintptr_t)dmu_ot[t].ot_name) == -1) {
  2221 		    (uintptr_t)dmu_ot[t].ot_name) == -1) {
  2216 			mdb_warn("failed to read type name");
  2222 			mdb_warn("failed to read type name");