]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ddb(4): Add 'sysctl' command
authorcem <cem@FreeBSD.org>
Thu, 8 Aug 2019 00:42:29 +0000 (00:42 +0000)
committercem <cem@FreeBSD.org>
Thu, 8 Aug 2019 00:42:29 +0000 (00:42 +0000)
commit63c98f9ad409721c08f5ad4f63b938363bcd08ba
tree85cab939c4481c9bf3a71282d04e21163afe4b21
parenta32748fbf77ab8bccc66294639620af589daa5f8
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
sys/kern/kern_sysctl.c