library: exploit linux-4.5 resident memory enhancement

Beginning with linux-4.5, the following new fields are
being added under that /proc/<pid>/status pseudo file:
 . RssAnon - size of resident anonymous memory
 . RssFile - size of resident file mappings
 . RssShmem - size of resident shared memory

This patch just represents the initial library and top
support, sharing a commit message with 2 more patches.

p.s. locked resident memory support was also added but
isn't directly related to the kernel 4.5 enhancements.

Reference(s):
commit 1f8e41d019
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2016-04-13 00:00:00 -05:00
committed by Craig Small
parent b921e2e765
commit 8dc378f6a8
4 changed files with 95 additions and 69 deletions

View File

@ -132,6 +132,10 @@ enum pids_item {
PROCPS_PIDS_VM_LIB, // ul_int
PROCPS_PIDS_VM_LOCK, // ul_int
PROCPS_PIDS_VM_RSS, // ul_int
PROCPS_PIDS_VM_RSS_ANON, // ul_int
PROCPS_PIDS_VM_RSS_FILE, // ul_int
PROCPS_PIDS_VM_RSS_LOCKED, // ul_int
PROCPS_PIDS_VM_RSS_SHARED, // ul_int
PROCPS_PIDS_VM_SIZE, // ul_int
PROCPS_PIDS_VM_STACK, // ul_int
PROCPS_PIDS_VM_SWAP, // ul_int