Page MenuHomeFreeBSD

sysctlinfo interface
AbandonedPublic

Authored by asiciliano on Sep 18 2019, 3:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 4:26 PM
Unknown Object (File)
Oct 30 2024, 8:01 AM
Unknown Object (File)
Oct 19 2024, 10:21 AM
Unknown Object (File)
Oct 18 2024, 3:43 PM
Unknown Object (File)
Oct 6 2024, 8:39 AM
Unknown Object (File)
Oct 3 2024, 10:17 PM
Unknown Object (File)
Oct 3 2024, 9:03 AM
Unknown Object (File)
Oct 1 2024, 4:40 PM

Details

Reviewers
emaste
markj
imp
Group Reviewers
manpages
Summary

sysctlinfo is a new interface to explore the sysctl MIB-Tree and to pass objects info to userland,
https://papers.freebsd.org/2020/bsdcan/siciliano-sysctlinfo/
https://gitlab.com/alfix/sysctlinfo

After a refactoring the kernel computation is ~100% more efficient than the undocumented interface to pass all info about an object to userland.

Currently it is used by:
sysutils/sysctlbyname-improved-kmod
devel/libsysctlmibinfo2
audio/mixertui
sysutils/nsysctl
deskutils/sysctlview
sysctl-mib-html (https://gitlab.com/alfix/sysctl-mib-html)

Test Plan

The interface is used by several ports,
Furthermore https://gitlab.com/alfix/sysctlinfo has

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

asiciliano edited the test plan for this revision. (Show Details)

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

share/man/man3/sysctlinfo.3
169

s/format respectively/format, respectively/

This comment was removed by asiciliano.
share/man/man3/sysctlinfo.3
169

I' ll update, thank you

update the manual page to address revision feedback

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

asiciliano 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

asiciliano edited the test plan for this revision. (Show Details)
asiciliano edited the summary of this revision. (Show Details)
asiciliano edited the test plan for this revision. (Show Details)

Update sysctlinfo 20210222

Abandon: uses struct sysctl_oid definition previous FreeBSD 1400071