For example, I have:
% grep '^Mapped:' /proc/meminfo
Mapped: 121868 kB
I want to generate something like this:
PID Mapped Path
123 1234 kB /lib/libX.so
234 23445 kB /bin/bash
...
TOTAL 121868 kB
So that, TOTAL
is the same number from /proc/meminfo
.
I looked thought /proc/<pid>/smaps
, but not sure what exactly fields should I sum in order to get correct TOTAL.