Commit Graph

376 Commits

Author SHA1 Message Date
Will Andrews
5e9ccc8797 Add the ability to display the default FIB number for a process to the
ps(1) utility, e.g. "ps -O fib".

bin/ps/keyword.c:
	Add the "fib" keyword and default its column name to "FIB".

bin/ps/ps.1:
	Add "fib" as a supported keyword.

sys/compat/freebsd32/freebsd32.h:
sys/kern/kern_proc.c:
sys/sys/user.h:
	Add the default fib number for a process (p->p_fibnum)
	to the user land accessible process data of struct kinfo_proc.

Submitted by:	Oliver Fromme <olli@fromme.com>, gibbs
2013-08-26 23:48:21 +00:00
Joel Dahl
e9e3a1ab1f Add a few examples.
Obtained from:	OpenBSD
2013-03-15 20:12:54 +00:00
Konstantin Belousov
45732078c1 Document P_PPTRACE.
MFC after:	2 weeks
2013-02-07 15:37:51 +00:00
John Baldwin
9f0b6e5e27 - Move 'showthreads' check out of fmt.c.
- Update shadow copy of fmt_argv() prototype in w.c and fix calls for
  additional parameter.
2013-01-19 00:21:55 +00:00
John Baldwin
1c67ef129f Include the thread name along with the command name when displaying the
command name of a thread from a multi-threaded process that doesn't have
an available argument list (such as kernel processes) and threads display
is enabled via -H.

Reviewed by:	alfred, delphij, eric@vangyzen.net
MFC after:	1 week
2013-01-18 18:24:40 +00:00
Pawel Jakub Dawidek
64b0bf0bb6 Use kern.max_pid sysctl to obtain maximum PID number instead of using local
define.

Reviewed by:	jhb
2012-12-12 15:45:03 +00:00
Andrey Zonov
08c62f8deb - Bump date.
Submitted by:	pluknet
Approved by:	kib (mentor)
X-MFC-With:	r240645
2012-09-18 13:24:14 +00:00
Andrey Zonov
38f2be1c54 - Add 'dsiz' and 'ssiz' keywords to show data and stack size respectively.
Approved by:	kib (mentor)
MFC after:	1 week
2012-09-18 12:25:14 +00:00
Ed Maste
4285666880 Avoid passing uninitialized stack to addelem() if called with an empty arg.
PR:		bin/171174
2012-08-29 21:38:34 +00:00
Jilles Tjoelker
2aff415a8c ps: Fix memory leak when showing start/lstart for swapped-out process.
Spotted by:	scan-build (uqs)
2012-07-15 15:22:13 +00:00
Konstantin Belousov
4f1e1f86a1 Add 'cow' keyword to show per-process cow count.
Submitted by:	Andrey Zonov <andrey zonov org>
MFC after:	1 week
2012-05-23 18:11:36 +00:00
Joel Dahl
288eac5aed mandoc complains loudly when <TAB>s are misused in columnated lists. Fix
this syntax violation and while I'm here also convert <TAB> to Ta and adjust
quotation marks in order to prevent this problem in the future.
2012-03-29 16:02:40 +00:00
Konstantin Belousov
28c84226e8 Document P_ORPHAN.
MFC after:	3 days
2012-03-08 13:00:49 +00:00
Ed Schouten
6aed20fe1a Remove unused variables.
Simply annotate the function parameters with __unused, instead of adding
the ve-variables. This makes the code build with GCC 4.7 and -Werror.
2012-01-17 22:17:10 +00:00
Ulrich Spörlein
38494eff98 Spelling fixes for bin/ 2012-01-07 16:10:23 +00:00
Mikolaj Golub
6edf5accb6 Remove yet another outdated note about procfs(5) being required.
Spotted by:	arundel
2011-11-22 21:53:06 +00:00
Mikolaj Golub
57c87bfabb No need in procfs(5).
MFC after:	2 weeks
2011-11-22 21:14:46 +00:00
Edward Tomasz Napierala
aa7a15b6bb For processes with no controlling terminal, display "-" in the TTY column
instead of "?".

Submitted by:	arundel
2011-10-30 15:21:27 +00:00
Glen Barber
6ec3cd078c Correct a typo that was introduced in 225912
Submitted by:		Valentin Nechayev (netch % netch!kiev!ua), arundel
MFC after:		1 week
With-MFC:		225908
2011-10-02 16:05:19 +00:00
Glen Barber
2d455a01bd Tweaks to ps(1):
- there's no reason the semantics of the -x flag are being explained in
  the -a flag description
- be more precise regarding the relation between the -a flag and the
  security.bsd.see_other_uids sysctl
- describe the format of the -t flag's argument
- 'con' no longer is a possible entry in the 'TT' column
- explain that the 'TT' column refers to pseudo-terminals via mere numbers
- add a hint in the 'tt' keyword description that a keyword 'tty' exists,
  which will give the full terminal pathname

Submitted by:		arundel (via docs@) (original)
MFC after:		1 week
With-MFC:		225908
2011-10-01 23:47:37 +00:00
Glen Barber
6401543842 Reorder default ps(1) output according to reality.
Submitted by:	arundel (via docs@)
MFC after:	1 week
2011-10-01 20:56:58 +00:00
Edward Tomasz Napierala
1d1143ec27 Make ps(1) automatically size its column widths. 2011-09-29 06:31:42 +00:00
Ed Schouten
9f365aa1d6 Get rid of major/minor number distinction.
As of FreeBSD 6, devices can only be opened through devfs. These device
nodes don't have major and minor numbers anymore. The st_rdev field in
struct stat is simply based a copy of st_ino.

Simply display device numbers as hexadecimal, using "%#jx". This is
allowed by POSIX, since it explicitly states things like the following
(example taken from ls(1)):

	"If the file is a character special or block special file, the
	size of the file may be replaced with implementation-defined
	information associated with the device in question."

This makes the output of these commands more compact. For example, ls(1)
now uses approximately four columns less. While there, simplify the
column length calculation from ls(1) by calling snprintf() with a NULL
buffer.

Don't be afraid; if needed one can still obtain individual major/minor
numbers using stat(1).
2011-09-28 18:53:36 +00:00
Bjoern A. Zeeb
925af54487 Rename ki_ocomm to ki_tdname and OCOMMLEN to TDNAMLEN.
Provide backward compatibility defines under BURN_BRIDGES.

Suggested by:	jhb
Reviewed by:	emaste
Sponsored by:	Sandvine Incorporated
Approved by:	re (kib)
2011-07-18 20:06:15 +00:00
Sergey Kandaurov
b758bdf8b3 Bump date after the previous commit. 2011-07-01 10:57:10 +00:00
Sergey Kandaurov
b3178949ee Update and sort the list of the available keywords. 2011-07-01 10:54:47 +00:00
Edward Tomasz Napierala
9acd91270f Add "gid" and "group" keywords to display the effective group ID
and effective group name.  Also, add "egid", "egroup" and "euid" aliases.

PR:		bin/146331
Submitted by:	Jeremie Le Hen <jeremie at le-hen dot org>
2011-06-14 16:50:16 +00:00
Ulrich Spörlein
bf2fe08eea Fix some typos under bin/
Found by:	codespell
2011-05-22 14:03:46 +00:00
Sergey Kandaurov
9abcf93a91 Spelling in P_HADTHREADS.
MFC after:	1 week
2011-05-20 14:32:28 +00:00
Sergey Kandaurov
0d69482994 Fix the description of the "paddr" keyword. It shows a process
pointer just like a dublicating "uprocp".

MFC after:	1 week
2011-05-20 14:07:08 +00:00
Edward Tomasz Napierala
b9ff20ab7e Document problems with -d/-w and the fact that -X is the default.
Suggested by:	arundel@
Reviewed by:	arundel@
2011-04-18 19:20:47 +00:00
Edward Tomasz Napierala
649fde88ff Get rid of DSIZ; instead just call the sizing function if provided. 2011-04-12 20:10:15 +00:00
Edward Tomasz Napierala
f9db2550b2 Add proper width calculation for time fields (time, cputime and usertime).
This fixes the ugly overflow in "ps aux" output for "[idle]".
2011-03-24 20:15:42 +00:00
Edward Tomasz Napierala
3bf92decd3 Make "LOGIN" and "CLASS" columns width scale properly instead of wasting space. 2011-03-24 17:20:24 +00:00
Konstantin Belousov
a870bf2c31 Implement the usertime and systime keywords for ps, printing the
corresponding times reported by getrusage().

Submitted by:	Dan Nelson <dnelson allantgroup com>
MFC after:	1 week
2011-03-17 11:25:32 +00:00
Edward Tomasz Napierala
7123f4cd6f Export login class information via kinfo and make it possible to view
it using "ps -o class".
2011-03-05 14:41:49 +00:00
Konstantin Belousov
f5f3977b8d Document P_FOLLOWFORK.
MFC after:	2 weeks
2011-01-25 11:04:16 +00:00
Konstantin Belousov
50a57dfbec Move repeated MAXSLP definition from machine/vmparam.h to sys/vmmeter.h.
Update the outdated comments describing MAXSLP and the process
selection algorithm for swap out.

Comments wording and reviewed by:	alc
2011-01-09 12:50:44 +00:00
Ed Maste
6239ef1d29 Make a thread's address available via the kern proc sysctl, just like the
process address.

Add "tdaddr" keyword to ps(1) to display this thread address.

Distilled from Sandvine's patch set by Mark Johnston.
2010-10-08 00:44:53 +00:00
Ed Maste
ce026da7e5 Correct sort order. 2010-09-22 19:26:41 +00:00
Edward Tomasz Napierala
ab8d4d579f Fix alignment for the 'flags' label, and make more room for 'tdev'.
MFC after:	1 month
2010-07-24 15:37:36 +00:00
Edward Tomasz Napierala
9cde081d0a Add P_HASTHREADS flag description. 2010-07-24 15:24:12 +00:00
Konstantin Belousov
9b0b529248 Update the list of the process flags for P_WKILLED.
MFC after:	4 weeks
2010-04-13 08:54:53 +00:00
Juli Mallett
41ded75de8 o) Add a keyword to displaying elapsed time in integer seconds, "etimes".
o) Give slightly better (i.e. any) documentation of the format of "etime".

Reviewed by:	jilles
2010-03-17 22:57:58 +00:00
Konstantin Belousov
7117b3d5aa Update the list of the process flags. Note that the lists of pending
signals for process and its threads are distinct.

Reviewed by:	jilles
MFC after:	2 weeks
2010-03-05 13:13:35 +00:00
Rebecca Cran
c08dcaf147 Initialize the execfile argument to NULL instead of _PATH_DEVNULL. This allows the -M option to be used without specifying -N.
PR:	bin/138146
Approved by:	rrs (mentor)
MFC after:	3 days
2010-02-08 21:23:48 +00:00
Alexander Leidinger
5b412ffb6b Fix small resource leak (memory).
Reviewed by:	gad
MFC after:	1 week
2009-11-17 07:29:35 +00:00
Xin LI
1575bd0a6d Increase width for %CPU, RSS and VSZ columns for now. Modern systems
tend to have larger memory, larger process, and more CPU.
2009-11-03 09:28:45 +00:00
Brian Somers
aa14b5ab89 Add the -d switch to the usage message.
Submitted by:	Emil Mikulic - emil at dmr dot ath dot cx
Approved by:	re (kib)
MFC after:	1 week
2009-07-23 10:20:12 +00:00
Edward Tomasz Napierala
e50022797f Add manual page links to advertise procstat(1) a little better.
Approved by:	re (kib)
2009-07-09 16:40:00 +00:00