- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: CPU idle % in /proc
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2003 07:00 AM
тАО07-08-2003 07:00 AM
CPU idle % in /proc
Do you know if it written somewhere /proc? How does commands like top or sar get this value?
tx for your help.
Claudio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2003 07:14 AM
тАО07-08-2003 07:14 AM
Re: CPU idle % in /proc
unfortunately dont have a Linux box around at this momemnt.
in /proc directory if i remember correctly there should be the following files which should give u the info.
1. cpuinfo.
2. loadavg
3. meminfo.
see if they provide the relevant info.
else there is an option to the top command to write the output to a file and u can parse the output from there.
-balaji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2003 07:28 AM
тАО07-08-2003 07:28 AM
Re: CPU idle % in /proc
Ciao
Claudio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2003 11:44 AM
тАО07-08-2003 11:44 AM
Re: CPU idle % in /proc
If you are in X Gnome there is a performance monitor under Programs Utilities.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2003 05:27 PM
тАО07-08-2003 05:27 PM
Re: CPU idle % in /proc
You'll need to write your own application to calculate it for you. You could probably be cheeky and just rip the code from the 'top' source.
My best understanding is that it grabs details out of /proc/
.. it uses some very funky stuff, and does uses a proc_t struct as this:
/*
* Calculate percent cpu time for this task.
*/
this->pcpu = (total_time * 10 * 100/Hertz) / elapsed_time;
if (this->pcpu > 999)
this->pcpu = 999;
So it's calculating out the %usage a given process has given how much time has passed in a given period, and how many CPU cycles it's used based on how many it can do..
Combining that with 'man proc' might get you somewhere..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2003 10:30 PM
тАО07-08-2003 10:30 PM
Re: CPU idle % in /proc
mmmmh... thinking...
Ciao
Claudio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2003 10:36 PM
тАО07-08-2003 10:36 PM
Re: CPU idle % in /proc
/proc/stat is my new friend!
man page helped. I didn't know the existence of the man page for /proc.
Thanks to all!
Claudio