LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   per process Cpu utilization (https://www.linuxquestions.org/questions/linux-software-2/per-process-cpu-utilization-325323/)

kunal_patel22 05-20-2005 06:50 AM

per process Cpu utilization
 
hello frnds,


Can you plz tell me how do i calculate per process cpu utilization ......

i m sorry i m posting it again but didnt get a rational ans during my first post


i know that we have to calculate uisng /proc/PID/stat n specifically frm fields 14 to 17.........but my main question is HOW????????????

HOW USING THOSE FIELDS?????????????????

plz clarify me on that.........


Once again i m sorry for posting it again...........but i m in need of it badly


Regards,

Kunal

macemoneta 05-20-2005 07:58 PM

Why not just use 'top' or 'ps', since that's their purpose?

kunal_patel22 05-20-2005 11:28 PM

hello frnds,


I know i can use top or ps command but then i have simulate that command as a project so i need that statics


plz tell me frnds way of this

macemoneta 05-20-2005 11:40 PM

You'll probably find this article usefull. Remember, you can always look at the source for top and ps as well.

nsyed4 12-04-2007 05:14 PM

Get CPU Utilization in % for a Process
 
Hello Kunal,

I have the same question as you had. Did you resolve it.
Were you able to get the CPU % and Mem % for each process through the /proc/pid/stat or /proc/pid/statm.

Please reply me if you have the solution.

Thanks,
Noor


All times are GMT -5. The time now is 10:30 PM.