This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: idle thread
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- To: Andrea Acquaviva <aacquaviva at deis dot unibo dot it>
- Cc: "ecos-discuss at sources dot redhat dot com" <ecos-discuss at sources dot redhat dot com>
- Date: Tue, 22 Jan 2002 14:33:41 +0100
- Subject: Re: [ECOS]idle thread
- References: <3C4D5834.37033644@deis.unibo.it>
On Tue, Jan 22, 2002 at 01:16:52PM +0100, Andrea Acquaviva wrote:
> Hi,
> I would like to monitor the CPU activity while running an ecos
> application.
> Is the idle_thread_loop variable in thread.cxx a correct indicator of
> the CPU utilization?
>
> More precisely, is this variable incremented each time a thread stalls
> waiting for a locked device?
Look back in the archive about 18 months. There is a post where i gave
some code to monitor the CPU usage.
There is a counter in the idle thread which is incremented every
iteration of the endless loop. I calibrate how much the counter goes
up for a completely idle system and then use that to determine the
load at other times. It assumes your processor is not doing any clever
power saving tricks etc.
Andrew