Commit Graph

129 Commits

Author SHA1 Message Date
Peter Wemm
7d1192a784 On today's kernels masking with ~KERNBASE is turning out to be less
than useful.  It still hits at least 8 digits. Adjust for reality.

This is still not satisfactory for the alpha if you add "-O paddr".
2001-08-24 09:56:44 +00:00
Peter Wemm
fbb75ab833 Handle kvm_getprocs() returning nothing. Dont pass -1 to a size
for malloc().
2001-08-24 09:53:26 +00:00
Brian Somers
380434d488 Only capitalise the last `t' in ps's first argument when it's
actually part of an option argument.

Submitted by:	Chris Costello <chris@calldei.com>
MFC after:	6 weeks
2001-08-16 02:41:42 +00:00
Ruslan Ermilov
caa2db3be9 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 10:04:09 +00:00
Tor Egge
564efb8fec Check for the PS_SINTR flag in the right field of struct kinfo_proc
(ki_sflag).
2001-06-16 21:39:29 +00:00
Dima Dorfman
7fa34c1180 Correct a typo.
Submitted by:	Alexey V. Neyman <avn@any.ru>
2001-06-08 04:41:21 +00:00
Dima Dorfman
6b8212280b Mention the kern.ps_showallprocs sysctl.
PR:		24804
Submitted by:	Mike Meyer <mwm@mired.org>
2001-06-02 04:02:36 +00:00
Warner Losh
5782e27253 Use PATH_MAX rather than MAXPATHLEN. 2001-05-30 03:27:07 +00:00
Ruslan Ermilov
3ab9a9d0e0 Removed -I${.CURDIR}/.../sys from CFLAGS. 2001-05-18 13:41:42 +00:00
Mark Murray
25bba4f6ad Depollute headers now that the VM headers DTRT. 2001-05-03 11:49:44 +00:00
Mark Murray
325a83b456 Compensate for header dethreading. 2001-05-01 08:39:23 +00:00
Brian Somers
cdf6f0b1ae Correct some markup
Submitted by:	bde
2001-04-12 20:04:54 +00:00
Brian Somers
ff1b168b6e Introduce -osid and -otsid
Submitted by: dd
2001-04-11 22:42:54 +00:00
Brian Somers
48b2c871df Remove tsess for now.
This (and sess) may come back shortly.
2001-04-07 11:22:26 +00:00
Brian Somers
86aca2117b Update documentation in line with what the code does
PR:		25435
Submitted by:	dd
Forgotten by:	mckusick
2001-04-07 11:16:41 +00:00
Brian Somers
52f8369e69 The sess column went away last December with v1.26 of keyword.c
Remove it from ``jfmt''.

Forgotten by: mckusick
2001-04-07 02:53:35 +00:00
Andrey A. Chernov
f59105eedb Small optimization: set use_ampm only when needed 2001-03-03 01:46:58 +00:00
Andrey A. Chernov
080175194f Use AM/PM time only when available in locale 2001-03-02 23:53:36 +00:00
David E. O'Brien
3f83ed9d1c Fix style bug I introduced with rev 1.13 (rcsid after includes).
Along with CSRG id lossage in rev 1.11.

Submitted by:	bde
2001-02-28 11:06:04 +00:00
David E. O'Brien
f0ba626a0d Add rcsid. 2001-02-27 10:50:06 +00:00
Jonathan Lemon
f6213d478d Do not coredump if no options are supplied. (ps -o,)
Submitted by: rgrimes
Obtained from: NetBSD
2001-02-14 18:54:34 +00:00
Jake Burkholder
4c85452ba9 Catch up to new priority interface. 2001-02-12 00:21:38 +00:00
Andrey A. Chernov
8073a93c76 Use decimal point from locale 2001-02-11 02:25:56 +00:00
Ruslan Ermilov
d0353b836e mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
John Baldwin
e0aa5ab718 - Catch up to new proc flags. 2001-01-24 12:59:50 +00:00
Kirk McKusick
640b0e0895 Restore the rss (-u) keyword that got deleted in my somewhat over-zealous
cleanup effort.

Submitted by:	Mark Peek <mark@whistle.com>
2000-12-16 02:01:05 +00:00
Ruslan Ermilov
12e720d78b Prepare for mdoc(7)NG. 2000-12-15 17:37:31 +00:00
Kirk McKusick
1f7d250182 Change the proc information returned from the kernel so that it
no longer contains kernel specific data structures, but rather
only scalar values and structures that are already part of the
kernel/user interface, specifically rusage and rtprio. It no
longer contains proc, session, pcred, ucred, procsig, vmspace,
pstats, mtx, sigiolst, klist, callout, pasleep, or mdproc. If
any of these changed in size, ps, w, fstat, gcore, systat, and
top would all stop working. The new structure has over 200 bytes
of unassigned space for future values to be added, yet is nearly
100 bytes smaller per entry than the structure that it replaced.
2000-12-12 07:25:57 +00:00
John Baldwin
9b67ac593b Document the mtxname keyword.
Reviewed by:	sheldonh
2000-11-30 19:17:56 +00:00
John Baldwin
fd5f30bf38 Introduce a 'mtxname' keyword that displays the current mutex that a
process is blocked on or '-'.
2000-11-29 21:09:21 +00:00
Ruslan Ermilov
be8b149795 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 11:39:41 +00:00
Chris D. Faulhaber
2d45aed6bc Remove obsolete /dev/drum references
Reviewed by:	alex, asmodai, billf
2000-10-29 12:19:52 +00:00
Kris Kennaway
63743cbd8c No need to work around SCCS variable expansion any more. 2000-09-28 02:54:44 +00:00
Brian Somers
cf22dcfc33 Support multiple (comma separated) names as arguments to -U
PR: 11051
2000-09-26 01:03:16 +00:00
Jason Evans
0384fff8c5 Major update to the way synchronization is done in the kernel. Highlights
include:

* Mutual exclusion is used instead of spl*().  See mutex(9).  (Note: The
  alpha port is still in transition and currently uses both.)

* Per-CPU idle processes.

* Interrupts are run in their own separate kernel threads and can be
  preempted (i386 only).

Partially contributed by:	BSDi (BSD/OS)
Submissions by (at least):	cp, dfr, dillon, grog, jake, jhb, sheldonh
2000-09-07 01:33:02 +00:00
Will Andrews
f8c9c11c5c Fix the exit code for the case where nentries == 0; if a PID doesn't exist,
ps(1) should not be returning a success code (0), it should return an
error code (1).  This was fixed on OpenBSD over 3 years ago.

PR:		19069
Submitted by:	Jim Sloan <odinn@atlantabiker.net>
Reviewed by:	rwatson
2000-07-08 05:13:10 +00:00
Peter Wemm
821079e9be I'm probably jumping the gun, but what the heck, this is -current.
Turn off setgid-kmem for /bin/ps, it's now quite functional without it.
ps no longer needs /dev/*mem or /proc.  (It will still use some /proc
files if they are available for -e, but it's not required, so it'll
happily run in a jail or chroot).

The proc stats are now part of eproc (obtained via sysctl) and no longer
needs to beat up the u-page reading code and the problems with that.

This also has the side effect of disabling 'ps -e' for normal users
*EXCEPT* when looking at their own processes.  ie: they can see
environments in processes with their uid, enforced by the ownership of
/proc/*/mem.  Root can still see them all, as it can open all /proc/*/mem.
1999-11-17 13:37:30 +00:00
Peter Wemm
602a69d61e Use eproc.e_stats, not a series of crude hacks to fetch it from the u-area.
Also, fix some indentation that got messed up somehow..
1999-11-17 12:52:42 +00:00
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
Kris Kennaway
bdfebd8480 Typo (appropiate -> appropriate)
Obtained from:	OpenBSD (inspired by)
1999-11-15 03:37:57 +00:00
Peter Wemm
2a4562393f $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
Kris Kennaway
f58bcbc97e Correct reference to the obsolete vadvise() to madvise() (with appropriate
arguments)

PR:		11586
Submitted by:	David Gilbert <dgilbert@velocet.ca>
Reviewed by:	Doug Rabson
1999-06-30 11:50:09 +00:00
Kris Kennaway
46be34b902 Various spelling/formatting changes.
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
1999-05-08 10:22:15 +00:00
Poul-Henning Kamp
75c1354190 This Implements the mumbled about "Jail" feature.
This is a seriously beefed up chroot kind of thing.  The process
is jailed along the same lines as a chroot does it, but with
additional tough restrictions imposed on what the superuser can do.

For all I know, it is safe to hand over the root bit inside a
prison to the customer living in that prison, this is what
it was developed for in fact:  "real virtual servers".

Each prison has an ip number associated with it, which all IP
communications will be coerced to use and each prison has its own
hostname.

Needless to say, you need more RAM this way, but the advantage is
that each customer can run their own particular version of apache
and not stomp on the toes of their neighbors.

It generally does what one would expect, but setting up a jail
still takes a little knowledge.

A few notes:

   I have no scripts for setting up a jail, don't ask me for them.

   The IP number should be an alias on one of the interfaces.

   mount a /proc in each jail, it will make ps more useable.

   /proc/<pid>/status tells the hostname of the prison for
   jailed processes.

   Quotas are only sensible if you have a mountpoint per prison.

   There are no privisions for stopping resource-hogging.

   Some "#ifdef INET" and similar may be missing (send patches!)

If somebody wants to take it from here and develop it into
more of a "virtual machine" they should be most welcome!

Tools, comments, patches & documentation most welcome.

Have fun...

Sponsored by:   http://www.rndassociates.com/
Run for almost a year by:       http://www.servetheweb.com/
1999-04-28 11:38:52 +00:00
Peter Wemm
3d28e3ed4e Update p_flags doc. 1999-04-06 03:18:57 +00:00
Peter Wemm
4a40c5e7ee Look at p_lock instead of P_NOSWAP etc as an indicator of unswappability.
(While here, put a #ifndef pgtok around the macro that gets a redefinition
 warning)
1999-04-06 03:17:57 +00:00
Bill Paul
bb22740673 On FreeBSD/alpha, ps(1) does not correctly report process start times
and CPU runtime because it can't access the user area via /proc/<pid>/mem.
This is because the uarea is not mapped into the process address space
at USRSTACK on the alpha like it is on the x86.

Since I'm haven't been able to wrap my brain around the VM system enough
to be able to figure out how to achieve this mapping, and since it's
questionable that such an architectural change is correct, I implemented
a workaround to allow ps(1) to read the uarea from /dev/kmem using
kvm_read() instead of from the process address space via kvm_uread().
The kludge is hidden inside #ifdef __alpha__/#endif so as not to impact
the x86. (Note that top(1) probably uses this same gimmick since it works
on FreeBSD/alpha.)

Reviewed by: dfr
1999-04-01 14:45:18 +00:00
Julian Elischer
88c5ea4574 Enable Linux threads support by default.
This takes the conditionals out of the code that has been tested by
various people for a while.
ps and friends (libkvm) will need a recompile as some proc structure
changes are made.

Submitted by:	"Richard Seaman, Jr." <dick@tar.com>
1999-01-26 02:38:12 +00:00
Julian Elischer
d8c85307b2 Re-enable the options in ps(1) that were disabled with the Linux
threads support.

Submitted by:	"Richard Seaman, Jr." <dick@tar.com>
1999-01-13 03:11:43 +00:00
Julian Elischer
6626c6045c Reviewed by: Luoqi Chen, Jordan Hubbard
Submitted by:	 "Richard Seaman, Jr." <lists@tar.com>
Obtained from:	linux :-)

Code to allow Linux Threads to run under FreeBSD.

By default not enabled
This code is dependent on the conditional
COMPAT_LINUX_THREADS (suggested by Garret)
This is not yet a 'real' option but will be within some number of hours.
1998-12-19 02:55:34 +00:00