LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-03-2009, 03:30 AM   #1
Igrushkin
LQ Newbie
 
Registered: May 2009
Location: Vinnica, Ukraine
Distribution: Xubuntu, embedded linux
Posts: 8

Rep: Reputation: 1
CPU load monitoring


Hi all!

I have a couple of applications running with highest priority on my embedded linux board. I want to monitor their CPU load in real time and decrease the application priority using setpriority() function when it exceeds some theshold. I can use getloadavg() but I want to monitor CPU load by the particular application (something like in "top") but not the entire CPU load.

Is it possible? Thank you in advance!
 
Old 06-03-2009, 04:41 AM   #2
minimol
LQ Newbie
 
Registered: Aug 2006
Distribution: Fedora
Posts: 10

Rep: Reputation: 0
try reading /proc/<pid>/stat for the details you are looking for. ( see manpage of proc ).
 
Old 06-03-2009, 06:17 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,805

Rep: Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168Reputation: 2168
That's where the data comes from, but you'll need to do your own maths - that's what makes top so handy.
You'll probably also need /proc/stat to work out percentages.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Monitoring CPU temp BobNutfield Linux - Hardware 6 08-27-2007 07:55 PM
Monitoring CPU in % mikz Slackware 5 03-03-2006 11:59 AM
cpu monitoring saavik Linux - Networking 2 03-30-2005 05:11 AM
CPU fanspeed monitoring! DVDke Linux - Software 0 05-11-2003 10:03 AM
Monitoring CPU temp.? NSKL Linux - General 28 06-21-2002 09:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration