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)
Mon, Nov 25, 2:56 PM
Unknown Object (File)
Nov 8 2024, 6:25 PM
Unknown Object (File)
Nov 3 2024, 10:17 PM
Unknown Object (File)
Oct 22 2024, 12:46 PM
Unknown Object (File)
Oct 22 2024, 3:06 AM
Unknown Object (File)
Oct 1 2024, 8:08 PM
Unknown Object (File)
Sep 30 2024, 10:27 AM
Unknown Object (File)
Sep 28 2024, 6:36 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.