Make zpool status dedup table support raw bytes -p output

Check if -p flag is enabled, and if so print dedup table with raw
bytes. Restructure the logic in zutil_pool to check if -p flag is
enabled before printing either the bytes or raw numbers.

Calls to print the data for DDT now all use
zfs_nicenum_format(). Increased DDT histogram column buffers
to 32 bytes to prevent truncation when -p is enabled.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Adi Gollamudi <adigollamudi@gmail.com>
Closes #11626
Closes #17926
This commit is contained in:
Aditya Gollamudi
2026-03-13 09:53:56 -07:00
committed by GitHub
parent 4d78b14c14
commit b481a8bbbf
5 changed files with 40 additions and 21 deletions
+1 -1
View File
@@ -10495,7 +10495,7 @@ print_dedup_stats(zpool_handle_t *zhp, nvlist_t *config, boolean_t literal)
(uint64_t **)&dds, &c) == 0);
verify(nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_HISTOGRAM,
(uint64_t **)&ddh, &c) == 0);
zpool_dump_ddt(dds, ddh);
zpool_dump_ddt(dds, ddh, literal);
}
#define ST_SIZE 4096