[okl4-developer] How to measure CPU utilization

Geoffrey Lee glee at ok-labs.com
Tue Jul 22 13:24:04 EST 2008


On Fri, Jul 18, 2008 at 03:13:44PM +0800, kashin Lin wrote:
> 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();


You can compile with enable_profiling=True to get profiling dumps
from the kernel debugger.

	-gl

> 
> ...
> 
> end = read_counter();
> 
> length = end - start;
> 
> any suggestions is welcome. thanks in advance.
> 
> best,
> 
> kashin

> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer


-- 




More information about the Developer mailing list