Reputation: 3761
Im making a simple alternative to the default linux system monitor.
Im looking to know how it lifts the process stats, which is displays in the Processes tab.
It probably runs off /proc, but im unsure.
Also, where could i find the source code for the system monitor program?
Regards
Paul
Also, having looked at how gnome system monitor and programs such as ps and top, the code is hard to follow, and i cannot easily see how they actually get process stats. Im thinking that the libproc library could be very useful, but i cannot find any documentation online about what functions are contained within it. Would anybody have or be able to point me in the right direction of the documentation, thanks....
Upvotes: 3
Views: 1653
Reputation: 31
Usually process information is fetched from /proc//stat and /proc//statm. The different fields in stat and statm are described in the man-page for proc (which also are to be found here: http://linux.die.net/man/5/proc).
Upvotes: 0
Reputation: 7359
Yes, it uses /proc
. You can download the sources for your distribution (assuming that it's debian based by the tags) with apt:
sudo apt-get source gnome-system-monitor
And you will have more examples in tools like top, packaged in procps:
sudo apt-get source procps
Upvotes: 2