Commit Graph

287 Commits

Author SHA1 Message Date
ad 401499f30e Sync with kernel changes introduced by merging the newlock2 branch. 2007-02-09 22:08:48 +00:00
christos d0a868f481 Add support for printing the emulation of the process. 2006-10-29 22:32:53 +00:00
christos 3fccf7e09e c99 initializers 2006-10-16 00:31:47 +00:00
wiz 9dedcd8f8b Remove trailing whitespace.
Remove a partially duplicated sentence.
2006-10-09 21:31:29 +00:00
apb e7fd82468c Make it clear that multiple sort keys may be specified.
Closes PR 34271.
2006-10-07 10:22:21 +00:00
wiz 103401b052 Avoid .No if easily possible. 2006-10-03 02:15:16 +00:00
apb 9ff8e2d57f Add some markup missed in previous. 2006-10-02 20:54:27 +00:00
apb 7c5fcf623a Set the width in the correct data structure. (Fix error in previous.) 2006-10-02 18:43:13 +00:00
apb b9f435a549 Document changes to -o and -O options, and improve markup. 2006-10-02 17:57:01 +00:00
apb d9463bc15b * When all columns are given null customised headers, the blank header
line is not printed at all.  This is specified in P1003.1-2004
  (SUSv3), and is useful.

* Customised headers may contain embedded space, commas and equals
  signs.  To specify multiple customised headers, use multiple -o or -O
  options.  This is specified (for "-o", not for "-O") in P1003.1-2004
  (SUSv3), and is useful.

* When a column is given a null (blank) customised header, it keeps its
  default minimum width.  This is specified in P1003.1-2004 (SUSv3), and
  seems harmless.

* Fix a bug that made it impossible to print the same keyword multiple
  times, with different customised headers each time.  (Previously, the
  last customised header was used for all instances of the keyword.)

* Make the behaviour of "-O" more useful.  The first -O option adds
  the default keywords only if there have not yet been any formatting
  options, and multiple -O options now insert their keywords in adjacent
  positions.  Now {ps -j -O %cpu} is like {ps -j} with one extra column;
  Previously, it would have had all the columns implied by "-j", plus
  all the default columns, plus the extra column specified by "-O".

* Convert from home-grown linked lists to SIMPLEQ lists.

Discussed in tech-userlevel.
2006-10-02 17:54:35 +00:00
christos 10ed3a58a9 factor out the code that does numeric parsing into a function and check for
errors properly.
2006-09-02 20:00:09 +00:00
christos eb903308f2 Coverity CID 1559: Fix memory leak. 2006-03-18 05:33:31 +00:00
chs 83fd12c4fb add "uaddr" and improve text for "laddr". 2005-11-11 17:06:22 +00:00
chs 58c15fb5d1 add a keyword for the uarea address. very useful with crashdumps. 2005-11-05 19:27:24 +00:00
christos 10a02919cc Add some more const so that this compiles again. 2005-06-27 00:46:04 +00:00
christos 6310b59691 sprinkle a little const, and now everything compiles with WARNS=3 2005-06-26 19:10:48 +00:00
he 1d55d88929 Appease -Wuninitialized by initializing val and uval to 0.
Marked with XXXGCC for hpcarm (found while building for it).

Reviewed (in a slightly different form) by lukem.
2005-06-07 08:53:13 +00:00
lukem cfdf050ef3 appease gcc -Wuninitialized 2005-06-01 15:30:33 +00:00
christos 4dd264a6c5 allow -t ttyp0 -t p0 -t /dev/ttyp0 -t /dev/pts/0 2005-02-11 18:26:18 +00:00
skrll c3dc5c50d9 Add the missing suspended state 'U'.
Bump date.
2004-12-29 08:48:09 +00:00
atatat fde0dde8b2 Make ps understand "-tpts/4" by assuming that ptyfs is mounted on
/dev/pts and that the '/' immediately preceding the digits does not
need a 'p' in front of it (ick, kludge_oldps_options()).
2004-11-29 04:44:10 +00:00
christos 3e870b856b print TTY instead of TT, one question mark instead of two and always the
full tty name.
2004-11-16 04:58:14 +00:00
dsl 238960af7e Add (unsigned char) cast to ctype function 2004-10-29 19:51:36 +00:00
wiz 86831d25f5 Bump date for laddr. 2004-08-23 17:36:19 +00:00
nathanw 3d720e58fb Add a "laddr" keyword, analagous to "paddr". Useful for finding
struct pcb's.
2004-08-23 16:31:10 +00:00
dsl 7855867cc4 Use HW_PHYSMEM64 to avoid problem with > 2GB memory (and >4GB as well)
Fixes PR/23717 and PR/24092
2004-08-22 18:55:44 +00:00
simonb 73cc67cb1d For the "lid" keyword, change ULONG to INT32 since it's a 32bit type.
From Nicolas Joly in PR bin/26452.
2004-07-28 07:48:22 +00:00
simonb 9bc855a931 s/the the/the/ (only in sources that aren't regularly imported from
elsewhere).
2004-04-23 02:58:27 +00:00
simonb d8f2ef9ae4 Gah, fix uninitialised variable with the "etime" change. _Never_ be
happy with something and then edit a single line before committing
without retesting...
2004-03-27 14:55:24 +00:00
simonb 891960dba2 Add support for the POSIX.2 "args" and "comm" keywords. "args" is just
an alias for "command", and "comm" shows just argv[0] and not the whole
argument list.

Fix for part of PR standards/11224.
2004-03-27 14:52:36 +00:00
simonb 63e11689ca Add support for the POSIX.2 "etime" keyword - shows the elapsed time
since the process was started.  Fix a couple of style nits as well.

Fix for part of PR standards/11224.
2004-03-27 14:49:13 +00:00
simonb a6b219ed94 #define<TAB> 2004-03-27 14:09:10 +00:00
simonb c2c9310515 Use some constants from <tzfile.h>. 2004-03-27 12:59:25 +00:00
simonb abb3201747 Wrap some long lines.
Consisently use (void) in front of printf(...);
A few more white-space nits.
2004-03-27 12:44:08 +00:00
simonb f43fbf8e69 Fix grammar in a comment. 2004-03-27 12:11:55 +00:00
simonb 53474900d5 KNF, ANSFify, de-__P, unC++ify, white space nits. 2004-03-27 12:09:28 +00:00
simonb 56be4f0202 Change the header for the "tty" keyword "TT" instead of "TTY".
Fixed POSIX.2 conformance problem mentioned in standards/11225 from
Ben Harris.
2004-03-27 11:48:31 +00:00
jrf 7800470e15 donlist_sysctl() was overwriting maxslp with vm.uspace. Changed
it to use uspace. See PR bin/23713, approved by christos@netbsd.org.
Thanks to joff@stchome.com for the submission.
2004-02-25 19:56:28 +00:00
wiz 85746c6759 Spell interrupt with two rs. From Peter Postma. 2004-02-24 15:16:04 +00:00
wiz 5fe648aa7a Uppercase CPU where appropriate. 2004-02-13 09:55:24 +00:00
jdolecek 2cc036866c g/c SDEAD 2004-01-11 18:55:33 +00:00
mjl 550c4966cd Correct typo in page header for tpgid. 2003-12-16 14:26:46 +00:00
wiz 6c7baec4af Add Xr for dev_mkdb(8), per PR 23168. Increase width in FILES section while here. 2003-10-16 10:00:54 +00:00
agc b5b2954259 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22249, verified by myself.
2003-08-07 09:05:01 +00:00
wiz dba2557a54 More mdoc. 2003-04-16 09:19:35 +00:00
wiz 2df55409df Update date for recent changes. 2003-03-17 08:15:07 +00:00
dsl b44ef110a7 Support -ktt and -ktty, quote "tdev" in comment so table can be sorted. 2003-03-08 08:04:24 +00:00
christos 5998d3b278 XXX: cast tdev to INT32 instead of UINT32 so that that sorting works as
before [NODEV entries come first]
2003-03-08 06:46:22 +00:00
dsl f24cb25605 - add keywords for utime, stime and ctime (output sss.ssssss if small)
- fiddle with keyword table - mainly to keep width under 80 cols
- add -k keylist so sort output
- don't use logs to work out field width, get -MAXINT right
- user defined headers can be 1 char (actually they can be zero length)
  so ?? in tty column isn't guaranteed to be wider than header
- remove some long long casts (compiles on sparc64 still)
- use kvm_openfiles(NULL, NULL, NULL, KVN_NO_FILES, ..) unless core file
  specified,
(approved by christos)
2003-03-06 09:04:21 +00:00
dsl 036e265716 - add keywords for utime, stime and ctime (output sss.ssssss if small)
- fiddle with keyword table - mainly to keep width under 80 cols)
- add -k keylist so sort output
- don't use logs to work out field width, get -MAXINT right
- user defined headers can be 1 char (actually they can be zero length)
  so ?? in tty column isn't guaranteed to be wider than header
- use PRId64 to remove some long long casts
- use kvm_openfiles(NULL, NULL, NULL, KVN_NO_FILES, ..) unless core file
  specified
(approved by christos)
2003-03-06 09:02:16 +00:00
dsl a124f92ed5 Seems better to display p_sv{u,g}id when asked for it... 2003-03-03 23:13:21 +00:00
atatat 40f3045957 Add p_svuid and p_svgid to kinfo_proc2. Populate them in the kernel
and in libkvm.  Then teach ps how to show them to you.

Also, teach ps how to show the names for all the uids, the rest of the
group numbers, and the "group access list".
2003-03-01 05:41:55 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
thorpej 3fdac2b8c5 Merge the nathanw_sa branch. 2003-01-18 10:52:16 +00:00
wiz 7e681f7063 interrupt with two rs. 2003-01-06 13:04:54 +00:00
itojun 68603e5242 correct use of format string (signedness, %ldd). PR 18679 2002-10-17 23:50:17 +00:00
wiz f3e4defc56 Use more mdoc. 2002-10-01 15:11:08 +00:00
wiz 14dfaa4b03 New policy: New sentences start on a new line.
Patches by Robert Elz <kre at munnari oz au>, with minimal changes by me.
2002-09-25 15:18:36 +00:00
jdolecek fc257046b9 g/c procfs fallback code, it's redundant now that we use sysctl to get
process info
2002-06-19 08:11:55 +00:00
wiz c8c3c3fd5f Sort SEE ALSO. 2002-06-17 16:55:05 +00:00
christos d09016d45a Document some missing flags and add systrace(1) 'x' flag. 2002-06-17 16:48:44 +00:00
nathanw 43634bc5ba Since kinfo_proc2 has many values that are 64-bit, ps needs to know
that they're 64-bit, and grab them out of memory appropriately. Otherwise,
big-endian systems get the wrong end of the 64-bit value and lose.

Keywords affected: inblk, majflt, minflt, msgrcv, msgsnd, nivcsw, nsigs,
nswap, nvcsw, and oublk.
2002-04-24 21:41:22 +00:00
wiz 66a3e61375 "a, b, c, and d", not "a, b, c and d". 2002-04-24 08:58:33 +00:00
wiz 1932d50001 Drop trailing space. 2002-03-04 13:19:33 +00:00
ad 5a6b9d89df Xref pkill/pgrep. 2002-03-04 13:02:32 +00:00
martin f95cd5a968 Use int32_t for temporary variables (instead of long), that is the same
type as we get the data passed from the kernel. This avoids (missing)
sign extension bugs on LP64 systems and partly takes care of PR 15677.

We now print this values as negative seconds - still wrong, but that
probably is due to the simple way this values are acumulated in the
scheduler, causing negative times when ntpd steps time backwards.
2002-02-21 19:31:03 +00:00
enami b127ec2616 Just use return value of strvis instead of calling strlen. 2002-02-14 06:57:19 +00:00
enami 4c30ea4ac5 Don't define variable as static unnecessarily. 2002-02-14 06:54:41 +00:00
ross dc5571b22e Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:21:55 +00:00
jdolecek ef1ec2419d started(): don't assume that the field width is correct and recompute
it as needed

This fixes bogus output for cases like `ps -ao start=xx`, as reported by
Martin Macok of Undeground.cz on current-users@netbsd.org.
2002-01-21 23:01:55 +00:00
soren dc53bf3cba Sync getopt() / man page with actual getopt options. 2001-12-20 20:10:33 +00:00
wiz 8ee888f96f Properly quote punctuation. 2001-12-20 20:06:15 +00:00
wiz 3ebcdc5e43 Whitespace nits. 2001-12-20 19:31:48 +00:00
lukem b8a6769184 fix minor WARNS=2 2001-11-03 13:21:09 +00:00
lukem 725b21190a fix comment: "[]" are [square] brackets, "<>" are angle brackets 2001-08-24 06:37:03 +00:00
enami 48661b973f Print commands within angled brackets only if they are system processes.
Print other commands, like cc, cpp and as, within parentheres.
2001-08-24 01:48:22 +00:00
wiz 1e378c4c12 precede, not preceed. 2001-08-20 12:00:46 +00:00
christos c91b59d1de Print system processes/kernel threads as [kprocname] as top(1) does. 2001-08-07 14:46:09 +00:00
wiz 8c6310c4a3 Remove duplicate `if'. Noted by Geoff C. Wing in bin/13551. 2001-07-30 16:22:49 +00:00
matt c6458f33d8 Add a small optimizetion in savevars(). break out of the loop once needcomm
is set since setting it multiple times only wastes cpu time.
2001-07-20 21:59:58 +00:00
matt 68b3b7e9c7 Retrieve maxslp & uspace from kernel instead of using defines. Needed for
shared arm code.
2001-07-14 06:53:43 +00:00
sommerfeld d19e89a7c0 correct the description of paddr 2001-07-04 20:49:00 +00:00
cyber 428f40d685 If there were no processes to list, it meant that our criteria failed
and didnt match anything.  Dont make our caller think we succeeded.
2001-06-14 19:04:49 +00:00
enami 4aa8283eb7 Always initialize an auto variable. 2001-03-23 01:06:02 +00:00
itojun 58a9573963 do not update maxlen if realloc fails. 2001-03-20 19:05:11 +00:00
christos a396a72f84 clarify things a bit more (from hubertf) 2001-01-15 21:02:58 +00:00
christos 3141a5cc48 Really explain what parenthesized names mean and why we parenthesize names! 2001-01-15 17:57:14 +00:00
hubertf 9bb3e62b11 Document the meaning of commands shown in parantheses.
Patches submitted by Jeremy C. Reed <reed@reedmedia.net> in PR 11930.
2001-01-15 16:16:51 +00:00
itojun bc8fe00e2e KPTR/KPTR24 are using u_int64_t. commented by minoura 2001-01-09 01:21:59 +00:00
itojun adf3a0eef5 redo previous (simplify KPTR) 2001-01-08 18:03:45 +00:00
itojun 3410e7bd02 backout previous; did not compile on non-alpha 2001-01-08 17:55:28 +00:00
itojun a3c77f0437 simplify KPTR processing. 2001-01-08 17:18:24 +00:00
itojun f320afb26b address PR 11653. checked on alpha.
XXX supports 32bit and 64bit pointers only
2001-01-08 13:20:29 +00:00
simonb 0a7d3a1ff5 Add a K flag to the state information - K is for kernel thread or system
process (ie, P_SYSTEM set in p_flag).  The L flag (locked in core) is
only used for non-P_SYSTEM processes.
2000-10-23 05:54:06 +00:00
nathanw 904bfc5822 Update description of process flag 0x20000 to match reality:
P_NOCLDWAIT, not P_SSTEP.
2000-08-28 13:06:42 +00:00
mrg 8d4795719a remove include of <vm/vm.h> 2000-06-29 06:26:33 +00:00
simonb eb32670668 Remove the 'poip' (pageouts in progress) keyword from the manpage.
From PR bin/8843 by Brian Stark.
2000-06-24 07:43:22 +00:00
simonb 643cb3c341 Don't check namelist when choosing to use the sysctl interface. 2000-06-16 03:51:00 +00:00
simonb d530ee00d1 Fix handling of "ps U<user>" where <user> ended it 't' - now if the
first argument doesn't start with a '-' and ends in 't', the 't' only
gets converted to a 'T' (for listing processes on the current tty)
if it doesn't contain any other command line option characters that
take an argument.  Problem noticed by ITOH Yasufumi on tech-userlevel.

If the 'start' format was the last column, the width wouldn't be set
and started() output a zero length string instead of a string the right
length - fix header width calculations so the the last column is handled
the same all others.  This only showed up for 'start' because started()
knew that the column header is the same width and the field itself...

Update copyrights.
2000-06-08 13:30:39 +00:00
simonb 292b668867 Fix back-to-front assignment in tname() which meant that the column
width would never autosize past the header ("TT") width.  Problem
noticed by Geoff Wing.
2000-06-08 00:51:10 +00:00