History log of /freebsd-current/bin/ps/ps.1
Revision Date Author Comments
# 1a720cbe 15-May-2024 Alexander Ziaee <concussious@runbox.com>

man filesystems: fix xrefs after move to section 4

Reviewed by: des, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077


# 90aea514 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# ba44650a 11-Nov-2023 Benedict Reuschling <bcr@FreeBSD.org>

ps.1: update regarding -D option and -p x/d interaction

The -p option does not imply -x, it is merely a different mode that ps
uses. Remove that statement from the -p option, effectively rolling back
d6ae056e9dc96c2db45982ac358ba9ed716a9202.

pstef@ introduced the -D option in 5c0a1c15ff8cb66128f4826ace8ba91e0a31486d
which also turns ps into a similar mode. List the -D option along with
the others in the first sentence of the second paragraph of the
DESCRIPTION section for completeness and correctness sake.

Pointed out by: pstef@
Differential Revision: https://reviews.freebsd.org/D42552


# d6ae056e 06-Oct-2023 Benedict Reuschling <bcr@FreeBSD.org>

Extend description of -p to include interactions with -d and implying -x

PR: 268052
Event: Oslo Hackathon
Differential Revision: https://reviews.freebsd.org/D40595


# 5c0a1c15 24-Aug-2023 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

ps: add a new option -D to reimplement tree traversal

It takes a non-optional parameter string, one of "up", "down", or "both"
that can request tree traversal in the chosen directions. This adds PIDs
from the paths to the selection of PIDs and can be used together with -d
to draw a subset of the process tree.

Differential Revision: https://reviews.freebsd.org/D41231


# b2c76c41 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line nroff pattern

Remove /^\.\\"\s*\$FreeBSD\$$\n/


# 3f46bf40 25-Apr-2023 Mateusz Piotrowski <0mp@FreeBSD.org>

ps: Fix synopsis

In the -L mode, the -L flag is not optional.

MFC after: 3 days
Sponsored by: Klara Inc.


# 4f47f511 27-Jun-2020 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

ps(1): reuse keyword "cpu" to show CPU number

This flag will now show the processor number on which a process is running.

This change was inspired by PR129965. Initially I didn't think that the
patch attached to it was correct -- it sacrificed ki_estcpu use in "cpu"
for ki_lastcpu and I thought that the old functionality should be kept and
the new (cpu#) one added to it. But I've since discovered that ki_estcpu is
sched_4bsd-specific. What's worse, it represents the same thing as
ki_pctcpu, except ki_pctcpu is universal -- so "%cpu" has been using it
successfully. Therefore, I've decided to replace information based on
ki_estcpu with information based on ki_oncpu/ki_lastcpu.

Key parts of the code and manual changes were borrowed from top(1).

PR: 129965
Reported by: Nikola Knežević
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25377


# 50301bb0 19-Jun-2020 Lorenzo Salvadore <salvadore@FreeBSD.org>

bin/ps: Make the rtprio option actually show realtime priorities

Fix the rtprio option that for some reason was progessively becoming an
option showing the priority class of threads. In particular:

- use the constants defined in sys/sys/rtprio.h instead of those defined in
sys/sys/priority.h: this helps making clearer that the code actually is
about realtime priorities and not standard scheduler priorities;
- remove the PRI_ITHD case that has nothing to do with realtime priorities;
- convert the priority levels to realtime priority levels using the same
formulas used for pri_to_rtp function in sys/kern/kern_resource.c.
- remove outdated note "101 = not a realtime process" in the man page and
replace it with a more useful reference to man 1 rtprio.

Approved by: src (mckusick), manpages (bcr), gerald (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25266


# f11e51a9 31-Oct-2018 Mateusz Piotrowski <0mp@FreeBSD.org>

ps(1): Pet mandoc and igor

- Use Xr to reference other manual pages.
- Reference execve(2) instead of exec(2) as exec(2) does not exist.
- Remove the deprecated "Tn" macro.
- Improve the formatting of the etime description.

Reviewed by: bcr
Approved by: krion (mentor, implicit), mat (mentor, implicit)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17780


# c97c08de 31-Oct-2018 Mateusz Piotrowski <0mp@FreeBSD.org>

ps(1): Add a standard exit status section

Reviewed by: bcr, eadler
Approved by: krion (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17146


# 2f5a9b76 13-Mar-2018 John Baldwin <jhb@FreeBSD.org>

Add a "jail" keyword to list the name of a jail rather than its ID.

Inspired by: mwlucas
Reviewed by: jamie
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14683


# 30417f2c 09-Mar-2018 Mike Karels <karels@FreeBSD.org>

Change ps(1) output width to unlimited if not interactive

Apply patch submitted with PR 217159 to make ps use unlimited
width when not associated with a terminal (i.e., none of stdout, stdin,
or stderr is a tty). Update comments and man page correspondingly.
This change was requested to work around lack of -ww in scripts from
third-party packages, including Hadoop, and adds a small measure of
Linux compatibility. Hopefully few if any non-interactive scripts
depend on the old default of 79.

PR: 217159
Submitted by: n.deepak at gmail.com
Reviewed by: vangyzen jhb
Differential Revision: https://reviews.freebsd.org/D14614


# faf5dd87 23-Jan-2018 John Baldwin <jhb@FreeBSD.org>

Remove some KSE references from ps(1).

- Simplify the description of -H to assume 1:1 threading.
- Drop 'process' from description of 'lwp' field and the corresponding
XO field name.
- Do add an expansion of LWP in the description of 'lwp' and 'nlwps'.
- Add 'tid' as an alias for the 'lwp' field.

Reviewed by: imp, kib (older version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14021


# 53606209 01-Dec-2017 Edward Tomasz Napierala <trasz@FreeBSD.org>

Add "vmaddr" ps(1) keyword.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL


# 4363782b 09-Oct-2017 Edward Tomasz Napierala <trasz@FreeBSD.org>

Undocument "tdnam" (leaving it as an alias), and rename the column
to TDNAME.

Suggested by: bde
MFC after: 2 weeks
Sponsored by: DARPA, AFRL


# a8373a7c 09-Oct-2017 Edward Tomasz Napierala <trasz@FreeBSD.org>

Document "tdnam" keyword to ps(1), and add "tdname" alias.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL


# cde94a42 07-Sep-2017 Edward Tomasz Napierala <trasz@FreeBSD.org>

Hint that the "-o emul" option for ps(1) shows the ABI.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL


# 6f47d67b 06-Sep-2017 Edward Tomasz Napierala <trasz@FreeBSD.org>

Make ps(1) flag processes in capsicum(4) capability mode with "C".

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL


# 4162d139 22-Jul-2017 Edward Tomasz Napierala <trasz@FreeBSD.org>

Use the "tree" word in ps(1) -d option description, to make it easier
to find.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# 563e7037 12-Aug-2016 John Baldwin <jhb@FreeBSD.org>

Remove description of P_FOLLOWFORK as this flag was removed.


# 15919690 12-Aug-2016 Warren Block <wblock@FreeBSD.org>

Correct the history of where ps first appeared.

PR: 211741
Submitted by: Sevan Janiyan <venture37@geeklan.co.uk>
MFC after: 1 week


# b7a25e63 28-Jul-2016 Konstantin Belousov <kib@FreeBSD.org>

When a debugger attaches to the process, SIGSTOP is sent to the
target. Due to a way issignal() selects the next signal to deliver
and report, if the simultaneous or already pending another signal
exists, that signal might be reported by the next waitpid(2) call.
This causes minor annoyance for debuggers, which must be prepared to
take any signal as the first event, then filter SIGSTOP later.

More importantly, for tools like gcore(1), which attach and then
detach without processing events, SIGSTOP might leak to be delivered
after PT_DETACH. This results in the process being unintentionally
stopped after detach, which is fatal for automatic tools.

The solution is to force SIGSTOP to be the first signal reported after
the attach. Attach code is modified to set P2_PTRACE_FSTP to indicate
that the attaching ritual was not yet finished, and issignal() prefers
SIGSTOP in that condition. Also, the thread which handles
P2_PTRACE_FSTP is made to guarantee to own p_xthread during the first
waitpid(2). All that ensures that SIGSTOP is consumed first.

Additionally, if P2_PTRACE_FSTP is still set on detach, which means
that waitpid(2) was not called at all, SIGSTOP is removed from the
queue, ensuring that the process is resumed on detach.

In issignal(), when acting on STOPing signals, remove the signal from
queue before suspending. Otherwise parallel attach could result in
ptracestop() acting on that STOP as if it was the STOP signal from the
attach. Then SIGSTOP from attach leaks again.

As a minor refactoring, some bits of the common attach code is moved
to new helper proc_set_traced().

Reported by: markj
Reviewed by: jhb, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D7256


# db57c70a 09-Feb-2016 Konstantin Belousov <kib@FreeBSD.org>

Rename P_KTHREAD struct proc p_flag to P_KPROC.

I left as is an apparent bug in ntoskrnl_var.h:AT_PASSIVE_LEVEL()
definition.

Suggested by: jhb
Sponsored by: The FreeBSD Foundation


# 5ef01115 01-Dec-2015 Craig Rodrigues <rodrigc@FreeBSD.org>

Fix spelling, as recommended by igor tool.


# 06691045 01-Dec-2015 Craig Rodrigues <rodrigc@FreeBSD.org>

Add more text to explain --libxo flag.


# 169a1855 14-Jul-2015 Joel Dahl <joel@FreeBSD.org>

mdoc: minor Xr fixes


# e8d89b84 27-May-2015 Sergey Kandaurov <pluknet@FreeBSD.org>

Document recent p_flag2 additions.


# 8beb1a2f 22-May-2015 Marcel Moolenaar <marcel@FreeBSD.org>

Convert to use libxo. Document use of libxo as well.

Obtained from: Phil Shafer <phil@juniper.net>
Sponsored by: Juniper Networks, Inc.


# c2290ff6 16-Mar-2015 Mark Felder <feld@FreeBSD.org>

Use 24h timestamps in the ps(1) STARTED column

The previous 12h AM/PM format was perplexing as it didn't follow the
locale of the user and was a minor annoyance to FreeBSD users coming
from Linux. Additionally, the man page was incorrect about the strftime
format.

There are three time formats that may be displayed in the STARTED
column depending on the age of the process. Below is an example.

For a process started at 14:30 on Monday 16 March 2015, the following
formats may be used:

14:30 for process < 24h old (24h Timestamp)
Mon14 for process > 24h, < 1 week old (Weekday Hour)
16Mar15 for process > 1 week old (Day Month Year)

Differential Revision: https://reviews.freebsd.org/D1620
Reviewed by: brd
Approved by: trasz


# 6ddcc233 13-Dec-2014 Konstantin Belousov <kib@FreeBSD.org>

Add facility to stop all userspace processes. The supposed use of the
feature is to quisce the system before suspend.

Stop is implemented by reusing the thread_single(9) with the special
mode SINGLE_ALLPROC. SINGLE_ALLPROC differs from the existing
single-threading modes by allowing (requiring) caller to operate on
other process. Interruptible sleeps for !TDF_SBDRY threads are
suspended like SIGSTOP does it, instead of aborting the sleep, like
SINGLE_NO_EXIT, to avoid spurious EINTRs on resume.

Provide debugging sysctl debug.stop_all_proc, which causes total stop
and suspends syncer, while waiting for variable reset for resume. It
is used for debugging; should be removed after the real use of the
interface is added.

In collaboration with: pho
Discussed with: avg
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks


# 8b04bbef 28-Aug-2014 Mateusz Guzik <mjg@FreeBSD.org>

Return real parent pid in kinfo (used by e.g. ps)

Add a separate field which exports tracer pid and add a new keyword
("tracer") for ps to display it.

This is a follow up to r270444.

Reviewed by: kib
MFC after: 1 week
Relnotes: yes


# d7359980 06-Aug-2014 Konstantin Belousov <kib@FreeBSD.org>

Correct the problems with the ptrace(2) making the debuggee an orphan.
One problem is inferior(9) looping due to the process tree becoming a
graph instead of tree if the parent is traced by child. Another issue
is due to the use of p_oppid to restore the original parent/child
relationship, because real parent could already exited and its pid
reused (noted by mjg).

Add the function proc_realparent(9), which calculates the parent for
given process. It uses the flag P_TREE_FIRST_ORPHAN to detect the head
element of the p_orphan list and than stepping back to its container
to find the parent process. If the parent has already exited, the
init(8) is returned.

Move the P_ORPHAN and the new helper flag from the p_flag* to new
p_treeflag field of struct proc, which is protected by proctree lock
instead of proc lock, since the orphans relationship is managed under
the proctree_lock already.

The remaining uses of p_oppid in ptrace(PT_DETACH) and process
reapping are replaced by proc_realparent(9).

Phabric: D417
Reviewed by: jhb
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks


# 38d22923 06-Jun-2014 Sergey Kandaurov <pluknet@FreeBSD.org>

Add support for inspecting process flags set in p_flag2.

Reviewed by: jhb
MFC after: 1 week


# 13767130 02-May-2014 Bryan Drewery <bdrewery@FreeBSD.org>

Add -J to filter by matching jail IDs and names.

-J 0 can be used to show only host processes.

Patch partially based on work by bz@

PR: bin/78763
MFC after: 2 weeks
Relnotes: yes


# 93f7e978 27-Dec-2013 Mark Johnston <markj@FreeBSD.org>

Correct the description of the V state, which indicates that the process'
parent is suspended, not the process itself.

MFC after: 3 days


# 5e9ccc87 26-Aug-2013 Will Andrews <will@FreeBSD.org>

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


# e9e3a1ab 15-Mar-2013 Joel Dahl <joel@FreeBSD.org>

Add a few examples.

Obtained from: OpenBSD


# 45732078 07-Feb-2013 Konstantin Belousov <kib@FreeBSD.org>

Document P_PPTRACE.

MFC after: 2 weeks


# 08c62f8d 18-Sep-2012 Andrey Zonov <zont@FreeBSD.org>

- Bump date.

Submitted by: pluknet
Approved by: kib (mentor)
X-MFC-With: r240645


# 38f2be1c 17-Sep-2012 Andrey Zonov <zont@FreeBSD.org>

- Add 'dsiz' and 'ssiz' keywords to show data and stack size respectively.

Approved by: kib (mentor)
MFC after: 1 week


# 4f1e1f86 23-May-2012 Konstantin Belousov <kib@FreeBSD.org>

Add 'cow' keyword to show per-process cow count.

Submitted by: Andrey Zonov <andrey zonov org>
MFC after: 1 week


# 288eac5a 29-Mar-2012 Joel Dahl <joel@FreeBSD.org>

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.


# 28c84226 08-Mar-2012 Konstantin Belousov <kib@FreeBSD.org>

Document P_ORPHAN.

MFC after: 3 days


# 6edf5acc 22-Nov-2011 Mikolaj Golub <trociny@FreeBSD.org>

Remove yet another outdated note about procfs(5) being required.

Spotted by: arundel


# 57c87bfa 22-Nov-2011 Mikolaj Golub <trociny@FreeBSD.org>

No need in procfs(5).

MFC after: 2 weeks


# aa7a15b6 30-Oct-2011 Edward Tomasz Napierala <trasz@FreeBSD.org>

For processes with no controlling terminal, display "-" in the TTY column
instead of "?".

Submitted by: arundel


# 6ec3cd07 02-Oct-2011 Glen Barber <gjb@FreeBSD.org>

Correct a typo that was introduced in 225912

Submitted by: Valentin Nechayev (netch % netch!kiev!ua), arundel
MFC after: 1 week
With-MFC: 225908


# 2d455a01 01-Oct-2011 Glen Barber <gjb@FreeBSD.org>

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


# 64015438 01-Oct-2011 Glen Barber <gjb@FreeBSD.org>

Reorder default ps(1) output according to reality.

Submitted by: arundel (via docs@)
MFC after: 1 week


# b758bdf8 01-Jul-2011 Sergey Kandaurov <pluknet@FreeBSD.org>

Bump date after the previous commit.


# b3178949 01-Jul-2011 Sergey Kandaurov <pluknet@FreeBSD.org>

Update and sort the list of the available keywords.


# 9acd9127 14-Jun-2011 Edward Tomasz Napierala <trasz@FreeBSD.org>

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>


# 9abcf93a 20-May-2011 Sergey Kandaurov <pluknet@FreeBSD.org>

Spelling in P_HADTHREADS.

MFC after: 1 week


# 0d694829 20-May-2011 Sergey Kandaurov <pluknet@FreeBSD.org>

Fix the description of the "paddr" keyword. It shows a process
pointer just like a dublicating "uprocp".

MFC after: 1 week


# b9ff20ab 18-Apr-2011 Edward Tomasz Napierala <trasz@FreeBSD.org>

Document problems with -d/-w and the fact that -X is the default.

Suggested by: arundel@
Reviewed by: arundel@


# a870bf2c 17-Mar-2011 Konstantin Belousov <kib@FreeBSD.org>

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


# 7123f4cd6 05-Mar-2011 Edward Tomasz Napierala <trasz@FreeBSD.org>

Export login class information via kinfo and make it possible to view
it using "ps -o class".


# f5f3977b 25-Jan-2011 Konstantin Belousov <kib@FreeBSD.org>

Document P_FOLLOWFORK.

MFC after: 2 weeks


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 6239ef1d 07-Oct-2010 Ed Maste <emaste@FreeBSD.org>

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.


# 9cde081d 24-Jul-2010 Edward Tomasz Napierala <trasz@FreeBSD.org>

Add P_HASTHREADS flag description.


# b721d615 11-May-2010 Konstantin Belousov <kib@FreeBSD.org>

MFC r206548:
Update the list of the process flags for P_WKILLED.


# 9b0b5292 13-Apr-2010 Konstantin Belousov <kib@FreeBSD.org>

Update the list of the process flags for P_WKILLED.

MFC after: 4 weeks


# 5a9ca220 19-Mar-2010 Konstantin Belousov <kib@FreeBSD.org>

MFC r204755:
Update the list of the process flags. Note that the lists of pending
signals for process and its threads are distinct.


# 41ded75d 17-Mar-2010 Juli Mallett <jmallett@FreeBSD.org>

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


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 7117b3d5 05-Mar-2010 Konstantin Belousov <kib@FreeBSD.org>

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


# e5002279 09-Jul-2009 Edward Tomasz Napierala <trasz@FreeBSD.org>

Add manual page links to advertise procstat(1) a little better.

Approved by: re (kib)


# 044fce53 16-May-2009 Brian Somers <brian@FreeBSD.org>

Add a -d option to ps to display descendant info with the output.
This is similar to linux's -H (or -f) switch.

MFC after: 3 weeks


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 7f77f844 12-Mar-2008 Jeff Roberson <jeff@FreeBSD.org>

- P_SA has been removed.


# 9badf57f 17-Sep-2006 Ruslan Ermilov <ru@FreeBSD.org>

Markup fixes.


# 7c5169ef 20-Aug-2006 Yaroslav Tykhiy <ytykhiy@gmail.com>

For the sake of clarity, explicitly tell that comma and space
characters can be included in a custom column title string --
that's why it may appear at the end of a keyword list argument
only.


# 61b92b9a 18-Aug-2006 Yaroslav Tykhiy <ytykhiy@gmail.com>

Document a detail in the present syntax of "ps -o foo=bar". Now
the header title string "bar" extends to the end of the argument
even if it contains commas or spaces, unlike in RELENG_4 or earlier.
The modern syntax agrees with SUSv3.

MFC after: 3 days


# fa6c8d89 29-Apr-2005 Maxim Konovalov <maxim@FreeBSD.org>

o Typo: s/teminal/terminal/.

Submitted by: Michal Varga


# a990344f 20-Mar-2005 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Add and document the 'jid' keyword for the '-o' option.

Reviewed by: gad
MFC after: 3 days


# 6aac4c27 14-Feb-2005 Xin LI <delphij@FreeBSD.org>

Several improvements to ps.1:
- Document the fact that empty heading text suppresses the
heading line (e.g. 'ps -o pid='), as this is very useful
in scripts.
- Describe logname keyword more completely.
- Describe the printing of arguments more completely.
- Put lockname in the correct alphabetical order in the list
of all keywords.
- Correct sentence in standards section.

Submitted by: Jilles Tjoelker <jilles at stack nl>
PR: docs/73618
MFC After: 1 week


# a89237ae 09-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Sync program's usage() with manpage's SYNOPSIS.


# 9ddb49cb 10-Jan-2005 Warner Losh <imp@FreeBSD.org>

/*- or .\"- or #- to begin license clauses.


# 85c5243c 22-Dec-2004 Robert Watson <rwatson@FreeBSD.org>

Remove single line containing the word "KLD" ommitted in ps.1:1.80.

Pointed out by: ru (some time ago)


# ac06cb0a 28-Nov-2004 Robert Watson <rwatson@FreeBSD.org>

Point at the mac(4) man page when describing the -Z option.
Remove reference to /dev/lomac, which is no longer used by mac_lomac(4).

MFC after: 3 days


# e4b70e66 21-Jun-2004 Garance A Drosehn <gad@FreeBSD.org>

When displaying the "COMMAND" field for system-processes and/or kernel
threads, put the command name in square brackets instead of parenthesis.
This matches NetBSD, and also seems to be what linux does. The sentence
which is added to the man page is taken straight from NetBSD.

PR: bin/65803
Submitted by: Cyrille Lefevre
Obtained from: NetBSD


# 585bf557 25-May-2004 Garance A Drosehn <gad@FreeBSD.org>

Add pgrep(1) and pkill(1) to the cross-reference section of ps(1).


# 259fcfac 23-May-2004 Garance A Drosehn <gad@FreeBSD.org>

Add the 'sid' info to the output of `ps -j', to make up for the 'sess'
(session-pointer) info which was dropped from `ps' earlier in 5.x.

PR: bin/59423
Submitted by: Jilles Tjoelker


# 287d1861 16-May-2004 Ruslan Ermilov <ru@FreeBSD.org>

Assorted markup fixes.


# 6195fb41 06-Apr-2004 Mark Murray <markm@FreeBSD.org>

Remove clause 3 from the UCB licenses.

OK'ed by: imp, core


# 396e20d1 01-Apr-2004 Garance A Drosehn <gad@FreeBSD.org>

Add spaces after flag names on .Fl macros.

Noticed by: ru
MFC after: 4 days


# 8ed0d42f 31-Mar-2004 Garance A Drosehn <gad@FreeBSD.org>

Describe the sorting options in better and more complete detail.
Also improve the description of `-L' a little.

MFC after: 4 days


# 3dc91da5 27-Mar-2004 Garance A Drosehn <gad@FreeBSD.org>

Update the date on the man page, since this the previous change added
a few new options.


# a4c8a745 27-Mar-2004 Garance A Drosehn <gad@FreeBSD.org>

Support more POSIX/SUSv3 options:

- Change `-p' to allow a list of process IDs, and `-t' to allow a list
of terminal names, instead of only a single value for each.
- Add the `-A' option of SUSv3, which is exactly the same as `-ax'.
- Add the `-G gidlist' (group id).
- Allow any of these "selector options" to be specified multiple times,
and have `ps' keep adding to a given list -- instead of replacing the
previously-specified values.
- Fix interactions between selector-options, so that: "If any are
specified, ... ps shall select the processes represented by the
inclusive OR of all the selection-criteria options." (from SUSv3)
- Add a `-X' option, which is the reverse of the `-x' option.

- various minor improvements in parsing and error handling.

This does not get us to match POSIX/SUSv3, but it gets us closer. The
`-g pgidlist', `-R ruserlist' and `-s sidlist' options mentioned in
freebsd-standards are still under debate, so they skipped for now.
It should be true that this introduces no user-visible incompatible
changes, except to support "new stuff" that was not supported before.


# f9a480ab 26-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

Avoid the manpage layering violation and low-level implementation
details of libkvm, and just tell what the getbootfile(3) function
will return, by using the text from netstat(1) and dmesg(8).


# cd31922f 26-Mar-2004 Ruslan Ermilov <ru@FreeBSD.org>

- Remove references to /dev/kmem -- ps(1) utilizes the
sysctl(3) interface in kvm(3).
- Document the correct default when no -N is specified.
- Remove stale reference to /var/db/kvm_kernel.db.
- Remove stale reference to /var/run/dev.db.


# b59ca660 21-Mar-2004 Tim J. Robbins <tjr@FreeBSD.org>

Document incorrect handling of multibyte characters.


# 4e8b6a6f 17-Mar-2004 Garance A Drosehn <gad@FreeBSD.org>

Improvements to 'ps -p <x>'. If <x> is a process id that does not exist, then
just print the header (if any) and exit, thus matching the behavior on -stable
and other OS's.

Also adds support for <x> being a comma-separated list of processes, and does
a much better checking for invalid-values of <x>, such as 'ps -p someword'.

Reviewed by: mentioned on freebsd-current
MFC after: 10 days


# bcf85d67 21-Jan-2004 Colin Percival <cperciva@FreeBSD.org>

Bring ps.1 up to date with changes in the past seven years:
* Remove mention of '>', 'A', and 'S' states
* Mention 'W' state.
* List 'J' state in the correct location.
* Sync with flags in sys/proc.h

Approved by: rwatson (mentor)
MFC after: 7 days


# fe08efe6 08-Sep-2003 Ruslan Ermilov <ru@FreeBSD.org>

mdoc(7): Use the new feature of the .In macro.


# a54b88d8 05-Aug-2003 Christian Brueffer <brueffer@FreeBSD.org>

Clarify that the 'state' information consists of characters, not
only letters (e.g. IWs+)

PR: 55221
Submitted by: Rich Morin <rdm@cfcl.com>
MFC after: 3 days


# 48b8c0de 12-Jun-2003 Scott Long <scottl@FreeBSD.org>

Add the -H option to ps(1) to display all kernel visible threads in each
process. The default behavior of showing only the process is retained as
the default.


# c6e69125 08-Jun-2003 Philippe Charnier <charnier@FreeBSD.org>

add section name to .Xr


# fbc8f8a2 30-Apr-2003 Jens Schweikhardt <schweikh@FreeBSD.org>

Fix references to non-existing or obsoleted man pages.

PR: docs/51480 (only a small part)
Submitted by: Diomidis D. Spinellis <dds@aueb.gr>


# 463cfa80 23-Dec-2002 Ruslan Ermilov <ru@FreeBSD.org>

Fixed the abuses of .Ql visible on stderr in troff mode.

PR: docs/37176


# 2af538eb 23-Oct-2002 Robert Watson <rwatson@FreeBSD.org>

Use the MAC interface to list process MAC labels rather than using
the LOMAC-specific interface (which is being deprecated). The
revised LOMAC using the MAC framework will export levels listable
using this mechanism.

Approved by: re
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories


# 0d632649 02-Oct-2002 John Baldwin <jhb@FreeBSD.org>

Catch up to SMTX -> SLOCK changes.


# 7d971bbf 21-Aug-2002 Tom Rhodes <trhodes@FreeBSD.org>

s/filesystem/file system/ as discussed on -developers


# 43cf90aa 09-Aug-2002 Ruslan Ermilov <ru@FreeBSD.org>

mdoc(7) police: whitespace nits.


# 7140a0e9 10-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

ps(1) appeared in v4

Submitted by: grog


# a13d4e42 09-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

Note early appearence of some commands. These actually appeared in PWB, but
it seems we don't have a macro for that yet, so list them in the first UNIX
release since then that we have a .At for: v7.


# 2dda9fe9 08-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

Allow whitespace to act as a delimiter in the keywords list given to the -o,
again, but also allow it in the user-specified header, too. This is far more
backwards compatible and SUSv3-happy than allowing only comma to seperate the
keywords list.

Submitted by: tjr


# 50355bb4 07-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

Don't say that the list of formats can be space delimited, it no longer can be.

Mention that more than one -o will concatenate formats.

Submitted by: Jun Kuriyama <kuriyama@imgsrc.co.jp>


# 76e1a9fe 06-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

Implement a SUSv3-ignorant but "time"-similar format for "etime", elapsed
run time (NOT cpu time). cputime() and elapsed() both need to honour SUSv3
now.


# e8eef4bb 06-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

Support the SUSv3 `rgroup' format.

Clean up some local style bogons.


# 03334017 06-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

SUSv3 conform on the "comm" and "args" formats, and make correct the "command"
format, since it's BSDlike, and "comm" is actually different.


# badfdad9 06-Jun-2002 Juli Mallett <jmallett@FreeBSD.org>

Refer to the command format by its SUSv3 name (comm), and list command as an
alias.


# 4f18100d 04-Jun-2002 Tim J. Robbins <tjr@FreeBSD.org>

Respect setting of the COLUMNS environment variable (SUSv3)


# d883e289 16-May-2002 Josef Karthauser <joe@FreeBSD.org>

The sysctl has changed from 'kern.ps_showallprocs' to
'security.bsd.see_other_uids'.


# ebd43244 15-May-2002 Tom Rhodes <trhodes@FreeBSD.org>

Consistancy check s/file system/filesystem/

Reviewed by: brian


# 1063e126 09-May-2002 Josef Karthauser <joe@FreeBSD.org>

Replace /kernel with /boot/kernel/kernel.

PR: docs/37757
Submitted by: Hiten Pandya <hiten@uk.FreeBSD.org>


# e004acc8 16-Apr-2002 Philippe Charnier <charnier@FreeBSD.org>

Use `The .Nm utility'


# d9a5f890 21-Feb-2002 Matthew Dillon <dillon@FreeBSD.org>

Revert wchan functionality. Add 'mwchan' to supply new duel mutex/msleep
functionality and make it the default.

With additional improvements by: Mark Peek <mp@FreeBSD.org>


# 3ab66561 16-Feb-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Document the 'M' state.


# 831c910a 28-Jan-2002 Ruslan Ermilov <ru@FreeBSD.org>

GC the -W option. kvm(3) doesn't read swap for almost 10 years.

PR: docs/34134
Reviewed by: bde, peter
MFC after: 1 month


# b5f82180 04-Dec-2001 Ruslan Ermilov <ru@FreeBSD.org>

mdoc(7) police: s/LKM/KLD/, sort xrefs.


# 7304f61f 26-Nov-2001 Brian Feldman <green@FreeBSD.org>

Add LOMAC options (the "Z" flag in both cases) to display extra information
in ls(1) and ps(1).

Sponsored by: DARPA, NAI Labs


# caa2db3b 10-Jul-2001 Ruslan Ermilov <ru@FreeBSD.org>

mdoc(7) police: removed HISTORY info from the .Os call.


# 7fa34c11 07-Jun-2001 Dima Dorfman <dd@FreeBSD.org>

Correct a typo.

Submitted by: Alexey V. Neyman <avn@any.ru>


# 6b821228 01-Jun-2001 Dima Dorfman <dd@FreeBSD.org>

Mention the kern.ps_showallprocs sysctl.

PR: 24804
Submitted by: Mike Meyer <mwm@mired.org>


# cdf6f0b1 12-Apr-2001 Brian Somers <brian@FreeBSD.org>

Correct some markup

Submitted by: bde


# ff1b168b 11-Apr-2001 Brian Somers <brian@FreeBSD.org>

Introduce -osid and -otsid

Submitted by: dd


# 48b2c871 07-Apr-2001 Brian Somers <brian@FreeBSD.org>

Remove tsess for now.

This (and sess) may come back shortly.


# 86aca211 07-Apr-2001 Brian Somers <brian@FreeBSD.org>

Update documentation in line with what the code does

PR: 25435
Submitted by: dd
Forgotten by: mckusick


# d0353b83 01-Feb-2001 Ruslan Ermilov <ru@FreeBSD.org>

mdoc(7) police: split punctuation characters + misc fixes.


# 12e720d7 15-Dec-2000 Ruslan Ermilov <ru@FreeBSD.org>

Prepare for mdoc(7)NG.


# 9b67ac59 30-Nov-2000 John Baldwin <jhb@FreeBSD.org>

Document the mtxname keyword.

Reviewed by: sheldonh


# be8b1497 20-Nov-2000 Ruslan Ermilov <ru@FreeBSD.org>

mdoc(7) police: use the new features of the Nm macro.


# 2d45aed6 28-Oct-2000 Chris D. Faulhaber <jedgar@FreeBSD.org>

Remove obsolete /dev/drum references

Reviewed by: alex, asmodai, billf


# cf22dcfc 25-Sep-2000 Brian Somers <brian@FreeBSD.org>

Support multiple (comma separated) names as arguments to -U

PR: 11051


# 2a456239 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# f58bcbc9 30-Jun-1999 Kris Kennaway <kris@FreeBSD.org>

Correct reference to the obsolete vadvise() to madvise() (with appropriate
arguments)

PR: 11586
Submitted by: David Gilbert <dgilbert@velocet.ca>
Reviewed by: Doug Rabson


# 46be34b9 08-May-1999 Kris Kennaway <kris@FreeBSD.org>

Various spelling/formatting changes.

Submitted by: Philippe Charnier <charnier@xp11.frmug.org>


# 75c13541 28-Apr-1999 Poul-Henning Kamp <phk@FreeBSD.org>

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/


# 3d28e3ed 05-Apr-1999 Peter Wemm <peter@FreeBSD.org>

Update p_flags doc.


# 55cb6cf5 04-Jun-1998 Joseph Koshy <jkoshy@FreeBSD.org>

Fix errors that crept into the previous commit.


# 77027e30 04-Jun-1998 Joseph Koshy <jkoshy@FreeBSD.org>

1. `ps' output now shows 3 characters in the `TT' field, not 2, after
rev 1.6 of "ps.c".
2. Reword description of `-f' option.

PR: 5340
Submitted by: Jorge Goncalves <j@bug.fe.up.pt>


# c9a8d1f4 15-May-1998 Philippe Charnier <charnier@FreeBSD.org>

Correct use of .Nm. Add rcsid.


# 0e3b7418 18-Feb-1998 Dima Ruban <dima@FreeBSD.org>

Add 'f' flag to the optstring.


# b548141b 05-Dec-1997 John Dyson <dyson@FreeBSD.org>

Document the new -f flag.
PR: 5196
Submitted by: Matt Dillon <dillon@best.net>


# 7d4774d0 19-Aug-1997 Jonathan Lemon <jlemon@FreeBSD.org>

Document correct option in manual page.

PR: 3769
Submitted by: johnp@lodgenet.com


# b97fa2ef 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

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.


# db91faac 21-Oct-1996 Peter Wemm <peter@FreeBSD.org>

Implement a -c option to ps to display the short command name instead of
the full argument vector.

I've bumped into a few things that expected this switch to be present,
the most recent was the snmp package in ports. I'm not 100% sure of the
origins of this, but Linux has it, so does the "BSD-compatable" version
of ps on our SVR4 systems (so I assume SunOS has it too).


# 3b818f3a 03-Jul-1996 Mike Pritchard <mpp@FreeBSD.org>

The default swap device is /dev/drum, not /dev/swap
as ps.1 states.

Submitted by: Zahemszhky Gabor <zgabor@code.hu>


# c01bf97c 19-Apr-1996 Sujal Patel <smpatel@FreeBSD.org>

Fix up the badly out of date struct proc's p_flags.
Flags aren't printed in hexadecimal, as documented.


# e229ffb7 06-Apr-1996 Mike Pritchard <mpp@FreeBSD.org>

Correct some cross references and some path names.


# f3c0267f 02-Feb-1996 Mike Pritchard <mpp@FreeBSD.org>

Fix some incorrect locations in the FILES sections of some man pages.


# 1c0c7731 30-Dec-1995 Joerg Wunsch <joerg@FreeBSD.org>

Small man page tweaks:

. mention the need for procfs
. make it clear that default sorting is first by ctty, then by PID

Submitted by: schweikh@ito.uni-stuttgart.de (Jens Schweikhardt)


# 73eb8310 25-Dec-1995 Peter Wemm <peter@FreeBSD.org>

Implement a new option to ps.. `-U username'. This allows you to
list the processes belonging to a particular user without having to use
`-u' and grepping for the username. Basically you can now get a short
`ps -x' like list (with more space for the command) for other users.


# 89730b29 23-Sep-1994 David Greenman <dg@FreeBSD.org>

Added $Id$


# a837235a 01-Sep-1994 David Greenman <dg@FreeBSD.org>

Added rtprio option/field.

Submitted by: Henrik Vestergaard Draboel


# b3bfc719 05-Aug-1994 David Greenman <dg@FreeBSD.org>

Converted 'vmunix' to 'kernel'.


# 4b88c807 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite bin Sources