diff options
author | Rich Ercolani <214141+rincebrain@users.noreply.github.com> | 2021-11-30 13:26:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-30 10:26:45 -0800 |
commit | c5ccbbdcf6526b3cd2101269f896f3dcd8cd4c1d (patch) | |
tree | 977cfd54b07c00ccbe804889bb921aa51ef45386 | |
parent | 34eef3e9a7a74d24a59d016051d547afc55dbaa0 (diff) |
Allow printing special vdev metaslab groups
Sometimes, we'd like to know info about the metaslab groups
on special vdevs too. So let's make -MM do something useful.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #12750
-rw-r--r-- | cmd/zdb/zdb.c | 8 | ||||
-rw-r--r-- | man/man8/zdb.8 | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index dff61b7ba..8fe926c50 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -1734,10 +1734,11 @@ print_vdev_metaslab_header(vdev_t *vd) } static void -dump_metaslab_groups(spa_t *spa) +dump_metaslab_groups(spa_t *spa, boolean_t show_special) { vdev_t *rvd = spa->spa_root_vdev; metaslab_class_t *mc = spa_normal_class(spa); + metaslab_class_t *smc = spa_special_class(spa); uint64_t fragmentation; metaslab_class_histogram_verify(mc); @@ -1746,7 +1747,8 @@ dump_metaslab_groups(spa_t *spa) vdev_t *tvd = rvd->vdev_child[c]; metaslab_group_t *mg = tvd->vdev_mg; - if (mg == NULL || mg->mg_class != mc) + if (mg == NULL || (mg->mg_class != mc && + (!show_special || mg->mg_class != smc))) continue; metaslab_group_histogram_verify(mg); @@ -7673,7 +7675,7 @@ dump_zpool(spa_t *spa) if (dump_opt['d'] > 2 || dump_opt['m']) dump_metaslabs(spa); if (dump_opt['M']) - dump_metaslab_groups(spa); + dump_metaslab_groups(spa, dump_opt['M'] > 1); if (dump_opt['d'] > 2 || dump_opt['m']) { dump_log_spacemaps(spa); dump_log_spacemap_obsolete_stats(spa); diff --git a/man/man8/zdb.8 b/man/man8/zdb.8 index a8a944219..2b0471cc9 100644 --- a/man/man8/zdb.8 +++ b/man/man8/zdb.8 @@ -266,12 +266,10 @@ the percentage of free space in each space map. .It Fl mmmm Display every spacemap record. .It Fl M -Display the offset, spacemap, and free space of each metaslab. +Display all "normal" vdev metaslab group information - per-vdev metaslab count, fragmentation, +and free space histogram, as well as overall pool fragmentation and histogram. .It Fl MM -Also display information about the maximum contiguous free space and the -percentage of free space in each space map. -.It Fl MMM -Display every spacemap record. +"Special" vdevs are added to -M's normal output. .It Fl O Ar dataset path Look up the specified .Ar path |