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> |
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"); |