-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Make zpool status dedup table support raw bytes -p output #17926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
470a20d to
e05bd74
Compare
e05bd74 to
1d3713c
Compare
7ddd5b0 to
99578b7
Compare
|
@amotin @behlendorf No worries if there are more pressing reviews going on right now, but I just wanted to follow up on this. |
| 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!
e175962 to
cc1aa0a
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. Conditional printing with space modifications made to ensure raw output is still legible. Signed-off-by: Adi Gollamudi <adigollamudi@gmail.com> Fixes openzfs#11626
863ea65 to
7a18ad3
Compare
Boolean_t paramater "parsable" was added to zpool_dump_ddt(). This updates ABI files accordingly. Signed-off-by: Adi Gollamudi <adigollamudi@gmail.com>
7a18ad3 to
68efee8
Compare
| zfs_nicenum_format(dds->dds_ref_psize, ref_psize, | ||
| sizeof (ref_psize), ZFS_NICENUM_BYTES); | ||
| zfs_nicenum_format(dds->dds_ref_dsize, ref_dsize, | ||
| sizeof (ref_dsize), ZFS_NICENUM_BYTES); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to not bloat the code, but introduce two variables with formats.
|
|
||
| (void) printf("%6s %6s %5s %5s %5s %6s %5s %5s" | ||
| " %5s\n", "------", "------", "-----", "-----", "-----", | ||
| "------", "-----", "-----", "-----"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already dislike it...
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.Some minor changes were made to the printing of the DDT, to ensure that when the raw bytes were printed and not truncated, there was enough space to make the output legible. This is not dynamic though, and is probably a temporary solution, but it is preferable to the previous state.
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 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:
$ 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 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.