summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorSerapheim Dimitropoulos <[email protected]>2019-07-18 12:54:03 -0700
committerBrian Behlendorf <[email protected]>2019-07-18 12:54:03 -0700
commitbac15c11983e72cfd8ce10512aa9d227135bbca0 (patch)
treed1b8c5bfbd18cc76be59adf244530a4326ce6584 /cmd
parentf79121d11463b8c9a6cbaf7285e5df6ccb9902f9 (diff)
zdb: don't print log spacemap stats in pools without the feature
Creating a pool with not features enabled and running `zdb -mmmmmm on` it before the patch: ``` Log Space Maps in Pool: Log Space Map Obsolete Entry Statistics: 0 valid entries out of 0 - txg 0 0 valid entries out of 0 - total ``` After this patch the above output goes away. Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Sara Hartse <[email protected]> Reviewed by: Brian Behlendorf <[email protected]> Signed-off-by: Serapheim Dimitropoulos <[email protected]> Closes #9048
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zdb/zdb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index 8ccbd5e8b..7e7e26448 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -1204,6 +1204,9 @@ dump_metaslabs(spa_t *spa)
static void
dump_log_spacemaps(spa_t *spa)
{
+ if (!spa_feature_is_active(spa, SPA_FEATURE_LOG_SPACEMAP))
+ return;
+
(void) printf("\nLog Space Maps in Pool:\n");
for (spa_log_sm_t *sls = avl_first(&spa->spa_sm_logs_by_txg);
sls; sls = AVL_NEXT(&spa->spa_sm_logs_by_txg, sls)) {
@@ -5823,6 +5826,9 @@ log_spacemap_obsolete_stats_cb(spa_t *spa, space_map_entry_t *sme,
static void
dump_log_spacemap_obsolete_stats(spa_t *spa)
{
+ if (!spa_feature_is_active(spa, SPA_FEATURE_LOG_SPACEMAP))
+ return;
+
log_sm_obsolete_stats_arg_t lsos;
bzero(&lsos, sizeof (lsos));