db_command_loop - do not ignore the return value from setjmp used to
guard db_cmd_on_enter. We do not want to re-execute the enter command
if it fails. Note that "fails" includes e.g. aborting long output
from the enter command with "q" at the --db more-- prompt, which is
quite likely as the default enter command is "bt".
While here, don't even bother with the whole song and dance if the
enter command is not set.
the system is shutting down or rebooting.
- Set this global in a new function called kern_reboot(), which is currently
just a basic wrapper around cpu_reboot().
- Call kern_reboot() instead of cpu_reboot() almost everywhere; a few
places remain where it's still called directly, but those are in early
pre-main() machdep locations.
Eventually, all of the various cpu_reboot() functions should be re-factored
and common functionality moved to kern_reboot(), but that's for another day.
(christos has a good idea to add a function that does all 3,
and we should switch all the callers in this sequence to use
it (and fix the MD ones missing it still). not all can, as
eg, line-grabbing functions can use cngetsn(), which only
calls cnpollc() twice.)
- interrupts can work afterwards
- this also means if IO stalls, serial break might work again.
this mimics how reboot(2) ends up calling cpu_reboot().
minimal lockdebug checks in place, even without LOCKDEBUG.
adjust lockdebug_abort() to ignore problems after ld_panic is set
so that there's a chance of this working.
this fixes ddb 'reboot' on softiron od1000.
show kernhist[/i] [addr[,count]]
the i modifier means display info instead of entries, and the count
restricts to the last count entries.
the count option is only supported for specified histories. it
could be extended but requires more logic than the single history,
as multiple histories are merged during display.
lockdebug to avoid asserts. use it for the ddb "reboot"
command, so that it doesn't matter how ddb was entered, the
reboot not trigger mutex checks and not work.
The command shows information of all active (i.e., being held) locks that are
tracked through either of LWPs or CPUs by the LOCKDEBUG facility. The /t
modifier additionally shows a backtrace for each LWP additionally. This
feature is useful for debugging especially to analyze deadlocks.
The command is useful only if LOCKDEBUG is enabled.
show arptab command of ddb is now inappropriate because it actually dumps
routes but arp entries aren't routes anymore. So rename it to show routes
and move the code from if_arp.c to route.c.
ok christos@
1) really prints all the histories merged together (rather than just the
"first" when no argument specified
2) dumps a single history when an argument is given, e.g.
"show kernhist usbhist"
3) uses db_printf correctly
rename "UVMHIST" option to enable the uvm histories.
TODO:
- make UVMHIST properly depend upon KERNHIST
- enable dynamic registration of histories. this is mostly just
allocating something in a bitmap, and is only for viewing multiple
histories in a merged form.
tested on amd64 and sparc64.
usage: show proc [/a] [/p] address|pid
/a == argument is an address of any lwp
/p == argument is a pid [default]
From: Vladimir Kirillov proger at wilab dot org dot ua