public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] task switch hook
@ 2004-09-17  3:36 David Brennan
  2004-09-17  7:26 ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: David Brennan @ 2004-09-17  3:36 UTC (permalink / raw)
  To: eCos Discuss

Within our application we have a desire to run a small piece of code on 
every task switch. Is there any mechanism built in to eCos to allow a 
user written routine to run on task switch? The application we are 
porting is from VxWorks and they provided one. I know we have access to 
the eCos source, and could potentially put it in the kernel itself. But 
we would like to try and use a built in feature if it exists.

Thanks
David

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] task switch hook
  2004-09-17  3:36 [ECOS] task switch hook David Brennan
@ 2004-09-17  7:26 ` Andrew Lunn
  2004-09-18 19:01   ` David Brennan
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2004-09-17  7:26 UTC (permalink / raw)
  To: David Brennan; +Cc: eCos Discuss

On Thu, Sep 16, 2004 at 08:35:59PM -0700, David Brennan wrote:
> Within our application we have a desire to run a small piece of code on 
> every task switch. Is there any mechanism built in to eCos to allow a 
> user written routine to run on task switch? The application we are 
> porting is from VxWorks and they provided one. I know we have access to 
> the eCos source, and could potentially put it in the kernel itself. But 
> we would like to try and use a built in feature if it exists.

I don't remember seeing such a huck in the documentation or the code
itself, but its admitedly not me area of expertise. I think you will
need to modify the code.

What are you trying to do? Some sort of process accounting or tracking
threads for debugging purposes. eCos does have a tracing mechanism.

        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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] task switch hook
  2004-09-17  7:26 ` Andrew Lunn
@ 2004-09-18 19:01   ` David Brennan
  2004-09-19 14:32     ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: David Brennan @ 2004-09-18 19:01 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: eCos Discuss

Actually we are trying to calculate idle time. I know eCos has a 
mechanism for doing that but here is the way our setup functions.
We run about 10 task most of which are time based (every 10ms to every 
250ms). Our "idle" thread runs once they are all blocked and does 
various non-time critical functions. (It does a health check of various 
hardware, computes the CRC of the .text and .rodata spaces, walks 
through the heap checking for corruption, etc.) Since it runs 
"constantly" there is no way to let the eCos idle task run. (And the 
processor utilization of our idle thread should not be counted). So I 
would like to use a high speed timer to check the percentage of time the 
my idle task is running. The method I am trying to use is the same one 
we used for VxWorks. But I would be open to suggestions if you have any.

Thanks
David

Andrew Lunn wrote:

>On Thu, Sep 16, 2004 at 08:35:59PM -0700, David Brennan wrote:
>  
>
>>Within our application we have a desire to run a small piece of code on 
>>every task switch. Is there any mechanism built in to eCos to allow a 
>>user written routine to run on task switch? The application we are 
>>porting is from VxWorks and they provided one. I know we have access to 
>>the eCos source, and could potentially put it in the kernel itself. But 
>>we would like to try and use a built in feature if it exists.
>>    
>>
>
>I don't remember seeing such a huck in the documentation or the code
>itself, but its admitedly not me area of expertise. I think you will
>need to modify the code.
>
>What are you trying to do? Some sort of process accounting or tracking
>threads for debugging purposes. eCos does have a tracing mechanism.
>
>        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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] task switch hook
  2004-09-18 19:01   ` David Brennan
@ 2004-09-19 14:32     ` Andrew Lunn
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2004-09-19 14:32 UTC (permalink / raw)
  To: David Brennan; +Cc: Andrew Lunn, eCos Discuss

On Sat, Sep 18, 2004 at 11:54:47AM -0700, David Brennan wrote:
> Actually we are trying to calculate idle time. I know eCos has a 
> mechanism for doing that but here is the way our setup functions.
> We run about 10 task most of which are time based (every 10ms to every 
> 250ms). Our "idle" thread runs once they are all blocked and does 
> various non-time critical functions. (It does a health check of various 
> hardware, computes the CRC of the .text and .rodata spaces, walks 
> through the heap checking for corruption, etc.) Since it runs 
> "constantly" there is no way to let the eCos idle task run. (And the 
> processor utilization of our idle thread should not be counted). So I 
> would like to use a high speed timer to check the percentage of time the 
> my idle task is running. The method I am trying to use is the same one 
> we used for VxWorks. But I would be open to suggestions if you have any.

Nothing springs to mind. I think you will have to add new code.

        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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-09-19 14:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-17  3:36 [ECOS] task switch hook David Brennan
2004-09-17  7:26 ` Andrew Lunn
2004-09-18 19:01   ` David Brennan
2004-09-19 14:32     ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).