RAKOTOSALAMA, Nirilanto wrote:
>>> Hi Everyone
>>>
>>> I'm programming a little client-server application to test 
>> network performances with xenomai 2.3.1 and rtnet 0.9.9.
>>> The 2 programs are based on the rtnet frag-ip example.
>>> The perdiodic scenario is :
>>> - RSG program sends a datagram to the REMOTE program which 
>> was waiting.
>>> - REMOTE sends a response to RSG.
>>> - RSG simulates a CPU performing period using rt_timer_spin.
>>> This cycle should take less than 2.5ms.
>>>
>>> I observe strange time measurement :
>>>
>>> For example when I want to run during 10 secs : 1000 cycles of 10 ms
>>> The program calculates a time between 16 and 17 secs (using 
>> rt_timer_tsc)
>>> But the effective elapsed time (i kept time with a chrono 
>> :-s ) is around 10secs
>>
>> Before I start looking at details, please check the 
>> consistency of your
>> local Xenomai clock with this brand new tool:
>>
>> http://svn.gna.org/viewcvs/xenomai/trunk/src/testsuite/clockte
>> st/clocktest.c?view=markup
>> (you don't have to switch to trunk, just grab the source and compile
>> manually)
> 
> Ok I test it.
> 
>> In case the Linux clock is not screwed up as well, you can check for
>> potential drifts and cross-cpu wraps that way.
> 
> I have tested the clocktest on the 2 boxes (P4 1.7Ghz and P4 Xeon 1.7Ghz)
> (Note that on the 2 boxes, there's this 60% constant factor between effective 
> and calculated time.
> 
> on P4 :
> == Tested clock: 0 (CLOCK_REALTIME)
> CPU      ToD offset [us] ToD drift [us/s]      warps max delta [us]
> --- -------------------- ---------------- ---------- --------------
>   0            -592770.4           -0.210          0            0.0
> the drift stays between -0.200us and -0.210us
> 
> on P4 Xeon :
> == Tested clock: 0 (CLOCK_REALTIME)
> CPU      ToD offset [us] ToD drift [us/s]      warps max delta [us]
> --- -------------------- ---------------- ---------- --------------
>   0             -17620.8           -0.053          0            0.0
>   1             -17620.8           -0.055          0            0.0
> the drift stays between -0.050us and -0.060us

Looks sane.

> 
> Is it normal ? And sorry, but I don't understand what do you mean about 
> "cross-cpu wraps that way" ?

That would mean that the TSCs of the SMP box are not in sync and may
cause jumps when migrating between the CPUs or comparing time stamps of
different origins.

Anyway, you issue requires a closer look at the code:

...
> rt_timer_ticks2ns(rt_timer_tsc())

Are you sure that ticks == tsc? RTFM :->


Jan

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
RTnet-users mailing list
RTnet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rtnet-users

Reply via email to