504 mdb_printf("%u or more %llu %llu%%\n",
505 i, histo2[i], histo2[i]*100/ndbufs);
506
507
508 return (DCMD_OK);
509 }
510
511 #define CHAIN_END 0xffff
512 /*
513 * ::zap_leaf [-v]
514 *
515 * Print a zap_leaf_phys_t, assumed to be 16k
516 */
517 /* ARGSUSED */
518 static int
519 zap_leaf(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
520 {
521 char buf[16*1024];
522 int verbose = B_FALSE;
523 int four = B_FALSE;
524 zap_leaf_t l;
525 zap_leaf_phys_t *zlp = (void *)buf;
526 int i;
527
528 if (mdb_getopts(argc, argv,
529 'v', MDB_OPT_SETBITS, TRUE, &verbose,
530 '4', MDB_OPT_SETBITS, TRUE, &four,
531 NULL) != argc)
532 return (DCMD_USAGE);
533
534 l.l_phys = zlp;
535 l.l_bs = 14; /* assume 16k blocks */
536 if (four)
537 l.l_bs = 12;
538
539 if (!(flags & DCMD_ADDRSPEC)) {
540 return (DCMD_USAGE);
541 }
542
543 if (mdb_vread(buf, sizeof (buf), addr) == -1) {
544 mdb_warn("failed to read zap_leaf_phys_t at %p", addr);
1408 }
1409
1410 mw->mw_vdevs = mdb_alloc(mw->mw_numvdevs * sizeof (void *),
1411 UM_SLEEP | UM_GC);
1412 if (mdb_vread(mw->mw_vdevs, mw->mw_numvdevs * sizeof (void *),
1413 childp) == -1) {
1414 mdb_warn("failed to read root vdev children at %p", childp);
1415 return (DCMD_ERR);
1416 }
1417
1418 wsp->walk_data = mw;
1419
1420 return (WALK_NEXT);
1421 }
1422
1423 typedef struct mdb_spa {
1424 uintptr_t spa_dsl_pool;
1425 uintptr_t spa_root_vdev;
1426 } mdb_spa_t;
1427
1428 typedef struct mdb_dsl_dir {
1429 uintptr_t dd_phys;
1430 int64_t dd_space_towrite[TXG_SIZE];
1431 } mdb_dsl_dir_t;
1432
1433 typedef struct mdb_dsl_dir_phys {
1434 uint64_t dd_used_bytes;
1435 uint64_t dd_compressed_bytes;
1436 uint64_t dd_uncompressed_bytes;
1437 } mdb_dsl_dir_phys_t;
1438
1439 typedef struct mdb_vdev {
1440 uintptr_t vdev_parent;
1441 uintptr_t vdev_ms;
1442 uint64_t vdev_ms_count;
1443 vdev_stat_t vdev_stat;
1444 } mdb_vdev_t;
1445
1446 typedef struct mdb_metaslab {
1447 space_map_t ms_allocmap[TXG_SIZE];
1448 space_map_t ms_freemap[TXG_SIZE];
1449 space_map_t ms_map;
|
504 mdb_printf("%u or more %llu %llu%%\n",
505 i, histo2[i], histo2[i]*100/ndbufs);
506
507
508 return (DCMD_OK);
509 }
510
511 #define CHAIN_END 0xffff
512 /*
513 * ::zap_leaf [-v]
514 *
515 * Print a zap_leaf_phys_t, assumed to be 16k
516 */
517 /* ARGSUSED */
518 static int
519 zap_leaf(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
520 {
521 char buf[16*1024];
522 int verbose = B_FALSE;
523 int four = B_FALSE;
524 zap_leaf_t l = { 0 };
525 zap_leaf_phys_t *zlp = (void *)buf;
526 int i;
527
528 if (mdb_getopts(argc, argv,
529 'v', MDB_OPT_SETBITS, TRUE, &verbose,
530 '4', MDB_OPT_SETBITS, TRUE, &four,
531 NULL) != argc)
532 return (DCMD_USAGE);
533
534 l.l_phys = zlp;
535 l.l_bs = 14; /* assume 16k blocks */
536 if (four)
537 l.l_bs = 12;
538
539 if (!(flags & DCMD_ADDRSPEC)) {
540 return (DCMD_USAGE);
541 }
542
543 if (mdb_vread(buf, sizeof (buf), addr) == -1) {
544 mdb_warn("failed to read zap_leaf_phys_t at %p", addr);
1408 }
1409
1410 mw->mw_vdevs = mdb_alloc(mw->mw_numvdevs * sizeof (void *),
1411 UM_SLEEP | UM_GC);
1412 if (mdb_vread(mw->mw_vdevs, mw->mw_numvdevs * sizeof (void *),
1413 childp) == -1) {
1414 mdb_warn("failed to read root vdev children at %p", childp);
1415 return (DCMD_ERR);
1416 }
1417
1418 wsp->walk_data = mw;
1419
1420 return (WALK_NEXT);
1421 }
1422
1423 typedef struct mdb_spa {
1424 uintptr_t spa_dsl_pool;
1425 uintptr_t spa_root_vdev;
1426 } mdb_spa_t;
1427
1428 struct mdb_dsl_dir_phys;
1429 typedef struct mdb_dsl_dir_dbuf {
1430 uint8_t dddb_pad[offsetof(dmu_buf_t, db_data)];
1431 uintptr_t dddb_data;
1432 } mdb_dsl_dir_dbuf_t;
1433
1434 typedef struct mdb_dsl_dir {
1435 union {
1436 dmu_buf_t *dd_dmu_db;
1437 mdb_dsl_dir_dbuf_t *dd_db;
1438 } dd_db_u;
1439 int64_t dd_space_towrite[TXG_SIZE];
1440 } mdb_dsl_dir_t;
1441
1442 typedef struct mdb_dsl_dir_phys {
1443 uint64_t dd_used_bytes;
1444 uint64_t dd_compressed_bytes;
1445 uint64_t dd_uncompressed_bytes;
1446 } mdb_dsl_dir_phys_t;
1447
1448 typedef struct mdb_vdev {
1449 uintptr_t vdev_parent;
1450 uintptr_t vdev_ms;
1451 uint64_t vdev_ms_count;
1452 vdev_stat_t vdev_stat;
1453 } mdb_vdev_t;
1454
1455 typedef struct mdb_metaslab {
1456 space_map_t ms_allocmap[TXG_SIZE];
1457 space_map_t ms_freemap[TXG_SIZE];
1458 space_map_t ms_map;
|