Page MenuHomeFreeBSD

Don't request CTLTYPE_OPAQUE if we can't print them.
ClosedPublic

Authored by gallatin on Jul 3 2017, 1:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 14, 12:21 PM
Unknown Object (File)
Sep 17 2025, 4:07 AM
Unknown Object (File)
Sep 1 2025, 3:53 AM
Unknown Object (File)
Aug 20 2025, 3:38 AM
Unknown Object (File)
Jul 7 2025, 11:51 AM
Unknown Object (File)
Jul 5 2025, 9:17 PM
Unknown Object (File)
Jul 4 2025, 1:08 AM
Unknown Object (File)
Jul 1 2025, 4:15 PM
Subscribers
None

Details

Summary

The intent is to skip expensive sysctls like tcp_pcblist unless
they are explicitly asked for. These opaqueue sysctls don't show
up in sysctl -a, but they do generate output that winds up being
just dropped by sysctl, unless the user specifically asked to
see binary/hex output or opaques.

On a loaded system, this reduces the time to run
sysctl -a by a factor of 4 or so:

c059.ord001.dev# /usr/bin/time /sbin/sysctl -a > /dev/null

0.17 real         0.01 user         0.11 sys

c059.ord001.dev# /usr/bin/time /sbin/sysctl.old -a > /dev/null

0.75 real         0.01 user         0.50 sys

(and a factor of 2 or so on an unloaded system)

Unintentionally requesting some of these opaque sysctls
when debugging a sick machine can be enough to push things
over the edge sometimes.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jul 3 2017, 6:27 PM
This revision was automatically updated to reflect the committed changes.