How do the commands
ps calculate CPU utilization using the
/proc/[$pid]/stat file? Also how do they obtain memory utilization information about the process?
Here's how I would do "just reading the source for the procps package"
What package(s) is/are
Look at the versions of procps and apt-src
Get the source for the
See what we got:
Read this for good pointers on memory usage & calculation on Linux