Commit Graph

83 Commits

Author SHA1 Message Date
Poul-Henning Kamp
b9df5231ca Introduce commandline caching in the kernel.
This fixes some nasty procfs problems for SMP, makes ps(1) run much faster,
and makes ps(1) even less dependent on /proc which will aid chroot and
jails alike.

To disable this facility and revert to previous behaviour:
        sysctl -w kern.ps_arg_cache_limit=0

For full details see the current@FreeBSD.org mail-archives.
1999-11-16 20:31:58 +00:00
Peter Wemm
8771870c76 Delete the sf (swapfile) arg to an internal function that used to point to
/dev/drum but has not been used for a LONG time.
Add $FreeBSD$
1999-10-11 05:01:17 +00:00
Peter Wemm
59c9cd2bce Install <kvm.h> from here (after repo copy) so it's all in one package. 1999-10-04 14:56:04 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Peter Wemm
a4add9a9b1 $Id$ -> $FreeBSD$ 1999-08-27 23:45:13 +00:00
Bruce Evans
480bc7e108 Don't open the swap file. The open descriptor for it hasn't been used
for over 5 years since we switched to using procfs for kvm_uread().
This cleanup was motivated by recent breakage of the default swap file
(/dev/drum) when swapon() has not been called.
1999-08-25 03:01:54 +00:00
Nik Clayton
fbc400a67a Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 20:50:10 +00:00
Peter Wemm
bf0e1ee370 Tidy up references to <sys/rlist.h> and support for the old swap management
that went away in January.
1999-05-11 14:32:18 +00:00
Bruce Evans
34597fa67f Oops, the previous log message should have been:
Include <machine/ansi.h> so that this file is self-sufficient again.
Rev.1.6 doesn't do this as claimed unless <nlist.h> has nonstandard
pollution.

Cleaned up includes.
1999-04-10 03:49:43 +00:00
Bruce Evans
95a7753b24 Declare mkstemps(). 1999-04-09 15:06:56 +00:00
Andrew Gallatin
cad59f82df make libkvm capable of dealing with a crashdump on alphas
Reviewed by: Doug Rabson <dfr@nlsystems.com>
1999-03-12 14:47:33 +00:00
Bruce Evans
114d756447 Don't use u_long in the synopsis, since u_long is not part of the kvm
interface.
1999-03-05 17:32:53 +00:00
Dmitrij Tejblum
bd54ec1edf From rev. 1.12 of usr.sbin/pstat/pstat.c by phk:
Reflect the fact that we do not swap on the first <dmmax> blocks of a
swapdev, to protect disklabels and other such magic stuff.
1999-02-14 21:42:05 +00:00
Matthew Dillon
f3401d0c26 Handle case where no swap is configured 1999-02-06 06:31:57 +00:00
Bruce Evans
45908a6a19 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
Matthew Dillon
876c5c1135 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
Bruce Evans
9bcaf304c6 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
Bruce Evans
8bb84da720 Fixed unsorting of SRCS and MAN3 in previous commit.
Sorted MLINKS.
1999-01-23 07:55:15 +00:00
Bruce Evans
9457cf9c59 Fixed unsorting of cross references in previous commit. 1999-01-23 07:34:56 +00:00
Matthew Dillon
b8808468dd Oops, forgot this. Needed by libkvm. 1999-01-23 04:58:35 +00:00
Matthew Dillon
6a389e5182 Fix type-o's in manual 1999-01-22 11:03:55 +00:00
Matthew Dillon
a14dedd13c Add SWIF_DEV_PREFIX flag to add "/dev/..." to device name. 1999-01-22 10:57:03 +00:00
Matthew Dillon
e92324a21e Implement kvm_getswapinfo() libkvm function. Will be used by
pstat, top, and systat.
1999-01-22 10:36:04 +00:00
Bruce Evans
bc701368b4 <sys/types.h> isn't a prerequisite for <kvm.h>. 1998-12-16 19:12:14 +00:00
Bruce Evans
424a876474 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
Bruce Evans
b245b90a64 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
Bruce Evans
60160c5e50 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
Matthew Dillon
36058b68da Add required #include references to manual page 1998-12-13 02:32:59 +00:00
Dag-Erling Smørgrav
b2d3d0f097 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
Doug Rabson
4fab6203a9 Adjust the declarations of kvm_read and kvm_write to match reality a little
closer.
1998-09-16 09:30:14 +00:00
Warner Losh
e8420087b0 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 Takenori
d7feb25bdf Change ${MACHINE} into ${MACHINE_ARCH} to support MACHINE=pc98. 1998-09-09 11:27:33 +00:00
Doug Rabson
c2ac238c40 The length argument to sysctl is now size_t. 1998-08-25 07:52:33 +00:00
Gary Palmer
253ab58f6f Nuke unsupported architecture files 1998-08-22 14:34:59 +00:00
Doug Rabson
36fe61fe12 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
Poul-Henning Kamp
35e6b695d6 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
Bruce Evans
d7fb4b13b9 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
Bruce Evans
30a72f72d5 -I${DESTDIR}/sys -> -I${.CURDIR}/../../sys. 1997-08-26 14:13:02 +00:00
Tor Egge
4afb0d5a5b 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
Satoshi Asami
688034bb93 Add ${DESTDIR} in front of absolute path. 1997-07-18 06:32:39 +00:00
Tor Egge
a58930d8a9 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
Bruce Evans
a3315650db Fixed #include and/or prototype bugs in synopsis. 1997-04-19 15:57:20 +00:00
Bruce Evans
77667e9e45 Fixed #include and/or prototype bugs in synopsis. 1997-04-13 14:10:05 +00:00
Peter Wemm
7e546392b5 Revert $FreeBSD$ to $Id$ 1997-02-22 15:12:41 +00:00
Wolfram Schneider
75141cc987 Sort cross references. 1997-01-20 23:23:22 +00:00
Jordan K. Hubbard
1130b656e5 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
Mike Pritchard
7eb461278e 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
Andrey A. Chernov
d7b100f932 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 Wemm
2f85bf6e8e 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
Jordan K. Hubbard
51295a4d3e General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
1996-07-12 18:57:58 +00:00