Enable iterating all sysctls, even ones with CTLFLAG_SKIP
authorRyan Moeller <freqlabs@FreeBSD.org>
Mon, 5 Oct 2020 20:13:22 +0000 (20:13 +0000)
committerRyan Moeller <freqlabs@FreeBSD.org>
Mon, 5 Oct 2020 20:13:22 +0000 (20:13 +0000)
commit92e17803cd19bf55d07779e0b56b12e9fa50ec92
treec73fa248662506864e968b05e8da224696072d99
parentce3e137ca1bf6638f9200d5313a0afb25099abf9
Enable iterating all sysctls, even ones with CTLFLAG_SKIP

Add an "nextnoskip" sysctl that allows for listing of sysctls intended to be
normally skipped for cost reasons.

This makes it so the names/descriptions of those sysctls can be discovered with
sysctl -aN/sysctl -ad/sysctl -at.

It also makes it so children are visited when a node flagged with CTLFLAG_SKIP
is explicitly requested.

The intended use case is to mark the root "kstat" node with CTLFLAG_SKIP so that
the extensive and expensive stats are skipped by default but may still be easily
obtained without having to know them all (which may not even be possible) and
request each one-by-one.

Reviewed by: jhb
MFC after: 2 weeks
Relnotes: yes
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D26560
sbin/sysctl/sysctl.c
sys/kern/kern_sysctl.c
sys/sys/sysctl.h
usr.bin/truss/syscalls.c