aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zdb/zdb.c
diff options
context:
space:
mode:
authorRich Ercolani <[email protected]>2021-11-30 13:26:45 -0500
committerGitHub <[email protected]>2021-11-30 10:26:45 -0800
commitc5ccbbdcf6526b3cd2101269f896f3dcd8cd4c1d (patch)
tree977cfd54b07c00ccbe804889bb921aa51ef45386 /cmd/zdb/zdb.c
parent34eef3e9a7a74d24a59d016051d547afc55dbaa0 (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 <[email protected]> Reviewed-by: Allan Jude <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #12750
Diffstat (limited to 'cmd/zdb/zdb.c')
-rw-r--r--cmd/zdb/zdb.c8
1 files changed, 5 insertions, 3 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);