[ECOS] Idle thread exit ???hook???

Andrew Lunn andrew@lunn.ch
Wed May 13 12:53:00 GMT 2009


On Wed, May 13, 2009 at 05:40:56AM -0700, panduroDk wrote:
> 
> Hi 
> 
> I???m trying to measure my CPU load by using a GPIO pin and a voltmeter, and
> now I???m looking for some kind of Idle thread exit ???hook??? but I can???t seem to
> find it, dose eCos provide such a functionality. The plan Is to set the GPIO
> high in the idle thread, and set low when exited the idle thread.

Sorry, it does not work this way. The idle thread is a normal thread,
but with very, very low priority. Its low priority means it gets
preempted when there is a higher priority thread which is runable. It
is not entered and exited. 

Probably the best you can do is replace the idle thread with your own
thread which modulates a GPIO. That is it toggles it endlessly
high/low/high/low. When it is toggling you know the CPU is idle. When
it is steady state, it is busy.

What you might also find interesting is packages/services/cpuload

     Andrew

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



More information about the Ecos-discuss mailing list