This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to read the IDL_F_busy function results

Hi

I understand that the CPU load is calculated in IDL_F_busy function , is there some way to see , the results of this calcultion ? I would like to use them for my own display of CPU load

 

Thanks

 

  • You must be using BIOS 5, correct?  In that case, CPU load calculations are made using an STS object called IDL_D_busyObj.  Each pass through IDL_F_busy() makes a call to CLK_gethtime(), negating the value returned, and accumulating the difference (using STS_delta).  Then the STS object will contain these values:

        num:  the number of times IDL_F_busy() was called
        acc:   - (total number of timer ticks)
        max:  - (minimum number of timer ticks between calls to IDL_F_busy())

    The reason for negating the time before accumulating the difference, is so we can get the minimum time through the idle loop. The time spent in idle would be approximately:

        -max * num

    and the CPU load would be:

         (total time - idle time) / total time  = [-acc - (-max * num)] / (-acc)

    You would need to let the program run until IDL_D_busyObj.acc reaches your desired CPU load averaging window, or accumulate the results somewhere else (e.g, a host with 64-bit precision), and clear the IDL_D_busyObj so it can continue to accumulate.

    Best regards,

        Janet

  • Hi

    Thanks for fast response

    I am working with DSP BIOS 5.31 , code generation tools 6.018 and ccs 5.4

    I  tried to implement your solution , and still have few problems.

    I  call to the CPU load measurement function  each 1 sec from PRD .  I see  that the num and acc  values of the IDL_busyObj  always the same , and not depended on measurement period (I tried to  call CPU load, each 100 mili, 500 mili , 1 sec .. etc) . At the of measurement function , I call to

    SET_reset(IDL_busyObj  )  , to  clear the statistic object

    The max value of the IDL_busyObj   , its always  equal to the same number    -2147483648 

    May be, the statistic object does not work , for some reason?  I have RTA enabled in my project .  I never succeed to see the CPU load graph provided by Code Composer RTA tools

     Best Regards

    Genady

     

     

     

  • Hi Genady,

    It sounds like the IDL_busyObj STS object is not being used.  Do you have the IDL object in your configuration that calls the IDL_F_busy function (I think it's called IDL_cpuLoad)?  This function is run by the IDL task and calls STS_delta() on IDL_busyObj to accumulate time.

    Best regards,

        Janet

  • Hi Janet

    I see the  IDL_busyObj   sts in map file , and  I succeeded to compile and link  my project  when I use it , its mean that the IDL_busyObj    is exist , the RTA is enabled too in TCF file.

    I will try to measure CPU load  another way , I can add function to idle loop , and add my own STS to this function

     Best regards

     

    Genady