Make zpool status dedup table support raw bytes -p output#17926
Open
Adi-Goll wants to merge 2 commits intoopenzfs:masterfrom
Open
Make zpool status dedup table support raw bytes -p output#17926Adi-Goll wants to merge 2 commits intoopenzfs:masterfrom
Adi-Goll wants to merge 2 commits intoopenzfs:masterfrom
Conversation
470a20d to
e05bd74
Compare
e05bd74 to
1d3713c
Compare
7ddd5b0 to
99578b7
Compare
Contributor
Author
|
@amotin @behlendorf No worries if there are more pressing reviews going on right now, but I just wanted to follow up on this. |
behlendorf
reviewed
Dec 9, 2025
Adi-Goll
commented
Dec 21, 2025
| 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); |
Contributor
Author
There was a problem hiding this comment.
it may still be preferrable to do dump_opt['P'] > 0 here but I'm not sure. The value for literal seems to correspond to cb.cb_literal, which is set to B_TRUE when checking for a p option being enabled, on line 11250 of this file, so this seems to be correct from what I see but let me know if you have thoughts!
7a18ad3 to
68efee8
Compare
amotin
reviewed
Dec 22, 2025
72ca6c9 to
1da4b7e
Compare
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. Signed-off-by: Adi Gollamudi <adigollamudi@gmail.com> Fixes openzfs#11626
Boolean_t paramater "parsable" was added to zpool_dump_ddt(). This updates ABI files accordingly. Signed-off-by: Adi Gollamudi <adigollamudi@gmail.com>
1da4b7e to
63fa777
Compare
alek-p
added a commit
to alek-p/openzfs
that referenced
this pull request
Jan 12, 2026
- Added '-E' flag to 'zpool status' to exclude specific pools from output. - Added '-p' support to 'zpool status -D' to display raw deduplication statistics. - Updated ABI and internal functions to support the new 'literal' argument for dedup stats. - Added regression test 'zpool_status_009_pos.ksh' to verify both new features. This change addresses openzfs issues openzfs#17902 and openzfs#17926. Implemented by Gemini.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Check if
-pflag is enabled, and if so print dedup table with raw bytes. Restructure the logic in zutil_pool to check if-pflag is enabled before making calls tozfs_nicenum_format(). Other files changed update the call to/header declaration ofdump_ddt_stat()to include a new variable: boolean_t parsable, indicating whether or not-pwas used.No changes were made to the printing of the DDT, however to ensure that when the raw bytes were printed and not truncated, the buffer size storing the table values was increased to 32 bytes.
This PR also includes updates to the ABI files because the function header for zpool_dump_ddt() was modified to include a new parameter which indicates if the
-pflag was used.Fixes #11626
How Has This Been Tested?
Before this PR, when
-pwasn't supported (equivalent of running the command with just-D):$ sudo zpool status -D -p tank pool: tank state: ONLINE config: NAME STATE READ WRITE CKSUM tank ONLINE 0 0 0 /tmp/disk.img ONLINE 0 0 0 errors: No known data errors dedup: DDT entries 1, size 3K on disk, 8K in core bucket allocated referenced ______ ______________________________ ______________________________ refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE ------ ------ ----- ----- ----- ------ ----- ----- ----- 2K 1 128K 128K 128K 3.12K 400M 400M 400M Total 1 128K 128K 128K 3.12K 400M 400M 400MAfter this PR:
$ zpool status -D -p tank pool: tank state: ONLINE config: NAME STATE READ WRITE CKSUM tank ONLINE 0 0 0 /tmp/disk.img ONLINE 0 0 0 errors: No known data errors dedup: DDT entries 1, size 3072 on disk, 8192 in core bucket allocated referenced ____________________________________ ______________________________ refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE ------ ------ ----- ----- ----- ------ ----- ----- ----- 2048 1 131072 131072 131072 3200 419430400 419430400 419430400 Total 1 131072 131072 131072 3200 419430400 419430400 419430400Types of changes
Checklist:
Signed-off-by.