CPU utolization in percentage for each process
Hello all,
I am running Fedora 8 Linux distribtion.
I already went through the "man" and also previosly posted threads.
I want to get the CPU % utilization and Mem% utilization.
I do not want to use any utility such as top.
I know that we can get it by using /proc/[pid]/stat but I don't know which fields would help me derive the cpu and mem utilization.
eg. With process id of 2407 the cat command would display:
[xxx@machine 2407]$ cat stat
2407 (bluetooth-apple) S 2317 2317 2317 0 -1 4202496 1564 0 1 0 3 1 0 0 20 0 1 0 4794 18317312 1380 4294967295 134512640 134574160 3213748832 3213748356 1115138 0 0 536875008 1256 0 0 0 17 1 0 0 24
But I cannot interpret what these numbers mean.
Can some one please help me on this.
Thanks.
|