<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CPU idle % in /proc in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017975#M75692</link>
    <description>any user should be able to at least run the top command and identify the offending process.&lt;BR /&gt;&lt;BR /&gt;If you are in X Gnome there is a performance monitor under Programs Utilities.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
    <pubDate>Tue, 08 Jul 2003 18:44:35 GMT</pubDate>
    <dc:creator>Steven E. Protter</dc:creator>
    <dc:date>2003-07-08T18:44:35Z</dc:date>
    <item>
      <title>CPU idle % in /proc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017972#M75689</link>
      <description>I need to read the CPU % idle state (like the value shown by top) without running any command.&lt;BR /&gt;Do you know if it written somewhere /proc? How does commands like top or sar get this value?&lt;BR /&gt;&lt;BR /&gt;tx for your help.&lt;BR /&gt;Claudio</description>
      <pubDate>Tue, 08 Jul 2003 14:00:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017972#M75689</guid>
      <dc:creator>Claudio Cilloni</dc:creator>
      <dc:date>2003-07-08T14:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: CPU idle % in /proc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017973#M75690</link>
      <description>hmm..&lt;BR /&gt;unfortunately dont have a Linux box around at this momemnt.&lt;BR /&gt;&lt;BR /&gt;in /proc directory if i remember correctly there should be the following files which should give u the info.&lt;BR /&gt;&lt;BR /&gt;1. cpuinfo.&lt;BR /&gt;2. loadavg&lt;BR /&gt;3. meminfo.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;see if they provide the relevant info.&lt;BR /&gt;&lt;BR /&gt;else there is an option to the top command to write the output to a file and u can parse the output from there.&lt;BR /&gt;-balaji</description>
      <pubDate>Tue, 08 Jul 2003 14:14:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017973#M75690</guid>
      <dc:creator>Balaji N</dc:creator>
      <dc:date>2003-07-08T14:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: CPU idle % in /proc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017974#M75691</link>
      <description>thanks Balaji, but I cannot run an external program as you suggested, and these files don't contain the idle value. I'm using now /proc/loadavg, but sometimes it gives some peaks, passing from 0 to 1 instantly. It could cause my program make bad choices; so I prefer make my own calculation about cpu load.&lt;BR /&gt;&lt;BR /&gt;Ciao&lt;BR /&gt;Claudio&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Jul 2003 14:28:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017974#M75691</guid>
      <dc:creator>Claudio Cilloni</dc:creator>
      <dc:date>2003-07-08T14:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: CPU idle % in /proc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017975#M75692</link>
      <description>any user should be able to at least run the top command and identify the offending process.&lt;BR /&gt;&lt;BR /&gt;If you are in X Gnome there is a performance monitor under Programs Utilities.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 08 Jul 2003 18:44:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017975#M75692</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-07-08T18:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: CPU idle % in /proc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017976#M75693</link>
      <description>From what I understand of the 'proc' file system, there is no bare-word processor utilisation % values stored.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;My best understanding is that it grabs details out of /proc/&lt;PID&gt;/stat or /proc/&lt;PID&gt;/status, neither of which are very nice to look at.&lt;BR /&gt;&lt;BR /&gt;.. it uses some very funky stuff, and does uses a proc_t struct as this:&lt;BR /&gt;        /*&lt;BR /&gt;         * Calculate percent cpu time for this task.&lt;BR /&gt;         */&lt;BR /&gt;        this-&amp;gt;pcpu = (total_time * 10 * 100/Hertz) / elapsed_time;&lt;BR /&gt;        if (this-&amp;gt;pcpu &amp;gt; 999)&lt;BR /&gt;            this-&amp;gt;pcpu = 999;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;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..&lt;BR /&gt;&lt;BR /&gt;Combining that with 'man proc' might get you somewhere..&lt;/PID&gt;&lt;/PID&gt;</description>
      <pubDate>Wed, 09 Jul 2003 00:27:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017976#M75693</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2003-07-09T00:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: CPU idle % in /proc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017977#M75694</link>
      <description>thanks Stuart, good suggestion. So, top can calculate idle % because it scans the statistics of all processes to gather a lot of other informations it need. Now I don't know if it worth doing the same thing only to get the idle value...&lt;BR /&gt;&lt;BR /&gt;mmmmh... thinking...&lt;BR /&gt;&lt;BR /&gt;Ciao&lt;BR /&gt;Claudio&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Jul 2003 05:30:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017977#M75694</guid>
      <dc:creator>Claudio Cilloni</dc:creator>
      <dc:date>2003-07-09T05:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: CPU idle % in /proc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017978#M75695</link>
      <description>I got it! Stuart, you put me on the right track.&lt;BR /&gt;/proc/stat is my new friend!&lt;BR /&gt;man page helped. I didn't know the existence of the man page for /proc.&lt;BR /&gt;&lt;BR /&gt;Thanks to all!&lt;BR /&gt;Claudio</description>
      <pubDate>Wed, 09 Jul 2003 05:36:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cpu-idle-in-proc/m-p/3017978#M75695</guid>
      <dc:creator>Claudio Cilloni</dc:creator>
      <dc:date>2003-07-09T05:36:20Z</dc:date>
    </item>
  </channel>
</rss>

