ps: Add PSS and USS fields

The library added smaps_rollup fields in the referenced commit.
This commit exploits the new fields to give pss and uss options.

These options were first proposed back in 2015 by Petr Malat
and, with the library update, they are finally made it into ps.

Why use proportional or unique segment size? It is argued that
these give a better idea of the "real" memory usage of a process.

References:
 commit 12543b6c76
 issue #112
 https://www.freelists.org/post/procps/PSS-and-USS-support-for-ps
 https://lwn.net/Articles/230975/

Signed-off-by: Craig Small <csmall@dropbear.xyz>
This commit is contained in:
Craig Small
2021-06-16 21:13:52 +10:00
parent e75bbeb117
commit e782b1d859
5 changed files with 31 additions and 1 deletions

12
ps/ps.1
View File

@@ -4,7 +4,7 @@
.\" Quick hack conversion by Albert Cahalan, 1998.
.\" Licensed under version 2 of the Gnu General Public License.
.\"
.TH PS "1" "2021-03-29" "procps-ng" "User Commands"
.TH PS "1" "2021-06-16" "procps-ng" "User Commands"
.\"
.\" To render this page:
.\" groff -t -b -man -X -P-resolution -P100 -Tps ps.1 &
@@ -1524,6 +1524,11 @@ psr PSR T{
processor that process last executed on.
T}
pss PSS T{
Proportional share size, the non-swapped physical memory, with shared memory
proportionally accounted to all tasks mapping it.
T}
rbytes RBYTES T{
Number of bytes which this process really did cause to be fetched from the storage layer.
T}
@@ -1855,6 +1860,11 @@ See
.IR namespaces (7).
T}
uss USS T{
Unique set size, the non-swapped physical memory, which
is not shared with an another task.
T}
utsns UTSNS T{
Unique inode number describing the namespace the process belongs to.
See