Commit Graph

71 Commits

Author SHA1 Message Date
ozaki-r
9f84c587df Don't use an unset value as an address
Instead, show usage if no address is passed.
2015-02-27 00:47:30 +00:00
matt
bac0f3665b Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
2014-09-05 09:27:24 +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
b799360e83 If we are DIAGNOSTIC don't try to go further if we failed to take the
lock, because we are going to trigger a KASSERT. Also hold the lock
longer and take the proc lock for kpsignal(). Maybe we should add
mutex_steal() and mutex_return() for the debugger? Lock correction
suggestion from jmcneill.
2011-12-03 16:25:49 +00:00
christos
d5b7cb3520 deal with the proc_lock mutex. 2011-12-02 23:57:58 +00:00
rmind
e225b7bd09 Welcome to 5.99.53! Merge rmind-uvmplock branch:
- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
2011-06-12 03:35:36 +00:00
christos
4d927829db re-instate db_kill_proc 2011-05-31 03:40:22 +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
ad
d991fcb3b6 More changes to improve kern_descrip.c.
- Avoid atomics in more places.
- Remove the per-descriptor mutex, and just use filedesc_t::fd_lock.
  It was only being used to synchronize close, and in any case we needed
  to take fd_lock to free the descriptor slot.
- Optimize certain paths for the <NDFDFILE case.
- Sprinkle more comments and assertions.
- Cache more stuff in filedesc_t.
- Fix numerous minor bugs spotted along the way.
- Restructure how the open files array is maintained, for clarity and so
  that we can eliminate the membar_consumer() call in fd_getfile().  This is
  mostly syntactic sugar; the main functional change is that fd_nfiles now
  lives alongside the open file array.

Some measurements with libmicro:

- simple file syscalls are like close() are between 1 to 10% faster.
- some nice improvements, e.g. poll(1000) which is ~50% faster.
2009-05-24 21:41:25 +00:00
ad
912b4160fd Make 'show event', 'dmesg' work with crash(8).
XXX dmesg fails exactly the same way as /sbin/dmesg.
2009-03-21 13:06:39 +00:00
mrg
d2ea53a056 include <stdbool.h> if not _KERNEL, and don't include kauth.h if _KERNEL.
now crash builds on i386.
2009-03-09 06:07:05 +00:00
mrg
4540375faf include ddb headers *after* sys/types.h or sys/param.h. 2009-03-08 11:40:00 +00:00
ad
cd6b1c8f08 Make ddb compile and work in userspace. Mostly this is comprised of three
types of changes:

- Add a few new methods to replace stuff like p_find(), CPU_INFO_FOREACH.

- Use db_read_bytes() instead of accessing kernel structures directly,
  and similar changes.

- Add ifdef _KERNEL where the above hasn't been done, and an XXX comment.
2009-03-07 22:02:16 +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
563a207d33 Default 'show all procs' to /l. People tend to type 'ps' without modifiers
when providing information about deadlocks. Without the thread info it's
not very useful.
2009-02-04 20:17:58 +00:00
ad
31afc5b6d8 Add some basic DDB stuff for modules. 2008-11-25 15:14:07 +00:00
ad
13de59a192 ifdef AIO 2008-11-14 23:37:50 +00:00
rmind
97561001a3 Replace more intptr_t to uintptr_t when casting VA. 2008-10-03 14:52:11 +00:00
blymn
a7db4edf3b Take care not to dereference NULL datapointer from fd table
Make output more readable and label what lock we are examining.
2008-07-14 10:15:11 +00:00
blymn
380be0c111 Fix indents. 2008-07-10 13:28:23 +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
ad
8838af190c ps/w: display LWP info. 2007-12-02 19:35:33 +00:00
rmind
2cecf9bbe9 Implementation of POSIX message queues.
Reviewed by: <ad>, <tech-kern>
2007-09-07 18:56:02 +00:00
dsl
5afdebabb4 include cdefs.h before opt_xxx.h 2007-07-19 21:54:51 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
yamt
f03010953f merge yamt-idlelwp branch. asked by core@. some ports still needs work.
from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.
2007-05-17 14:51:11 +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
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
elad
874fef3711 integrate kauth. 2006-05-14 21:19:33 +00:00
uwe
adcd5c2d11 db_show_sched_qs: fix pointer cast lint considers troublesome. 2006-01-22 01:08:50 +00:00
uwe
19707b27a5 Add /l to show all procs usage. 2006-01-22 00:50:51 +00:00
uwe
91321511a9 This is not IOCCC. Replace " >"[cp == p] with conditional expression.
Makes lint happy.  Probably generates better code too (does on sh3).
2006-01-22 00:47:50 +00:00
he
1067be953e After addition of "show all pools", we now need <sys/pool.h> here.
Fixes build problem for mac68k.
2005-12-03 22:47:25 +00:00
yamt
a004e1d63c add "show all pools" command for ddb. 2005-12-01 13:21:05 +00:00
yamt
aec75b1cc6 - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
  have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
  from sys/bufq.h to sys/bufq_impl.h.
  (is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c.  (not tested)
2005-10-15 17:29:10 +00:00
drochner
4d205d8853 more constification fallout 2005-06-01 12:25:27 +00:00
perry
477853c351 nuke trailing whitespace 2005-02-26 22:58:54 +00:00
nathanw
0ac1c38100 Make ddb's "show sched_qs" aware of big-endian sched_qs arrangements. 2004-07-27 02:15:07 +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
uwe
ca90f34170 Widen FLAGS column for ps/l so that all defined l_flag flags fit. 2003-09-07 14:14:36 +00:00
agc
aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
simonb
c9bc6f3a9a Allow the dmesg command to show the last N bytes of the kernel message
buffer.
2003-07-02 07:05:29 +00:00
fvdl
d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr
960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
atatat
b5329c1d85 (1) Don't print the message buffer (via ddb's dmesg command) if the
message buffer has not yet been set up, mimicking code from the top of
the sysctl routine for retrieving the message buffer.

(2) Add a /l modifier to the trace command.  This makes it print the
backtrace using printf() instead of db_printf(), which has the nice
side-effect of also putting it into the message buffer.  A kernel with
ddb in it but disabled (ie, ddb.onpanic set to zero) will print a
backtrace (which ends up in the message buffer) before dumping (or
not, depending on the value of kern.dump_on_panic) and rebooting, but
if ddb is not disabled, the backtrace is not printed, and there's no
way to get it to display a backtrace such that you can retrieve it
after the dump.  The backtrace printed by gdb is sometimes a little
different.

(3) Documentation for the above.
2003-05-15 13:18:18 +00:00