This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Regd CPU IDLE TIME calculation.
- From: Prabal Halder <prabalhalder at yahoo dot co dot in>
- To: ecos-discuss at sources dot redhat dot com
- Cc: andrew dot lunn at ascom dot ch
- Date: Wed, 26 Mar 2003 09:14:56 +0000 (GMT)
- Subject: [ECOS] Regd CPU IDLE TIME calculation.
Sir,
We are using eCos1.3.1 for our project. But we
are having problem while calculatiing the CPU IDLE
time.
I am describing the problem.
System parameters are :
CYGNUM_KERNEL_COUNTERS_RTC_PERIOD = 31250
CYGNUM_HAL_RTC_PERIOD = 31250
CYGNUM_HAL_RTC_DENOMINATOR = 100
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()
{
while(1)
{
cyg_thread_delay(1000); // delay for 1000 tick.
print the value of the total number of context
switches since the last execution of this
thread.
}
} /* 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
scheduler.
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