Page MenuHomeFreeBSD

sysctlinfo interface
Needs ReviewPublic

Authored by alfix86_gmail.com on Sep 18 2019, 3:55 AM.

Details

Reviewers
emaste
markj
Group Reviewers
manpages
Summary

sysctlinfo is a new interface to explore the sysctl MIB-Tree and to pass the info of the nodes to the userland,

briefly:

https://github.com/freebsd/freebsd-quarterly/blob/master/2019q3/sysctlinfo.md

README, manual, examples, tests and converted tools:

https://gitlab.com/alfix/sysctlinfo

(The next step is to add a new node to allow sysctlbyname() to manage a CTLTYPE_NODE with a no-NULL handler, example "kern.proc.pid.<pid>" and a name-level with just '\0', example "security.jail.param.allow.mount." Link: https://gitlab.com/alfix/sysctlbyname-improved).

Test Plan

https://gitlab.com/alfix/sysctlinfo has

testing/ misc tests (name, CTL_MAXNAME levels, etc)
testing/regression/ compatibility with the 'undocumented interface'
testing/time/ for efficiency
testing/lock/ trivial nodes to test lock/system panic
converted/ tools converted to use sysctlinfo

deskutils/sysctlview, sysutils/nsysctl and (soon) devel/libsysctlmibinfo2 use sysutils/sysctlinfo-kmod

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

alfix86_gmail.com edited the summary of this revision. (Show Details)Sep 18 2019, 4:07 AM
alfix86_gmail.com edited the test plan for this revision. (Show Details)
bcr added a subscriber: bcr.Sep 18 2019, 8:18 AM

Only a minor comma missing in the man page. Otherwise, it's great.
Thank you!

share/man/man3/sysctlinfo.3
168

s/format respectively/format, respectively/

This comment was removed by alfix86_gmail.com.
share/man/man3/sysctlinfo.3
168

I' ll update, thank you

update the manual page to address revision feedback

bcr accepted this revision as: manpages.Sep 19 2019, 9:50 AM

OK from manpages. Someone else should look at the actual code to see if there are issues.

kai added a subscriber: kai.Sep 20 2019, 6:35 AM
alfix86_gmail.com edited the summary of this revision. (Show Details)Sep 28 2019, 5:02 AM
alfix86_gmail.com edited the test plan for this revision. (Show Details)

Update sysctlinfo.h: CTL_SYSCTL is in sysctl.h
Improve lock (use a shared lock updating sysctl.h/kern_sysctl.c)
Move the implementation to kern_mib.c (sysctlinfo uses nothing from kern_sysctl.c)
Update man/man[3|4]/Makefile

alfix86_gmail.com edited the summary of this revision. (Show Details)Wed, Nov 20, 7:57 PM
alfix86_gmail.com edited the test plan for this revision. (Show Details)
alfix86_gmail.com edited the summary of this revision. (Show Details)Thu, Nov 21, 8:49 PM
alfix86_gmail.com added reviewers: emaste, markj.