Commit Graph

71 Commits

Author SHA1 Message Date
dillon
460b147c86 Handle case where no swap is configured 1999-02-06 06:31:57 +00:00
bde
3b406daf49 Removed evil typedef kvm_swap_t and all uses of it (not many).
Hoped for by:	wollman
1999-01-27 11:29:15 +00:00
dillon
0475d9e9a1 Fix swap radix tree dump formatting ( pstat -ss ), it was printing the
wrong radix for recursive subnodes.
1999-01-25 04:07:07 +00:00
bde
475bbb5f0e Fixed missing cross reference to kvm_getfiles.
This man page may be overdoing the cross references by referencing
man pages that are just links to other pages that are referenced.

kvm_uread() is still completely undocumented in kvm*.3.
1999-01-23 08:12:12 +00:00
bde
17be6da5ee Fixed unsorting of SRCS and MAN3 in previous commit.
Sorted MLINKS.
1999-01-23 07:55:15 +00:00
bde
2c85b7717e Fixed unsorting of cross references in previous commit. 1999-01-23 07:34:56 +00:00
dillon
a5e0136be2 Oops, forgot this. Needed by libkvm. 1999-01-23 04:58:35 +00:00
dillon
5cbc2f5184 Fix type-o's in manual 1999-01-22 11:03:55 +00:00
dillon
e806c85973 Add SWIF_DEV_PREFIX flag to add "/dev/..." to device name. 1999-01-22 10:57:03 +00:00
dillon
36541cbd36 Implement kvm_getswapinfo() libkvm function. Will be used by
pstat, top, and systat.
1999-01-22 10:36:04 +00:00
bde
9d6a8cdb3a <sys/types.h> isn't a prerequisite for <kvm.h>. 1998-12-16 19:12:14 +00:00
bde
3c29f05afe The previous commit was bogus. <stdlib.h> was never a prerequisite
for <kvm.h> or kvm_getloadavg(), and <sys/types.h> was only a
prerequisite for <kvm.h> when <kvm.h> was broken.
1998-12-16 19:04:54 +00:00
bde
e096a42520 Declare size_t and ssize_t if they are not already declared, so that
<kvm.h> is self-sufficient again.

Moved typedefs and forward struct declarations out of __BEGIN_DECLS/
__END_DECLS.

Don't comment out the prototype for kvm_uread().  This was a 4 year
old kludge for previous breakage of self-sufficiency.  The prototypwe
was broken instead.

Fixed bitrot (const poisoning) in the type of kvm_uread().

Fixed order of the declaration of kvm_uread().
1998-12-16 18:59:47 +00:00
bde
f2d66b8784 Adjust for kern.ps_strings and PS_STRINGS not being a pointer. This
fixes a type mismatch in the call to kvm_uread().  The bug has gone
undetected for almost 3 years because kvm_uproc()'s protoype has been
disabled for almost 4 years.

Trust sysctlbyname() to work properly if it succeeds.

Fixed style bugs in revs. 1.19 and 1.22.
1998-12-16 18:31:51 +00:00
dillon
bb5a4a9fc4 Add required #include references to manual page 1998-12-13 02:32:59 +00:00
des
3a59a5e55b Avoid the "Cannot allocate memory" problem that appears on heavily
loaded systems by retrying the sysctl() with a larger buffer if it
fails with ENOMEM. For good measure, allocate 10% more memory than
sysctl() claims is necessary.

PR:		8275
Reviewed by:	David Greenman <dg@freebsd.org>
1998-10-12 20:36:33 +00:00
dfr
e0131d813d Adjust the declarations of kvm_read and kvm_write to match reality a little
closer.
1998-09-16 09:30:14 +00:00
imp
c6419dc030 Replace memory leaking instances of realloc with non-leaking reallocf.
In some cases replace if (a == null) a = malloc(x); else a =
realloc(a, x); with simple reallocf(a, x).  Per ANSI-C, this is
guaranteed to be the same thing.

I've been running these on my system here w/o ill effects for some
time.  However, the CTM-express is at part 6 of 34 for the CAM
changes, so I've not been able to do a build world with the CAM in the
tree with these changes.  Shouldn't impact anything, but...
1998-09-16 04:17:47 +00:00
kato
74515ee422 Change ${MACHINE} into ${MACHINE_ARCH} to support MACHINE=pc98. 1998-09-09 11:27:33 +00:00
dfr
e15df4b9fc The length argument to sysctl is now size_t. 1998-08-25 07:52:33 +00:00
gpalmer
2eeb091f88 Nuke unsupported architecture files 1998-08-22 14:34:59 +00:00
dfr
07c811dd6b Add an alpha machdep for kvm. The vatop functions are stubbed out for
now (mainly because I haven't ported them from the NetBSD crash dump
environment).

Obtained from: NetBSD
1998-08-15 12:12:22 +00:00
phk
a0666d1453 Allow /dev/null as path for the "/dev/mem" file, and assume that people
know what they're doing if they do that.  This will allow ps to use
the kvm_proc.c bits without having access to /dev/mem.

Fix kvm_proc.c to not need /dev/mem for access to argv/envp
1998-06-30 21:29:44 +00:00
bde
ac7024beac Fixed bugs in the conversion of kvm to to use procfs in rev.1.3. All
are in kvm_uread():
- the setting of errno before checking it in the lseek() was lost.
- EOF handling was lost.  kvm_uread() retried forever on EOF.  EOF is
  not really an error, but report it one as in rev.1.2.
- reporting of errno after a read error was lost.

Fixed style bugs in rev.1.3 and rev.1.12.

Not fixed: errno is not reported after lseek() failures.
1998-01-16 16:45:05 +00:00
bde
064a439a2c -I${DESTDIR}/sys -> -I${.CURDIR}/../../sys. 1997-08-26 14:13:02 +00:00
tegge
2aeb491115 Copy code from gnu/usr.bin/gdb/gdb/kvm-fbsd.c to deal with 4 MB pages. 1997-08-17 17:42:59 +00:00
asami
f5aebd03a4 Add ${DESTDIR} in front of absolute path. 1997-07-18 06:32:39 +00:00
tegge
033649779e Fill in parent process id when reading process information from a
memory dump. This fixes one of the problems noted in PR kern/3581.
1997-06-25 20:56:48 +00:00
bde
b5dfde431c Fixed #include and/or prototype bugs in synopsis. 1997-04-19 15:57:20 +00:00
bde
cc04673c2b Fixed #include and/or prototype bugs in synopsis. 1997-04-13 14:10:05 +00:00
peter
3447762204 Revert $FreeBSD$ to $Id$ 1997-02-22 15:12:41 +00:00
wosch
2adeb3569f Sort cross references. 1997-01-20 23:23:22 +00:00
jkh
9c0cd3f9df Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
mpp
6a0ab5cda8 Fix the short description of kvm_getloadavg(3) to reflect
what the function really does.

Also fix a small mdoc problem I noticed while in there.

Obtained from: NetBSD-bugs (NetBSD PR#3077)
1997-01-02 20:16:20 +00:00
ache
66b7cb23c2 kvm_malloc:
When malloc fails. don't try to memset NULL pointer, it cause core dump
Replace malloc+memset with calloc, theoretically it can do some
optimization of zeroing process internally
Improve error diagnostic
1996-11-11 08:28:47 +00:00
peter
8780c6c2bb Implement virtual-to-physical address mapping for the kvm library on
dead kernel debugging.  The previous code was a "do nothing".

The most obvious side effect of this is that you can now do things like
this and reasonably expect them to work:
  dmesg -M /var/crash/vmcore.3 -N /var/crash/kernel.3
  ps -axl -M /var/crash/vmcore.3 -N /var/crash/kernel.3

A good deal of this was lifted from the gdb code to do this, as well as
from NetBSD's libkvm (which has completely different VM macros)
1996-10-07 20:17:50 +00:00
jkh
a3b50e31fd General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
1996-07-12 18:57:58 +00:00
phk
fba4fb2dda Pass correct length OID to kernel for KERN_PROC_ALL. 1996-06-06 17:16:52 +00:00
phk
32e6520ae7 NBPG -> PAGE_SIZE 1996-05-02 09:23:36 +00:00
hsu
198573b62b From Lite2: proc and file LIST changes 1996-03-11 05:34:46 +00:00
peter
a87630bdaf If the two recently added sysctl variables exist, use those rather than
the statically compiled PS_STRINGS and USRSTACK variables.  This prevents
programs using setproctitle from coredumping if the kernel VM is increased,
and stops libkvm users (w, ps, etc) from needing to be recompiled if only
the VM layout changes.
1996-02-24 14:37:30 +00:00
mpp
1e4a679a26 Add some missing MLINKS, correct some cross references, correct some
file locations and some minor formatting/style problems.
1996-02-09 16:20:10 +00:00
mpp
b56c7090ff Another round of spelling fixes. 1996-01-30 18:13:11 +00:00
peter
48bfdde0e0 Extract the login name when doing a ps on a dead kernel. 1996-01-01 17:08:17 +00:00
peter
1164bf6c74 Cosmetic cleanup and documentation of kvm_argv.. Hopefully the flow of
the routine can be much more easily understood now... :-)
1995-12-16 09:25:17 +00:00
peter
640c658316 phkmalloc strikes again! :-) Another use of un-cleared returns from
malloc squashed...
1995-12-09 04:45:50 +00:00
peter
a1e82d1d70 Updates to read the extra indirection in ps_strings. Note that any
static executables that depend on this will need to be relinked (ie: do
this before 'ps'), but the dynamic linked stuff should be OK (ie: 'w')

Obtained from: NetBSD (not much point reinventing the wheel.. :-)
1995-12-09 04:42:51 +00:00
bde
c0c9ccd517 Removed unnecessary include of <sys/tty.h>. tty.h apparently once had
some user interfaces in it.  It no longer does.
1995-10-22 18:52:23 +00:00
bde
a60c922aa0 41 headers must be implicitly included and one more (<sys/param.h>) must
be explicitly included before kvm_getprocs() can be used.
1995-06-25 03:35:49 +00:00
joerg
372fa91a52 Update the man page for kvm_getprocs.3 to reflect our sysctl-based
kvm mechanism.

Submitted by:	(Vic Abell) <abe@cc.purdue.edu>
1995-06-24 18:53:09 +00:00