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


On Thu, Oct 24, 2002 at 09:11:10AM +0200, 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

It is possible, but needs a bit of work on your side. You need to turn
on instrumentation and configure it correctly. It will then log a
instrumentation event every time a thread switch occurs. The event has
a time stamp. From this you can work out how long each thread ran
for. ISR and DSR time will be counted inside which every thread was
running at the time. If you need to exclude that, it may be possible,
but again its more work.

Using instrumentation is in the documentation. You will also find a
little tool i wrote for decoding the binary data to something a little
easier to read by humans in packages/kernel/current/host/instr

       Andrew

-- 
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]