Commit graph

98 commits

Author SHA1 Message Date
Andriy Gapon 27cfcd9599 add an option for ddb ps command to print process arguments
We use ps to collect the information of all processes in textdump. But
it doesn't contain process arguments which however sometimes are very
useful for debugging.  The new 'a' modifier adds that capability.

While here, remove 'm' modifier from ddb.4.  It was in the manual page
from its very first revision, but I could not find any evidence of the
code ever supporting it.

Submitted by:	Terry Hu <thu@panzura.com>
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	Panzura
Differential Revision: https://reviews.freebsd.org/D16603
2018-08-09 11:21:31 +00:00
Bjoern A. Zeeb 7ffbcfe281 Sometimes it is helpful to get the path for a vnode.
Implement a ddb function walking the namecache to do this.

Reviewed by:		jhb, mjg
Inspired by:		gdb macro from jhb (old version)
Sponsored by:		iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D14898
2018-06-20 08:34:29 +00:00
Conrad Meyer d2e155a4f0 Remove unused declaration and update ddb.4
A follow-up to r322836.

Warnings for the unused declaration were breaking some second tier
architectures, but did not show up in Clang on x86.

Reported by:	markj (ddb.4), emaste (declaration)
Sponsored by:	Dell EMC Isilon
2017-08-24 19:16:25 +00:00
Enji Cooper 12edba1ef1 Clean up ddb(4) slightly
- Delete empty Li macro uses [1]. This removes some spaces between
  the optional command/subcommand arguments.
- Attempt to clarify "show lock" subcommand by being more
  terse/direct. This addresses an issue with a contraction [2].

MFC after:	1 week
Reported by:	make manlint [1], igor [2]
Reviewed by:	wblock
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D9858
2017-03-03 18:44:20 +00:00
Bruce Evans 808cf02c24 Determine the operand/address size of %cs in a new function
db_segsize().

Use db_segsize() to set the default operand/address size for
disassembling.  Allow overriding this with the "alternate" display
format /I.  The API of db_disasm() should be debooleanized to pass a
more general request (amd64 needs overrides to sizes of 16, 32, and
64, but this commit doesn't implement anything for amd64 since much
larger changes are needed to restore the amd64 disassmbler's support
for non-default sizes).

Fix db_print_loc_and_inst() to ask for the normal format and not the
alternate in normal operation.

This is most useful for vm86 mode, but also works for 16-bit protected
mode.

Use db_segsize() to avoid trying to print a garbage stack trace if %cs
is 16 bits.  Print something like the stack trace termination message
for a trap boundary instead.

Document that the alternate format is now useful on i386.
2016-09-25 16:30:29 +00:00
Bruce Evans f9da0afef0 Give the full syntax of the 'count' arg for all commmands that support
it.  This arg is most interesting for the 'break' command where it
never worked, and for the step command where it is powerful but too
fragile to use much.

Give the full syntax of the 'addr' arg for these commands and some
others.  Rename it from 'address' for the generic command.

Fix description of how 'count' is supposed to work for the 'break'
command.

Don't (mis)describe the syntax of the comma for the 'step' command.

Expand the description for the generic command.

Give the full syntax for the 'examine' command.  It was also missing
the possible values for the modifier.

Fix mdoc syntax error for the 'search' command.

Remove FUD about consequences of not having a trap handler for the
'search' command.
2016-09-09 13:23:07 +00:00
Mark Johnston 60d9386910 Document DDB's "alltrace" and "show all trace" commands.
MFC after:	3 days
2016-07-14 00:42:27 +00:00
Bjoern A. Zeeb b941cb8d60 Add a show igi_list command to DDB to debug IGMP state.
Obtained from:	projects/vnet
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2016-06-06 22:26:18 +00:00
Bjoern A. Zeeb 3af72c1124 Implement a show panic command to DDB which will helpfully print the
panic string again if set, in case it scrolled out of the active
window.  This avoids having to remember the symbol name.

Also add a show callout <addr> command to DDB in order to inspect
some struct callout fields in case of panics in the callout code.
This may help to see if there was memory corruption or to further
ease debugging problems.

Obtained from:	projects/vnet
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Reviewed by:	jhb (comment only on the show panic initally)
Differential Revision:	https://reviews.freebsd.org/D4527
2016-06-06 20:57:24 +00:00
Bjoern A. Zeeb 5fa0728b7d Split 'show vnets' into 'show vnet' and 'show all vnets'.
While here adjust some db_printf format string.

Document the two show commands in ddb.4.

Sponsored by:	The FreeBSD Foundation
2016-05-18 14:43:17 +00:00
Edward Tomasz Napierala 225636dccb Fix bunch of .Xrs.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-03-28 16:48:28 +00:00
Enji Cooper 01bab39427 Bump .Dd for the content changes 2016-01-16 05:35:42 +00:00
Warner Losh dce512b671 trim-time? What was I thinking. run-time.
Noticed by: Allan Jude
2016-01-16 01:30:55 +00:00
Warner Losh 21e079b85b Add some clarifications. 2016-01-16 01:13:27 +00:00
Enji Cooper 69c0fce6ba Fix spelling of IPMI
Sponsored by: EMC / Isilon Storage Division
2016-01-14 18:04:49 +00:00
Benjamin Kaduk e2b10854e4 Update .Dd, missed in r294011 2016-01-14 17:16:47 +00:00
Warner Losh 5147131ae4 Document how to enter the debugger here. I'm sure there's some better
canonical place, and the nit-pickers are welcome to move this
information there with a cross reference.

Differential Review: https://reviews.freebsd.org/D4860
2016-01-14 16:23:07 +00:00
John Baldwin db41d262d3 When dumping an rman in DDB, include the RID of each resource.
Submitted by:	Ravi Pokala (rpokala@panasas.com)
Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D4086
2015-11-05 23:12:23 +00:00
Stanislav Sedov b1ef3a44d6 Bump the date after the show devmap addition. 2015-03-17 00:15:55 +00:00
Stanislav Sedov 8d9cea262f Document the show devmap DDB command. 2015-03-17 00:12:29 +00:00
Sergey Kandaurov 0d93965f43 Grammar and spelling fixes. 2014-07-22 19:37:38 +00:00
Bryan Drewery 1785b1c474 Also link 'show bio' to g_bio(9.)
X-MFC-With:	r268715
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2014-07-15 22:57:50 +00:00
Bryan Drewery cdde13b8e8 Document the 'show bio' command added in 2009.
While here also reword 'show buffer' to have an 'addr' argument and to
match other struct documentation.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2014-07-15 21:13:08 +00:00
Warner Losh 460434b9e7 Save some space by noting we don't have any alternative instruction formats. 2013-11-07 16:58:09 +00:00
Robert Watson 8cdb4d8967 Update ddb(9) to show how to print 64-bit values with "examine".
MFC after:	3 days
Approved by:	re (gjb)
2013-09-30 09:21:17 +00:00
Joel Dahl 33bfa8dc1d Sort textdump options list.
Submitted by:	bde
2012-11-01 17:17:05 +00:00
Alfred Perlstein 21d748a957 Small textdump enhancements.
Allow textdumps to be called explicitly from DDB.

If "dump" is called in DDB and textdumps are enabled then abort the
dump and tell the user to turn off textdumps.

Add options TEXTDUMP_PREFERRED to turn textdumps on by default.
Add options TEXTDUMP_VERBOSE to be a bit more verbose while textdumping.

Reviewed by: rwatson

MFC after:	2 weeks
2012-11-01 04:07:08 +00:00
Joel Dahl 2e27f04f55 Minor mdoc nit. 2012-05-12 19:53:44 +00:00
Glen Barber 50d922a02e General mdoc(7) and typo fixes.
PR:		167776
Submitted by:	Nobuyuki Koganemaru (kogane!jp.freebsd.org)
MFC after:	3 days
2012-05-12 03:25:46 +00:00
Konstantin Belousov ec1c1d41b3 Document 'findstack'.
MFC after:	1 week
2011-12-16 11:52:33 +00:00
Attilio Rao 4b547324c0 Disconnect sun4v architecture from the three.
Some files keep the SUN4V tags as a code reference, for the future,
if any rewamped sun4v support wants to be added again.

Reviewed by:	marius
Tested by:	sbruno
Approved by:	re
2011-05-14 01:53:38 +00:00
Ulrich Spörlein 0d9deed52c mdoc: drop redundant .Pp and .LP calls
They have no effect when coming in pairs, or before .Bl/.Bd
2010-10-08 12:40:16 +00:00
Konstantin Belousov 3037e5d20a Document "show cdev" command.
MFC after:	3 days
2010-09-05 14:52:27 +00:00
Ulrich Spörlein b59e4b2cee mdoc: remove duplicate width argument 2010-05-27 13:56:47 +00:00
Bjoern A. Zeeb 0f59fbc3d6 MFp4 @178364:
Implement an optional delay to the ddb reset/reboot command.

This allows textdumps to be run automatically with unattended reboots
after a resonable timeout, while still permitting an administrator to
break into debugger if attached to the console at the time of the
event for further debugging.  Cap the maximum delay at 1 week to avoid
highly accidental results, and default to 15s in case of problems
parsing the timeout value.

Move hex2dec helper function from db_thread.c to db_command.c to make
it generally available and prefix it with a "db_" to avoid namespace
collisions.

Reviewed by:	rwatson
MFC after:	4 weeks
2010-05-24 16:41:05 +00:00
Ulrich Spörlein 63d46d1d5e Fix several typos in macros or macro misusage.
Found by:	make manlint
Reviewed by:	ru
Approved by:	philip (mentor)
2010-03-12 10:01:06 +00:00
John Baldwin 90381ef23f - Drop a reference to an older 'kdb' debugger that FreeBSD never had.
- Tweak a word choice.
- Drop a reference to Alpha.
2008-12-12 05:42:57 +00:00
Bjoern A. Zeeb 413628a7e3 MFp4:
Bring in updated jail support from bz_jail branch.

This enhances the current jail implementation to permit multiple
addresses per jail. In addtion to IPv4, IPv6 is supported as well.
Due to updated checks it is even possible to have jails without
an IP address at all, which basically gives one a chroot with
restricted process view, no networking,..

SCTP support was updated and supports IPv6 in jails as well.

Cpuset support permits jails to be bound to specific processor
sets after creation.

Jails can have an unrestricted (no duplicate protection, etc.) name
in addition to the hostname. The jail name cannot be changed from
within a jail and is considered to be used for management purposes
or as audit-token in the future.

DDB 'show jails' command was added to aid debugging.

Proper compat support permits 32bit jail binaries to be used on 64bit
systems to manage jails. Also backward compatibility was preserved where
possible: for jail v1 syscalls, as well as with user space management
utilities.

Both jail as well as prison version were updated for the new features.
A gap was intentionally left as the intermediate versions had been
used by various patches floating around the last years.

Bump __FreeBSD_version for the afore mentioned and in kernel changes.

Special thanks to:
- Pawel Jakub Dawidek (pjd) for his multi-IPv4 patches
  and Olivier Houchard (cognet) for initial single-IPv6 patches.
- Jeff Roberson (jeff) and Randall Stewart (rrs) for their
  help, ideas and review on cpuset and SCTP support.
- Robert Watson (rwatson) for lots and lots of help, discussions,
  suggestions and review of most of the patch at various stages.
- John Baldwin (jhb) for his help.
- Simon L. Nielsen (simon) as early adopter testing changes
  on cluster machines as well as all the testers and people
  who provided feedback the last months on freebsd-jail and
  other channels.
- My employer, CK Software GmbH, for the support so I could work on this.

Reviewed by:	(see above)
MFC after:	3 months (this is just so that I get the mail)
X-MFC Before:   7.2-RELEASE if possible
2008-11-29 14:32:14 +00:00
Ed Schouten 58a5b17f7b Increase the date in the manual page, which should have been done in r183922.
In r183922 I introduced a new DDB command, documented it, but forgot to
bump the date in the manual page.

Pointed out by:	bz
2008-10-18 06:23:08 +00:00
Ed Schouten f6dd5c15fd Import some improvements to the TTY code from the MPSAFE TTY branch.
- Change the ddb(4) commands to be more useful (by thompsa@):
  - `show ttys' is now called `show all ttys'. This command will now
    also display the address where the TTY data structure resides.
  - Add `show tty <addr>', which dumps the TTY in a readable form.

- Place an upper bound on the TTY buffer sizes. Some drivers do not want
  to care about baud rates. Protect these drivers by preventing the TTY
  buffers from getting enormous. Right now we'll just clamp it to 64K,
  which is pretty high, taking into account that these buffers are only
  used by the built-in discipline.

- Only call ttydev_leave() when needed. Back in April/May the TTY
  reference counting mechanism was a little different, which required us
  to call ttydev_leave() each time we finished a cdev operation.
  Nowadays we only need to call ttydev_leave() when we really mark it as
  being closed.

- Improve return codes of read() and write() on TTY device nodes.

- Make sure we really wake up all blocked threads when the driver calls
  tty_rel_gone(). There were some possible code paths where we didn't
  properly wake up any readers/writers.

- Add extra assertions to prevent sleeping on a TTY that has been
  abandoned by the driver.

- Use ttydev_cdevsw as a more reliable method to figure out whether a
  device node is a real TTY device node.

Obtained from:	//depot/projects/mpsafetty/...
Reviewed by:	thompsa
2008-10-15 16:58:35 +00:00
Simon L. B. Nielsen f4b548d73e - Document that 'show alllocks' and 'show locks' are only available
with witness.
- Remove references to non-existing witness(9) and replace with
  witness(4) where appropriate.
- Bump document date.

MFC after:	3 days
2008-10-04 14:12:09 +00:00
Konstantin Belousov 52dfc8d7da Add the ffs structures introspection functions for ddb.
Show the b_dep value for the buffer in the show buffer command.
Add a comand to dump the dirty/clean buffer list for vnode.

Reviewed by:	tegge
Tested and used by:   pho
MFC after:   1 month
2008-09-16 11:19:38 +00:00
Ed Schouten bc093719ca Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:

- Improved driver model:

  The old TTY layer has a driver model that is not abstract enough to
  make it friendly to use. A good example is the output path, where the
  device drivers directly access the output buffers. This means that an
  in-kernel PPP implementation must always convert network buffers into
  TTY buffers.

  If a PPP implementation would be built on top of the new TTY layer
  (still needs a hooks layer, though), it would allow the PPP
  implementation to directly hand the data to the TTY driver.

- Improved hotplugging:

  With the old TTY layer, it isn't entirely safe to destroy TTY's from
  the system. This implementation has a two-step destructing design,
  where the driver first abandons the TTY. After all threads have left
  the TTY, the TTY layer calls a routine in the driver, which can be
  used to free resources (unit numbers, etc).

  The pts(4) driver also implements this feature, which means
  posix_openpt() will now return PTY's that are created on the fly.

- Improved performance:

  One of the major improvements is the per-TTY mutex, which is expected
  to improve scalability when compared to the old Giant locking.
  Another change is the unbuffered copying to userspace, which is both
  used on TTY device nodes and PTY masters.

Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.

Obtained from:		//depot/projects/mpsafetty/...
Approved by:		philip (ex-mentor)
Discussed:		on the lists, at BSDCan, at the DevSummit
Sponsored by:		Snow B.V., the Netherlands
dcons(4) fixed by:	kan
2008-08-20 08:31:58 +00:00
Robert Watson 0dda506c4c DDB scripting, textdumps, output capture, etc, all will appear in
FreeBSD 7.1 before 8.0 ships.

Spotted by:	Ulrich Spoerlein <uspoerlein at gmail dot com>
MFC after:	3 days
2008-08-03 14:14:43 +00:00
Maxim Konovalov dc5aa2110e o Document "show conifhk", wording from r180610 commit log.
Reviewed by:	rwatson
2008-07-21 10:03:02 +00:00
Bjoern A. Zeeb dea0ed6690 Add a `show cpusets' DDB command to print numbered root and
assigned CPU affinity sets.

Reviewed by:	brooks
2008-07-07 21:32:02 +00:00
Wojciech A. Koszek e14e342b14 Change header file references from <filename>.h to
path relative to /usr/include. It looks much better anyway.

Instead of referencing "socket", which is bogus, reference
'sys/socket.h', which is what should be placed here from
the beggining.

Suggested by:	maxim
2008-06-08 21:08:20 +00:00
Wojciech A. Koszek cad20b04fe Fix the way the date must be specified (leading 0 is redundant).
Fix several spelling mistakes brought by my earlier commit.
Trim whitespace.

Submitted by:	maxim
2008-06-08 21:01:39 +00:00
Wojciech A. Koszek b1772905eb Bring more commands to the ddb(4) manual page. This should be considered
"complete" list, but some commands might be still missing.

Reviewed by:	julian
2008-06-08 09:09:08 +00:00
Pawel Jakub Dawidek f6a83858fc Document 'show mount' command. 2008-04-28 14:11:23 +00:00