HomeFreeBSD

ddb(4): Add 'sysctl' command

Description

ddb(4): Add 'sysctl' command

Implement sysctl in ddb by overriding SYSCTL_OUT. When handling the
req, we install custom ddb in/out handlers. The out handler prints straight
to the debugger, while the in handler ignores all input. This is intended
to allow us to print just about any sysctl.

There is a known issue when used from ddb(4) entered via 'sysctl
debug.kdb.enter=1'. The DDB mode does not quite prevent all lock
interactions, and it is possible for the recursive Giant lock to be unlocked
when the ddb(4) 'sysctl' command is used. This may result in a panic on
return from ddb(4) via 'c' (continue). Obviously, this is not a problem
when debugging already-paniced systems.

Submitted by: Travis Lane (formerly: <travis.lane AT isilon.com>)
Reviewed by: vangyzen (earlier version), Don Morris <dgmorris AT earthlink.net>
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20219

Details

Provenance
cemAuthored on
Reviewer
vangyzen
Differential Revision
D20219: ddb(4): Add 'sysctl' command
Parents
rS350712: MFC r345363 (by imp): Make WD and WDC aliases for HGST.
Branches
Unknown
Tags
Unknown