This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: CPU usage by threads


Hi again,

I dont get exactly how you mean in the below text. Do you mean that i
shall create a periodic alarm inside each thread and let it write the
thread ID into an array or something and then have some other thread
reading it and presenting it?

Or can i use just ONE interrupt that do all this? If so then i need to
know that the interrupt is run within the disrupted threads' context and
not some special interrupt thread.

I would approtiate it very much it you could clearify this for me.

Regards, Daniel

> Anyhow, if you just want to do cpu usage by task, I'd 
> recommend making a 
> periodic interrupt and then calling CygThread::self () to 
> figure out which 
> thread was running at the time, and just keep counts per 
> thread and do 
> division.  This will impact your system VERY little.  Have a 
> low priority 
> thread periodically print the values and you can get a pretty 
> good idea of 
> where you spend most of your time.   For best results, you 
> want an interrupt 
> with a system tick that cannot be divided into the system 
> tick.  I've heard 
> that one of the best profilers uses a 97 Hz clock with a 
> system clock of 100 
> Hz (eCos' default and most Unix's too).
> 
> Our tool profiles the code, so it's probably overkill.  It 
> tells you where you 
> spend most of your time, what task you were in and the call 
> stack as well.
> 
> Later,
> -Rich
> 
> > Regards, Daniel
> >
> > > -----Original Message-----
> > > From: NavEcos [mailto:ecos@navosha.com]
> > > Sent: den 24 oktober 2002 23:11
> > > To: Daniel Lidsten
> > > Subject: Re: [ECOS] CPU usage by threads
> > >
> > > On Thursday 24 October 2002 04:29 am, you wrote:
> > > > Hi,
> > > >
> > > > I just took a peek at your site regarding the profiling
> > >
> > > tool it looks
> > >
> > > > very intresting. Do you have it for windows platform? How
> > >
> > > much does it
> > >
> > > > cost? Do you have any more information about it - some manual?
> > >
> > > Well, we're just tooling up.  That individual tool (don't have a 
> > > heart attack) is like $5K, but that's for a site license, as many
> > > developers as you want
> > > can use it for your project.  We are a small company, we 
> need $.  You
> > > wouldn't be able to develop such a tool as cheaply.
> > >
> > > We're also bringing up a memory profiler as well, that 
> will help you 
> > > eliminate memory leaks.
> > >
> > > We have two other tools under development as well but they are 
> > > several weeks away from completion to no real point in mentioning 
> > > them yet.
> > >
> > > -Rich
> > >
> > > > Regards, Daniel Lidsten
> > > >
> > > > > -----Original Message-----
> > > > > From: NavEcos [mailto:ecos@navosha.com]
> > > > > Sent: den 24 oktober 2002 10:35
> > > > > To: Daniel Lidsten
> > > > > Subject: Re: [ECOS] CPU usage by threads
> > > > >
> > > > > On Thursday 24 October 2002 12:11 am, Daniel Lidsten wrote:
> > > > > > Hi,
> > > > > >
> > > > > > I would like to know how much CPU time each thread in the
> > > > >
> > > > > system make
> > > > >
> > > > > > use of but i currently don't see any easy way of doing
> > > > >
> > > > > this? Does it
> > > > >
> > > > > > exists any such feature? If not, maybe it is possible to
> > > > >
> > > > > add some hook
> > > > >
> > > > > > functions that gets called by the kernel each time it
> > > > >
> > > > > performs a task
> > > > >
> > > > > > switch. These functions can then perform some logging,
> > >
> > > or just do
> > >
> > > > > > nothing at all if they are not used.
> > > > > >
> > > > > > Regards, Daniel Lidsten
> > > > >
> > > > > We provide a tool that will do this:
> > > >
> > > > http://ecos.dynu.com/~ecos3/prof.html
> > > >
> > > > But it's commercial.
> > > >
> > > > -Rich
> 
> 

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]