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>