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)
Mar 22 2024, 8:28 PM
Unknown Object (File)
Mar 22 2024, 8:28 PM
Unknown Object (File)
Mar 22 2024, 8:28 PM
Unknown Object (File)
Mar 9 2024, 2:13 PM
Unknown Object (File)
Feb 2 2024, 1:20 AM
Unknown Object (File)
Jan 31 2024, 2:43 PM
Unknown Object (File)
Jan 5 2024, 6:51 PM
Unknown Object (File)
Jan 4 2024, 8:00 AM
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.