Sysctl as a Service, or: making sysctl(3) more friendly for monitoring systems
Peter Jeremy
peter at rulingia.com
Mon Dec 12 10:45:16 UTC 2016
On 2016-Dec-11 16:42:38 -0330, Jonathan Anderson <jonathan at FreeBSD.org> wrote:
>I, for one, agree, and at the risk of being slightly provocative, I
>think it could be taken even further. :) I'd love to be able to retrieve
>a sysctl entry or subtree as an nvlist_t. Rather than doing lots of
>system calls to enumerate clearly-related sysctl values, it would be
>very cool to do one system call and then inspect the resulting data
>structure in memory. We already use libnv in a number of places, and it
>seems like it could be a natural mapping from the sysctl hierarchy.
This is just pushing the work from userland to the kernel. There's no
sysctl tree in the kernel that can be readily exported as a nvlist -
the kernel would need to iterate through the hierarchy and build the
tree. The only advantage of this approach is that a client only needs
to perform a single syscall. IMO, this is the wrong approach - where
practical, functionality should be in userland, not in the kernel.
--
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20161212/43984d1b/attachment.sig>
More information about the freebsd-hackers
mailing list