-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Name anonymous enum of KMC_BIT constants #9478
Merged
Merged
Conversation
This file contains 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
Giving a name to this enum makes it discoverable from debugging tools like DRGN and SDB. For example, with the name proposed on this patch we can iterate over these values in DRGN: ``` >>> prog.type('enum kmc_bit').enumerators (('KMC_BIT_NOTOUCH', 0), ('KMC_BIT_NODEBUG', 1), ('KMC_BIT_NOMAGAZINE', 2), ('KMC_BIT_NOHASH', 3), ('KMC_BIT_QCACHE', 4), ('KMC_BIT_KMEM', 5), ('KMC_BIT_VMEM', 6), ('KMC_BIT_SLAB', 7), ... ``` This enables SDB to easily pretty-print the flags of the spl_kmem_caches in the system like this: ``` > spl_kmem_caches -o "name,flags,total_memory" name flags total_memory ------------------------ ----------------------- ------------ abd_t KMC_NOMAGAZINE|KMC_SLAB 4.5MB arc_buf_hdr_t_full KMC_NOMAGAZINE|KMC_SLAB 12.3MB ... <cropped> ... ddt_cache KMC_VMEM 583.7KB ddt_entry_cache KMC_NOMAGAZINE|KMC_SLAB 0.0B ... <cropped> ... zio_buf_1048576 KMC_NODEBUG|KMC_VMEM 0.0B ... <cropped> ... ``` Signed-off-by: Serapheim Dimitropoulos <[email protected]>
ahrens
approved these changes
Oct 17, 2019
behlendorf
approved these changes
Oct 17, 2019
Codecov Report
@@ Coverage Diff @@
## master #9478 +/- ##
==========================================
- Coverage 79.28% 79.16% -0.13%
==========================================
Files 415 415
Lines 123632 123632
==========================================
- Hits 98019 97868 -151
- Misses 25613 25764 +151
Continue to review full report at Codecov.
|
behlendorf
added
Status: Accepted
Ready to integrate (reviewed, tested)
and removed
Status: Code Review Needed
Ready for review and testing
labels
Oct 18, 2019
tonyhutter
pushed a commit
to tonyhutter/zfs
that referenced
this pull request
Dec 26, 2019
Giving a name to this enum makes it discoverable from debugging tools like DRGN and SDB. For example, with the name proposed on this patch we can iterate over these values in DRGN: ``` >>> prog.type('enum kmc_bit').enumerators (('KMC_BIT_NOTOUCH', 0), ('KMC_BIT_NODEBUG', 1), ('KMC_BIT_NOMAGAZINE', 2), ('KMC_BIT_NOHASH', 3), ('KMC_BIT_QCACHE', 4), ('KMC_BIT_KMEM', 5), ('KMC_BIT_VMEM', 6), ('KMC_BIT_SLAB', 7), ... ``` This enables SDB to easily pretty-print the flags of the spl_kmem_caches in the system like this: ``` > spl_kmem_caches -o "name,flags,total_memory" name flags total_memory ------------------------ ----------------------- ------------ abd_t KMC_NOMAGAZINE|KMC_SLAB 4.5MB arc_buf_hdr_t_full KMC_NOMAGAZINE|KMC_SLAB 12.3MB ... <cropped> ... ddt_cache KMC_VMEM 583.7KB ddt_entry_cache KMC_NOMAGAZINE|KMC_SLAB 0.0B ... <cropped> ... zio_buf_1048576 KMC_NODEBUG|KMC_VMEM 0.0B ... <cropped> ... ``` Reviewed-by: Matt Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Serapheim Dimitropoulos <[email protected]> Closes openzfs#9478
tonyhutter
pushed a commit
to tonyhutter/zfs
that referenced
this pull request
Dec 27, 2019
Giving a name to this enum makes it discoverable from debugging tools like DRGN and SDB. For example, with the name proposed on this patch we can iterate over these values in DRGN: ``` >>> prog.type('enum kmc_bit').enumerators (('KMC_BIT_NOTOUCH', 0), ('KMC_BIT_NODEBUG', 1), ('KMC_BIT_NOMAGAZINE', 2), ('KMC_BIT_NOHASH', 3), ('KMC_BIT_QCACHE', 4), ('KMC_BIT_KMEM', 5), ('KMC_BIT_VMEM', 6), ('KMC_BIT_SLAB', 7), ... ``` This enables SDB to easily pretty-print the flags of the spl_kmem_caches in the system like this: ``` > spl_kmem_caches -o "name,flags,total_memory" name flags total_memory ------------------------ ----------------------- ------------ abd_t KMC_NOMAGAZINE|KMC_SLAB 4.5MB arc_buf_hdr_t_full KMC_NOMAGAZINE|KMC_SLAB 12.3MB ... <cropped> ... ddt_cache KMC_VMEM 583.7KB ddt_entry_cache KMC_NOMAGAZINE|KMC_SLAB 0.0B ... <cropped> ... zio_buf_1048576 KMC_NODEBUG|KMC_VMEM 0.0B ... <cropped> ... ``` Reviewed-by: Matt Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Serapheim Dimitropoulos <[email protected]> Closes openzfs#9478
tonyhutter
pushed a commit
that referenced
this pull request
Jan 23, 2020
Giving a name to this enum makes it discoverable from debugging tools like DRGN and SDB. For example, with the name proposed on this patch we can iterate over these values in DRGN: ``` >>> prog.type('enum kmc_bit').enumerators (('KMC_BIT_NOTOUCH', 0), ('KMC_BIT_NODEBUG', 1), ('KMC_BIT_NOMAGAZINE', 2), ('KMC_BIT_NOHASH', 3), ('KMC_BIT_QCACHE', 4), ('KMC_BIT_KMEM', 5), ('KMC_BIT_VMEM', 6), ('KMC_BIT_SLAB', 7), ... ``` This enables SDB to easily pretty-print the flags of the spl_kmem_caches in the system like this: ``` > spl_kmem_caches -o "name,flags,total_memory" name flags total_memory ------------------------ ----------------------- ------------ abd_t KMC_NOMAGAZINE|KMC_SLAB 4.5MB arc_buf_hdr_t_full KMC_NOMAGAZINE|KMC_SLAB 12.3MB ... <cropped> ... ddt_cache KMC_VMEM 583.7KB ddt_entry_cache KMC_NOMAGAZINE|KMC_SLAB 0.0B ... <cropped> ... zio_buf_1048576 KMC_NODEBUG|KMC_VMEM 0.0B ... <cropped> ... ``` Reviewed-by: Matt Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Serapheim Dimitropoulos <[email protected]> Closes #9478
sdimitro
added a commit
to sdimitro/zfs
that referenced
this pull request
Mar 13, 2020
Giving a name to this enum makes it discoverable from debugging tools like DRGN and SDB. For example, with the name proposed on this patch we can iterate over these values in DRGN: ``` >>> prog.type('enum kmc_bit').enumerators (('KMC_BIT_NOTOUCH', 0), ('KMC_BIT_NODEBUG', 1), ('KMC_BIT_NOMAGAZINE', 2), ('KMC_BIT_NOHASH', 3), ('KMC_BIT_QCACHE', 4), ('KMC_BIT_KMEM', 5), ('KMC_BIT_VMEM', 6), ('KMC_BIT_SLAB', 7), ... ``` This enables SDB to easily pretty-print the flags of the spl_kmem_caches in the system like this: ``` > spl_kmem_caches -o "name,flags,total_memory" name flags total_memory ------------------------ ----------------------- ------------ abd_t KMC_NOMAGAZINE|KMC_SLAB 4.5MB arc_buf_hdr_t_full KMC_NOMAGAZINE|KMC_SLAB 12.3MB ... <cropped> ... ddt_cache KMC_VMEM 583.7KB ddt_entry_cache KMC_NOMAGAZINE|KMC_SLAB 0.0B ... <cropped> ... zio_buf_1048576 KMC_NODEBUG|KMC_VMEM 0.0B ... <cropped> ... ``` Reviewed-by: Matt Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Serapheim Dimitropoulos <[email protected]> Closes openzfs#9478
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.
Giving a name to this enum makes it discoverable from
debugging tools like DRGN and SDB. For example, with
the name proposed on this patch we can iterate over
these values in DRGN:
This enables SDB to easily pretty-print the flags of
the spl_kmem_caches in the system like this:
Signed-off-by: Serapheim Dimitropoulos [email protected]
Types of changes
Checklist:
Signed-off-by
.