-
Notifications
You must be signed in to change notification settings - Fork 1.9k
FreeBSD: Use new py-sysctl features, fix some issues in Python commands #11318
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
Closed
Conversation
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
py-sysctl now includes the CTLTYPE_NODE type nodes in the list returned by sysctl.filter() on FreeBSD head. It also provides descriptions now. Eliminate the subprocess call to get descriptions, and filter out the nodes so we only deal with values. Signed-off-by: Ryan Moeller <[email protected]>
vfs.zfs.arc_no_grow_shift has an invalid type (15) and this causes py-sysctl to format it as a bytearray when it should be an integer. "U" is not a valid format, it should be "I" and the type should match the variable type, int. We can return EINVAL if the value is set below zero. Signed-off-by: Ryan Moeller <[email protected]>
behlendorf
approved these changes
Dec 10, 2020
behlendorf
pushed a commit
that referenced
this pull request
Dec 10, 2020
vfs.zfs.arc_no_grow_shift has an invalid type (15) and this causes py-sysctl to format it as a bytearray when it should be an integer. "U" is not a valid format, it should be "I" and the type should match the variable type, int. We can return EINVAL if the value is set below zero. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11318
ghost
pushed a commit
to zfsonfreebsd/ZoF
that referenced
this pull request
Dec 23, 2020
py-sysctl now includes the CTLTYPE_NODE type nodes in the list returned by sysctl.filter() on FreeBSD head. It also provides descriptions now. Eliminate the subprocess call to get descriptions, and filter out the nodes so we only deal with values. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11318
ghost
pushed a commit
to zfsonfreebsd/ZoF
that referenced
this pull request
Dec 23, 2020
vfs.zfs.arc_no_grow_shift has an invalid type (15) and this causes py-sysctl to format it as a bytearray when it should be an integer. "U" is not a valid format, it should be "I" and the type should match the variable type, int. We can return EINVAL if the value is set below zero. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11318
behlendorf
pushed a commit
that referenced
this pull request
Dec 23, 2020
py-sysctl now includes the CTLTYPE_NODE type nodes in the list returned by sysctl.filter() on FreeBSD head. It also provides descriptions now. Eliminate the subprocess call to get descriptions, and filter out the nodes so we only deal with values. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11318
behlendorf
pushed a commit
that referenced
this pull request
Dec 23, 2020
vfs.zfs.arc_no_grow_shift has an invalid type (15) and this causes py-sysctl to format it as a bytearray when it should be an integer. "U" is not a valid format, it should be "I" and the type should match the variable type, int. We can return EINVAL if the value is set below zero. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11318
jsai20
pushed a commit
to jsai20/zfs
that referenced
this pull request
Mar 30, 2021
py-sysctl now includes the CTLTYPE_NODE type nodes in the list returned by sysctl.filter() on FreeBSD head. It also provides descriptions now. Eliminate the subprocess call to get descriptions, and filter out the nodes so we only deal with values. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11318
jsai20
pushed a commit
to jsai20/zfs
that referenced
this pull request
Mar 30, 2021
vfs.zfs.arc_no_grow_shift has an invalid type (15) and this causes py-sysctl to format it as a bytearray when it should be an integer. "U" is not a valid format, it should be "I" and the type should match the variable type, int. We can return EINVAL if the value is set below zero. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11318
sempervictus
pushed a commit
to sempervictus/zfs
that referenced
this pull request
May 31, 2021
py-sysctl now includes the CTLTYPE_NODE type nodes in the list returned by sysctl.filter() on FreeBSD head. It also provides descriptions now. Eliminate the subprocess call to get descriptions, and filter out the nodes so we only deal with values. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11318
sempervictus
pushed a commit
to sempervictus/zfs
that referenced
this pull request
May 31, 2021
vfs.zfs.arc_no_grow_shift has an invalid type (15) and this causes py-sysctl to format it as a bytearray when it should be an integer. "U" is not a valid format, it should be "I" and the type should match the variable type, int. We can return EINVAL if the value is set below zero. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11318
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.
Motivation and Context
FreeBSD and py-sysctl have been enhanced with new features for working with sysctls.
FreeBSD now has a mode of iterating through all nodes in the sysctl tree, even hidden ones and nodes, and py-sysctl now uses that mode to build its list of sysctls.
py-sysctl also is able to fetch the description string for a sysctl now.
When the FreeBSD platform glue was implemented for the Python-based commands arcstat, arc_summary, and dbufstat, these features did not exist in py-sysctl.
I found one tunable that was being formatted incorrectly as a bytearray rather than an integer in the arc_summary output while testing these updates. This was identified to be caused by an incorrect format string in the declaration of the sysctl.
Description
Due to the lack of descriptions in py-sysctl at the time, we had to shell out to the sysctl command for the descriptions of tunables. Now we can avoid all that and access the
.description
field on a sysctl object instead.Filter out
CTLTYPE_NODE
type sysctls so we avoid listing nodes as tunables withNone
as the value on FreeBSD head.Match the type of the
vfs.zfs.arc_no_grow_shift
sysctl to the corresponding variable and use a valid format string so the tunable is correctly formatted as an integer instead of a bytearray in the output of arc_summary3.How Has This Been Tested?
Manual testing to confirm output, and ZTS sanity checked on FreeBSD.
Types of changes
Checklist:
Signed-off-by
.