Commit Graph

181 Commits

Author SHA1 Message Date
msaitoh 5082768d7f Remove 'a' modifier from "show vmem". It was removed in sbur_vmem.c rev. 1.55. 2022-04-28 07:08:38 +00:00
uwe 6b33e13a13 ddb: guard invocation of db_cmd_on_enter properly.
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.
2022-04-20 19:06:35 +00:00
thorpej c5931c832d Add a "show kqueue <addr>" command. 2021-10-10 18:08:12 +00:00
andvar c69f42d323 fix mainly same typos as in my previous commit but outside sys/dev/dm. 2021-08-21 23:00:30 +00:00
andvar ebbc7028d3 fix typos in words "pointer" and s/fram /frame/ 2021-08-13 20:47:54 +00:00
mrg 110ac605f8 introduce DDB_END_CMD and replace more than 20 copies of the same
list of NULLs and 0.  idea from rillig@.

all touched ports built, several booted.
2021-02-23 07:13:51 +00:00
skrll d20ab3a0c2 Remove "also;" 2020-10-30 16:29:49 +00:00
skrll 155f2770cc Add a "show fdt" ddb command 2020-10-30 16:08:44 +00:00
skrll 3d56dc6d58 Sort the db_show_cmd entries 2020-10-30 07:17:29 +00:00
skrll 9fe75a0d78 Put the 'added from all sub cmds' comment above the four commands that
were added as part of the work in r1.98
2020-10-30 07:03:50 +00:00
skrll f157d2e256 Trailing whitespace 2020-10-30 06:57:08 +00:00
skrll 15572d36c9 Handle "no count" properly in db_kernhist_print_cmd 2020-04-13 11:43:27 +00:00
christos 5a4646458a Make the db_kernelonly() macro visible to all files and re-use it.
Register access is kernel only.
2020-03-10 15:58:36 +00:00
christos 18fbafecbc print a message for the commands crash does not support.
Allow "show lock"
2020-03-09 01:46:24 +00:00
thorpej 599c240526 - Introduce a new global kernel variable "shutting_down" to indicate that
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.
2020-01-01 22:57:16 +00:00
ad 9b1e2fa25c Redo the page allocator to perform better, especially on multi-core and
multi-socket systems.  Proposed on tech-kern.  While here:

- add rudimentary NUMA support - needs more work.
- remove now unused "listq" from vm_page.
2019-12-27 12:51:56 +00:00
joerg fcbdfe5fba Teach ddb(4) about printing the full mount list. 2019-12-15 20:29:08 +00:00
uwe dc64369beb db_command - don't hide local static variable in the middle of other
local variable definitions.  While here, get rid of the alignment of
variable names.
2019-09-29 02:49:59 +00:00
uwe 59ae426bf2 db_command - make setting have_addr more clear.
Don't set it to false that it's already initialized to.
2019-09-29 02:42:12 +00:00
uwe a11e9371ac db_command - make sure count is always initialized. 2019-09-29 02:35:39 +00:00
mrg 3744368154 fix "show kernhist".
set addr = 0 if we don't have_addr and avoid using random garbage in addr.
2019-09-22 12:57:34 +00:00
kre a63b9e9c06 When this file is used when not building the kernel (eg: /usr/sbin/crash)
make cnpollc() go away.
2018-09-17 01:49:54 +00:00
mrg c2d6cd62e8 call cnpollc(1) and cnpollc(0) around cngetc().
(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.)
2018-09-16 23:18:55 +00:00
mrg e8bf3d6996 call spl0() before cpu_reboot(), so that there's a chance that:
- 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().
2018-09-15 08:48:18 +00:00
mrg 60b1eff445 always call lockdebug_dismiss() from DDB -- there are always some
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.
2018-09-13 01:55:16 +00:00
mrg ba0c19d412 extend the ddb "show kernhist" command. the synopsis is now:
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.
2018-08-13 03:20:19 +00:00
mrg 0b3a7eb14e add a lockdebug_dismiss() function for DDB to use that tells
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.
2018-08-12 22:05:29 +00:00
msaitoh 502cc4207c Add "show socket" command written by Hiroki SUENAGA. It prints usage of
system's socket buffers.
2018-07-20 08:26:25 +00:00
ozaki-r d52b83d757 ddb: rename "show lockstat" to "show lockstats" to avoid conflicting with lockstat(8)
Requested by mrg@
2018-03-19 08:41:21 +00:00
ozaki-r 5e1f20377c Don't pass a unset address to lockdebug_lock_print 2018-03-16 04:45:20 +00:00
ozaki-r e611636f76 Add a new command, show all locks, which shows information of active locks
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.
2018-03-16 04:44:51 +00:00
ozaki-r 1d919413b1 Add a new command, show lockstat, which shows statistics of locks
Currently the command shows the number of allocated locks.

The command is useful only if LOCKDEBUG is enabled.
2018-03-16 04:37:55 +00:00
mlelstv 2428c0d42d Add command to print device list. 2018-03-04 07:14:50 +00:00
joerg 6ff696c6b4 Add ddb command to find a vnode by the address of its lock.
This makes it much easier to convert lockstat traces into understandable
data.
2017-01-11 12:17:34 +00:00
ozaki-r 4f0eb37aac ddb: rename show arptab to show routes
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@
2016-04-13 00:47:01 +00:00
skrll 1a04d8c9f0 Improve ddb(4) show kernhist
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
2016-04-06 21:56:24 +00:00
mrg 8b5b0b5a2a only call the on-enter commands if we're not recursing.
avoids having a fault in the on-enter commands repeating.
2015-05-21 08:23:22 +00:00
christos 1a5609a923 we can use show callout now from crash 2015-02-08 19:41:39 +00:00
christos c60f6fad95 fix userland build, by moving all the unused stuff inside ifdef _KERNEL 2013-10-19 15:20:52 +00:00
christos fa04e235ed remove the new command not the old one. 2013-01-06 04:17:27 +00:00
christos cc78507c3a remove previous, dmesg just works. 2013-01-06 03:34:52 +00:00
christos 81736cc9cd Add "show dmesg" that prints the contents of the message buffer. 2013-01-06 03:23:55 +00:00
christos cedbce7adf Add "show panic" that shows the current panic string. two ports had it, and
it could be easily made MI.
2013-01-05 15:23:27 +00:00
rmind 4b760398c3 Remove MALLOC_DEBUG and MALLOCLOG, which is dead code after malloc(9) move
to kmem(9).  Note: kmem(9) has debugging facilities under DEBUG/DIAGNOSTIC.
However, expensive kmguard and debug_freecheck have to be enabled manually.
2012-04-28 23:03:39 +00:00
mrg c09a267949 set panicstr to "reboot forced via kernel debugger" when rebooting
from ddb, similar to how sync from ddb works.

this avoids various asserts and other issues during ddb reboot.
2011-11-13 03:21:51 +00:00
mrg 8169e46991 move and rename the uvm history code out of uvm_stat to "kernhist".
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.
2011-05-17 04:18:05 +00:00
christos 2a672d40b3 Add:
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
2011-04-10 20:59:22 +00:00
drochner a1f59518fb fix extern/static inconsistency 2010-09-13 08:42:04 +00:00
rmind 6227d22ed0 Add #ifdef MQUEUE for db_show_mqueue_cmd().
XXX: Wrong.  DDB should be dynamic, modular, etc.
2009-07-19 02:37:33 +00:00
mrg 06dd613f03 extend 'show event' to take /i /t and /m modifiers, to select interrupt,
trap or misc event types.  you can mix them with /f as well, to show all
including zero events for traps and misc, "show event/ftm"
2009-06-05 04:31:47 +00:00