Add /proc/<pid>/totmaps
authorthiagog <thiagog@chromium.org>
Mon, 30 Jul 2012 21:17:20 +0000 (14:17 -0700)
committerGerrit <chrome-bot@google.com>
Mon, 6 Aug 2012 19:06:51 +0000 (12:06 -0700)
commit408cf845486cc4ed0b5d9da24bed672d436d2c3f
treecb84080e0fada60ba0425737af8e985675e82401
parentdcfe82edd6a704a638312e3891a0b49678e684dc
Add /proc/<pid>/totmaps

BUG=None
TEST=Manual

/proc/<pid>/totmaps is an alternative to /proc/<pid>/smaps. It contains a
summary of all memory displayed in smaps, while hiding the memory page
addresses. Thus, it is possible to access any process's totmaps info.
totmaps also gets the information from the PTEs, like smaps. Furthermore,
it also gives more detailed and accurate information about the memory
usage of a process than statm. The fields available in totmaps are Rss,
totmaps, Shared_Clean, Shared_Dirty, Private_clean, Private_Dirty,
Referenced, Anonymous, AnonHugePages, Swap and Locked.

Sample output:

Rss:                6120 kB
Pss:                3335 kB
Shared_Clean:       1008 kB
Shared_Dirty:       4012 kB
Private_Clean:         4 kB
Private_Dirty:      1096 kB
Referenced:         1812 kB
Anonymous:          5108 kB
AnonHugePages:         0 kB
Swap:                  0 kB
Locked:                0 kB

Change-Id: I4867554c1a4d200d304c3765447977767b7b3c72
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28731
Reviewed-by: Kees Cook <keescook@chromium.org>
fs/proc/base.c
fs/proc/internal.h
fs/proc/task_mmu.c