]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Enable iterating all sysctls, even ones with CTLFLAG_SKIP
authorfreqlabs <freqlabs@FreeBSD.org>
Mon, 5 Oct 2020 20:13:22 +0000 (20:13 +0000)
committerfreqlabs <freqlabs@FreeBSD.org>
Mon, 5 Oct 2020 20:13:22 +0000 (20:13 +0000)
commit638f0ed3c5abf851fb748a0b700f78f2cffe64a8
treec73fa248662506864e968b05e8da224696072d99
parent76a2aee69b3eb41d2e905cd91878d41ebbedb890
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