Commit Graph

44 Commits

Author SHA1 Message Date
riastradh fddc6b2f61 ddb: New db_stack_trace_print_ra.
Takes an optional extra argument for the return address so that the
stack parser has a chance to use instruction-dependent interpretation
of the frame to find parent frames.

Implemented only on Alpha for now, which needs it.  Other
architectures just ignore the extra argument.

PR port-alpha/57716

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-11-21 14:35:01 +00:00
martin 3007f1403a Back out the following revisions on behalf of core:
sys/sys/lwp.h: revision 1.228
	sys/sys/pipe.h: revision 1.40
	sys/kern/uipc_socket.c: revision 1.306
	sys/kern/kern_sleepq.c: revision 1.84
	sys/rump/librump/rumpkern/locks_up.c: revision 1.13
	sys/kern/sys_pipe.c: revision 1.165
	usr.bin/fstat/fstat.c: revision 1.119
	sys/rump/librump/rumpkern/locks.c: revision 1.87
	sys/ddb/db_xxx.c: revision 1.78
	sys/ddb/db_command.c: revision 1.187
	sys/sys/condvar.h: revision 1.18
	sys/ddb/db_interface.h: revision 1.42
	sys/sys/socketvar.h: revision 1.166
	sys/kern/uipc_syscalls.c: revision 1.209
	sys/kern/kern_condvar.c: revision 1.60

  Add cv_fdrestart() [...]
  Use cv_fdrestart() to implement fo_restart.
  Simplify/streamline pipes a little bit [...]

This changes have caused regressions and need to be debugged.
The cv_fdrestart() addition needs more discussion.
2023-11-02 10:31:55 +00:00
ad 61757a071b Simplify/streamline pipes a little bit:
- Allocate only one struct pipe not two (no need to be bidirectional here).
- Then use f_flag (FREAD/FWRITE) to figure out what to do in the fileops.
- Never wake the other side or acquire long-term (I/O) lock unless needed.
- Whenever possible, defer wakeups until after locks have been released.
- Do some things locklessly in pipe_ioctl() and pipe_poll().

Some notable results:

- -30% latency on a 486DX2/66 doing 1 byte ping-pong within a single process.
- 2.5x less lock contention during "make cleandir" of src on a 48 CPU machine.
- 1.5x bandwith with 1kB messages on the same 48 CPU machine (8kB: same b/w).
2023-10-13 19:07:08 +00:00
ad 9bf2517556 Add some simple DDB show commands: condvar, selinfo, sleepq 2023-10-07 20:27:20 +00:00
mrg d3874c24e6 don't provide db_lstacktrace() for crash (yet?). 2021-04-18 01:28:50 +00:00
mrg e2d256dc93 db_lstacktrace() can't use db_stacktrace_print and log() directly.
log() takes a 'int level' first argument, that must be supplied.
add an inline wrapper that calls vlog() with LOG_INFO, and the
supplied va_list.

(not noticed because this macro is not used anywhere in src but
i have a use in some uncommited code, that now failed to compile.)
2021-04-18 01:05:23 +00:00
simonb 5267a28fdc Allow for MD code to use a different function than db_stack_trace_print()
to be used with db_stacktrace() and friends by pre-defining the
db_stacktrace_print macro.
2021-02-10 07:17:39 +00:00
mrg 3b128d1cd4 add two db_stack_print_trace frontends that emit to the system log
or the user's terminal.

kind of wrong to be called db_*() when they'll typically be used
outside of ddb itself, but db_stacktrace() itself is no different.
fix this by making the stack trace support separate from ddb?
2019-06-02 06:09:17 +00:00
mlelstv 2428c0d42d Add command to print device list. 2018-03-04 07:14:50 +00:00
joerg e64612f440 Revert printf return value change. 2017-10-27 12:25:14 +00:00
utkarsh009 f11595bab5 [syzkaller] Cast all the printf's to (void *)
> as a result of new printf(9) declaration.
2017-10-27 09:59:16 +00:00
christos ea1524ad60 add a simple stacktrace macro 2017-01-04 21:25:41 +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
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
christos b1c34b0c9a add __printflike where needed 2012-02-10 02:14:23 +00:00
joerg a2bf8e5d19 Introduce DDB_EXPR_FMT and replace the logic around DB_EXPR_T_IS_QUAD. 2011-05-26 15:34:12 +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
yamt f68e4571e5 - fix vmem unittest. rename VMEM_DEBUG so that it won't be abused again.
- reimplement vmem sanity checks with less code duplication.
- reimplement ddb vmem-related commands in a more consistent ways.
  remove automatic whatis.
2009-02-18 13:31:59 +00:00
ad 31afc5b6d8 Add some basic DDB stuff for modules. 2008-11-25 15:14:07 +00:00
blymn 8a19e9911c Add a show files command that prints the vnodes associated with a
given struct proc and, if LOCKDEBUG is built in, the lock status of
the uvmobject.
2008-07-10 12:42:24 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
rmind 2cecf9bbe9 Implementation of POSIX message queues.
Reviewed by: <ad>, <tech-kern>
2007-09-07 18:56:02 +00:00
rmind 67d703cf25 Import of POSIX Asynchronous I/O.
Seems to be quite stable. Some work still left to do.

Please note, that syscalls are not yet MP-safe, because
of the file and vnode subsystems.

Reviewed by: <tech-kern>, <ad>
2007-04-30 14:44:28 +00:00
matt 93feeb1203 Fix lossage from boolean_t -> bool and updated x86 bus_dma. 2007-02-22 04:38:02 +00:00
thorpej 712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
uwe 0df816cb4b Add CONSTCOND to DB_EXPR_T_IS_QUAD. 2006-01-21 01:11:43 +00:00
yamt a004e1d63c add "show all pools" command for ddb. 2005-12-01 13:21:05 +00:00
drochner 4d205d8853 more constification fallout 2005-06-01 12:25:27 +00:00
christos 02e608f6b8 Add lots of const. 2005-05-29 21:31:05 +00:00
yamt 8ca4d66b5e move decl of db_machine_command_table from db_interface.h to db_command.c
to avoid an array of incomplete type.  found by gcc4.
2005-04-29 10:40:16 +00:00
thorpej c7a178e4a9 Add a "show sched_qs" command to dump the run queues. Format is:
1	pid.lid (p_comm)
	pid.lid (p_comm)
 ...

If a queue has procs, but no sched_whichqs bit, it shows:
!1	pid.lid (p_comm)
2003-09-20 03:02:03 +00:00
briggs 819d74ccf1 Somehow overlooked in earlier commits: prototype db_kgdb_cmd(). 2003-05-22 20:17:11 +00:00
scw 66cf68c402 On some platforms, sizeof(db_expr_t) > sizeof(long), so add a method
to select the right format string (at compile time) when displaying
variables of type db_expr_t.

This fixes a problem where ddb(4) would only display the low 32-bits
of registers for an ILP32 kernel on SH5, even though registers
(and db_expr_t) are always 64-bits wide.
2003-05-17 09:58:03 +00:00
simonb 4eaa4d66a8 ANSIfy, KNF.
Make some variables and functions static when not used outside of a module.
Make variables in headers extern.
Delete the unused db_find_watchpoint() function.
2002-02-15 07:33:48 +00:00
thorpej 47514a31be Remove unneeded declarations of the db_machine_init() function. The
ARM ports are the only ones that actually have one, and it is about
to change.
2001-11-09 06:52:23 +00:00
atatat 124ae5b65c Add an easy way to dump the message buffer from ddb. 2001-07-31 04:28:16 +00:00
jdolecek 8b24036797 Require the machine-dependant DDB commands to be in db_machine_command_table[]
and link it directly to db_command_table[] so that it's not necessary
to do this at runtime. Make db_machine_command_table[] const on all ports.
g/c now unneded stuff, like db_machine_commands_install(), db_machine_init()

Patch written by enami.
2001-01-22 13:56:55 +00:00
jhawk 8e44b27348 Rename the machine-specific stack trace printing functions
from db_stack_trace_cmd() to db_stack_trace_print(),
and add an additional argument, a function pointer for an
output routine (i.e. printf() or db_printf()).

Add db_stack_trace_cmd() in db_command.[ch], calling
db_stack_trace_print() with db_printf() as the printer.

Move count==-1 special handling from db_stack_trace_print() [nee
db_stack_trace_cmd()] to db_stack_trace_cmd() [nascent here].

Again, I'm unable to test compilation on all affected platforms,
so advance apologies for potential brokenness.
2000-05-26 03:34:24 +00:00
jhawk ca31d672e2 Install "show arptab" (db_show_arptab) in the ddb command tree.
Move prototype from netinet/if_inarp.h to ddb/db_interface.h.
Change function to have standard ddb parameters (though they're
ignored).
2000-05-20 03:08:41 +00:00
christos bd52ba3c5a Assign copyright to TNF. 1998-09-05 14:42:05 +00:00
gwr 8ae8b46853 Add db_kill_proc(). 1997-05-07 18:50:50 +00:00
christos 8c2e3b4b11 DDB prototype changes. 1996-02-05 01:56:47 +00:00