There are lots of CPU Usage questions appropriately answered by "top" etc, but I am writing my own monitoring app for one particular machine, and want to know where CPU Usage details are in the filesystem of Ubuntu 13.10 . In particular I want to distinguish between usage by VirtualBox, and by boinc+boincmgr+4*setiathome threads, and the rest, (? and whatever remains uncounted ?).
Intel D2700 - 2 cores, 4 logical
I can make it work, sort of, by calling
top -n -1 every second from my app, and digging through the response lines for the info, but as you can see, the ticks for top, boinc (50% usage) and my app drift out of step every few minutes, so a non-top version would be much more direct: