This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: tm_basic fixes
- From: GONZALEZ Laurent <laurent dot gonzalez at trango-systems dot com>
- To: ecos-patches at sources dot redhat dot com
- Date: Tue, 1 Mar 2005 16:02:04 +0100
- Subject: Re: tm_basic fixes
- Organization: Trango Systems
- References: <20050224151306.0f29370a@localhost><1109685952.14695.82.camel@hermes>
On Tue, 01 Mar 2005 07:05:52 -0700
Gary Thomas <gary@mlbassoc.com> wrote:
> On Thu, 2005-02-24 at 15:13 +0100, GONZALEZ Laurent wrote:
> > hi list,
> >
> > this patch removes an hardwired value to compute ns_per_system_clock
> > variable and also restore the meaning of this variable (that should
> > otherwise be renamed to us_per_system_clock). The test is now compliant
> > with the definition of CYGNUM_HAL_RTC_NUMERATOR and CYGNUM_HAL_RTC_DENOMINATOR.
> >
> > Moreover, it fixes the computation of clock interrupt cost. That's a
> > good news for eCos because this cost is currently over-estimated.
> >
>
> Can you please explain your changes a bit more?
>
> I agree with the change for CYGNUM_HAL_RTC_NUMERATOR, but the other
> two changes seem to cancel each other out. When I tested this,
> before & after the patch, I got identical results so I'm a little
> interested in hearing more.
>
First of all, it's good to hear that your figures did not change with the patch, it is intended to behave like that except for one of them: "Clock interrupt took xxx microseconds (xxx raw clock ticks)".
'tv1' is the mean value of tv[i]*1000, thus this value is scaled by a factor 1000. On the other hand, 'overhead' (from 'tv0') is not scaled, thus the substraction "tv1 -= overhead" does not compute the value we are looking for. See "show_times_detail" function where 'overhead' is substracted from 'delta' **before** scaling 'delta' 1000 times.
'ns_per_system_clock' is currently computed with an hardwired value instead of using CYGNUM_HAL_RTC_NUMERATOR. Moreover this value is 1/1000 of the value generally defined for CYGNUM_HAL_RTC_NUMERATOR. In other word 'ns_per_system_clock' is currently used in tm_basic code as if it were 'us_per_system_clock' !! Have a look at the following line:
diag_printf("\nTiming complete - %d ms total\n\n", (int)((ticks*ns_per_system_clock)/1000));
Ticks is not scaled and we got ms from ns/1000 !! There is something wrong, isn't it ?
regards.
--
GONZALEZ Laurent
------------------------------------
Real-Time OS Team Leader
TRANGO Systems - Groupe ELSYS Design
74, avenue des Martyrs
38000 Grenoble
Tel: 33 (0)4 76 12 28 44
Fax: 33 (0)4 76 12 28 49
http://www.trango-systems.com