[ECOS] Regd CPU IDLE TIME calculation.

Prabal Halder prabalhalder@yahoo.co.in
Wed Mar 26 09:17:00 GMT 2003


     We are using eCos1.3.1 for our project. But we
are having problem while calculatiing the CPU IDLE

   I am describing the problem.

System parameters are :

  Here we are proceding as follows.
                One of our application threads is
system_performance thread( say SYS_PERFORM_THREAD).
The executing function of this thread is

void func()
    cyg_thread_delay(1000);  // delay for 1000 tick.
    print the value of the total number of context    
     switches since the last execution of this 
} /* void func()*/
  That is,

    The SYS_PERFORM_THREAD thread only wakes up after
every 1000 tick and prints the value of the number of
context switches in system since the time this thread
last executed. The number of context switches is
calculated and saved by kernel in "thread_switches"
variable in scheduler class. We are using mlqueue
   The result we got :

Number of context switches : 174

Number of context switches : 156

Number of context switches : 155

Number of context switches : 156

Number of context switches : 163

Number of context switches : 166

    My questions are :

1. How many real time clock ticks ( 1 tick = 10msec) a
    thread gets in each time quantum?
2. If in each time quantum is equal to 1 tick, then
why    the number of context switches is so low and
where     the remaining time is elapsed?

3. Here the hardware clock tick value is 31250 after  
    which timer interrupt occurs. This 31250 hareware 
   tick is equal to how many tick? ( 1 tick = 10msec)?

   In the above measurement, we kept our system free  
from load.

Please relay.

Prabal Halder 

Missed your favourite TV serial last night? Try the new, Yahoo! TV.
       visit http://in.tv.yahoo.com

Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

More information about the Ecos-discuss mailing list