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: Context-switch time


On Thu, Aug 21, 2003 at 10:02:27PM +0200, Michele Portolan wrote:
> Hello everyone,
> I am trying to evaluate "a priori" the time needed by eCos to perfom a
> context switch in terms of number of instructions/clk_cycles  to have some
> preliminary statistics on real-time behaviour. Have anyone ever did it?
> As long as I look at context.S everything is ok, it is directly assembler (I
> use the LEON port), but when I look in sched.cxx I get lost. It is C++ and I
> have no idea of gcc performances in terms of C lines->assembler lines
> Any idea?

tm_basic has lots of statistics about things like this. See if you can
find a run of tm_basic on the LEON.

One thing to note, your calculation are pretty useless, unless you
disable the cache. What is in the cache will have a large effect on
context switch times. If you have just performed a context switch when
you perform a second one, nearly all the data/instructions it needs
will be in cache and it can run near CPU speed. If there is nothing
useful in cache, the CPU will spend a lot of time doing nothing while
instructions and data are fetched from main memory into cache and then
to the processor. 

   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]