[okl4-developer] How to measure CPU utilization

kashin Lin kashin08 at gmail.com
Fri Jul 18 17:13:44 EST 2008


Hi,

i write a iguana application in the iguana/example directory. the
application only executes in a few secs and

will be blocked(yield CPU) and resume when execution. i want to measure the
CPU utilization when running

the application (no OKLinux).

i remember there is an idle thread in okl4 which will be selected if CPU is
idle. so my first idea

is to get the "total idle thread execution time" when in application
execution meantime (a few secs).

then the CPU utilization will be:       1 -  "total idle thread exec time" /
"application execution meantime"

1. but how to get the idle thread execution time?

2. similarly, how can i measure "how long does the application really be
selected to run in the meantime of execution?"

Does OKL4/Iguana do any statistics or have any function can help me know
those information?

p.s. in my platform, there is a harware time can use to measure the time ex:

start = read_counter();

...

end = read_counter();

length = end - start;

any suggestions is welcome. thanks in advance.

best,

kashin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.okl4.org/pipermail/developer/attachments/20080718/fba9b654/attachment.htm 


More information about the Developer mailing list