Adi Sudewa wrote:
> 
> On Fri, 9 Jun 2000, Stuart Hughes wrote:
> > > Suppose I have this procedure :
> > >
> > >         void do_it()
> > >         {
> > >                 complex_calculation();
> > >                 other_complex_calculation();
> > >         }
> > >
> > > and this highest priority rtl thread(ignore syntax errors):
> > >
> > >         pthread_make_periodic(PERIOD);
> > >         while (1) {
> > >                 do_it();
> > >                 pthread_wait();
> > >         }
> > >
> > > (2) How to measure the worst-case execution time of do_it() ?
> > >    Can I just run it 100 times, do measurement,  and pick the greatest
> > > value ?
> > >
> >
> > Set the period to be much longer than expected (so you won't lock-up).
> > Take the time before and after do_it() and then calculate the worst
> > case.  This can then be output with printk (every once in a while).  If
> > you then run it, you can load the system and observe the results.
> 
> But if I port my application into another machine, then I must redo the
> measurement.
> 

Yes & no.  You can make an estimate of the time for the new machine by
comparing clock speeds.  This is a very rough calculation, but on the
same architecture machine should give an idea of what to expect.  


> > To know whether you got the absolute worst case is difficult, but you
> > should get a close idea of it from this test.
> 
> Can I do statistic method to guess WCET (worst case execution time)
> from , say, 1000 measurement ?
>

You can run 1000 measurements and take the worst.  Of course the results
will depend on test environment (I/O activity etc)

Regards, Stuart
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to