<?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: calculating CPU time with the idle task in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159263#M1089</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If we don't know the frequency, is there a counter at same frequency that never stops?&amp;nbsp; This way we could have 2 values to calculate the CPU time %.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, i'll share any results if I get some.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 14 Mar 2009 04:05:34 GMT</pubDate>
    <dc:creator>francois_boucha</dc:creator>
    <dc:date>2009-03-14T04:05:34Z</dc:date>
    <item>
      <title>calculating CPU time with the idle task</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159260#M1086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question concerns the way to calculate the CPU time a program takes.&amp;nbsp; The idle task counter is here for that matter, but what is the frequency of the counter?&amp;nbsp; And what is a convenient way to calculate/output the CPU %&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 05:37:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159260#M1086</guid>
      <dc:creator>francois_boucha</dc:creator>
      <dc:date>2009-03-06T05:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: calculating CPU time with the idle task</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159261#M1087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Task Aware Debugger seems to have tools that will do this an much more.. Have not personally used it, but I have read up on it at &lt;A href="http://www.freescale.com/webapp/sps/site/homepage.jsp?code=MQX_HOME"&gt;www.freescale.com/mqx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a concept, you can access the KERNAL_DATA_STRUCT-&amp;gt;IDLE_LOOPX (there are 3 uint_32's with different resolutions you can use depending on the accuracy you want).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To work out the speed it ticks at, I would simply run a time slice thread that runs every X seconds and save the start ticks and end ticks (not processor ticks, the IDLE_LOOPX ticks). With that, you can calibrate a value for no load and work from there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should be very easy to work out the resolution of each timer. If you do it, will you share the results? Or maybe the MQX guys will tell us the resolution of the IDLE_LOOP counters for the dev boards...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dam, I could have just worked it out in the time this post this response...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 06:13:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159261#M1087</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2009-03-06T06:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: calculating CPU time with the idle task</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159262#M1088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To get CPU usage, today there is no tool to get percentage. The only way is to use idle task counter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The counter is there only to get information, if in 60 minutes it is at zero or at millions. It even is not implemented as thread-safe, so it can happen that the value is not correct (counter incrementing is not done in atomic instruction). But in more than 99.999% cases, you get the right value from the counter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you rely on the counter value and you want to get time or percentage information, there is not any easy workaround to get it. That's because counter is running without any synchronization. The speed of the counter is determined only by dissassembling _mqx_idle_task code and to find out how many instruction does it take to increment by one. Note that number of instructions depends on your compiler settings. Then, you can compute how much time does it take to execute these instructions.&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by JuroV on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-03-06&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;09:50 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by JuroV on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-03-06&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;09:58 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 16:39:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159262#M1088</guid>
      <dc:creator>JuroV</dc:creator>
      <dc:date>2009-03-06T16:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: calculating CPU time with the idle task</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159263#M1089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If we don't know the frequency, is there a counter at same frequency that never stops?&amp;nbsp; This way we could have 2 values to calculate the CPU time %.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, i'll share any results if I get some.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2009 04:05:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159263#M1089</guid>
      <dc:creator>francois_boucha</dc:creator>
      <dc:date>2009-03-14T04:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: calculating CPU time with the idle task</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159264#M1090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;CarlFST60L wrote:&lt;BR /&gt;&lt;BR /&gt;To work out the speed it ticks at, I would simply run a time slice thread that runs every X seconds and save the start ticks and end ticks (not processor ticks, the IDLE_LOOPX ticks). With that, you can calibrate a value for no load and work from there.&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yeah, I think it's a good way to procede.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll let you know if I got something.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2009 04:10:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159264#M1090</guid>
      <dc:creator>francois_boucha</dc:creator>
      <dc:date>2009-03-14T04:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: calculating CPU time with the idle task</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159265#M1091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Just note that for specific targets (Ext. MRAM or Int. FLASH) you get different results- significantly different.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 15:26:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159265#M1091</guid>
      <dc:creator>JuroV</dc:creator>
      <dc:date>2009-03-19T15:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: calculating CPU time with the idle task</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159266#M1092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, this is because the MRAM is connected through the external bus and it has slower access times so it requires a wait state cycle to be inserted in the bus transfer.&amp;nbsp; It's a performance tradeoff that is made in order to get a lot of extra non-volitile byte-writeable memory.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The internal Flash however is on the internal bus and its interleaved so it's very efficient. It can read&amp;nbsp;a longword in 1 or 2 cycles.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2009 00:43:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159266#M1092</guid>
      <dc:creator>macl</dc:creator>
      <dc:date>2009-03-20T00:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: calculating CPU time with the idle task</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159267#M1093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did anyone ever write a module to calculte CPU load?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 05:46:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/calculating-CPU-time-with-the-idle-task/m-p/159267#M1093</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2009-04-28T05:46:03Z</dc:date>
    </item>
  </channel>
</rss>

