I removed rdtsc because it is wildly inaccurate in modern systems. In
olden days when CPU clocks were fixed, and rdtsc timestamps could be used
to get a relatively accurate timestamp. Today almost all x86 systems have
SpeedStep (or PowerNow on AMD) which will vary the CPU clock based on
load. This keeps your system cool and your power bill low. For example, my
Linux system varies between 2.4 and 3.6 GHz. Since rdtsc reads the number
of clock cycles since power-on, it has become wildly inaccurate on systems
made in the last 10 years or so.

As to your second question, I'm not certain what you mean by "sub-timer
resolution". I suspect you want accuracy, or maybe high-resolution. Many
timers that are used in Windows are pretty bad. Either they have low
resolution, low accuracy or are very expensive. The default timer
(equivalent of "Timer Method 12" in the report below) is relatively fast
and is as accurate as the system clock. But it only has 1 msec (1/1000
second) accuracy. So, resolution on this clock is low, but it is accurate.
Even if you are using "-t 0.01", it must be good enough.

FYI, rdtsc is the equivalent of "Timer Method 4" below. It is very fast
and has high resolution. But it can cause over 30% errors in tcpreplay
reports. I don't think it is worthwhile using it.

This is the output of a program I wrote to test out several different
clocks in Windows. It is mostly for my own research, but someday someone
should write a paper on this. Luckily Linux and OS X "gettimeofday" method
is fast, accurate and has a 1 usec (1/1000000 sec) resolution. Linux also
has has "gettimeofday_ns" which goes down to 1 nsec (1/1000000000 second).
Unfortunately, Windows doesn't have any timers that work nearly this well.

Fred
---------------------- cut ---------------------

QueryPerformanceFrequency() result: 10000000

Clock Rate Method 1: processorFrequencyHz ...
100 iterations in 0.127450 sec (1275 usec/instruction)
Avg: 2600.468Mhz Variance: 58.270Mhz Max: 2604.347Mhz Min: 2546.077Mhz

Clock Rate Method 2: processorFrequencyHzTuned ...
100 iterations in 0.198986 sec (1990 usec/instruction)
Avg: 2600.130Mhz Variance: 0.636Mhz Max: 2600.474Mhz Min: 2599.838Mhz

Clock Rate Method 3: processorFrequencyHzTuned with CPUID ...
100 iterations in 0.199535 sec (1995 usec/instruction)
Avg: 2601.978Mhz Variance: 174.844Mhz Max: 2773.054Mhz Min: 2598.210Mhz

Timer Method 1: QueryPerformanceCounter...
5000000 iterations in 0.870075 sec (0.174015 usec/instruction)
5000000 unique timestamps (100)%

Timer Method 2: ACE_High_Res_Timer start() and stop() ...
5000000 iterations in 1.010617 sec (0.202123 usec/instruction)
980731 unique timestamps (19)%


Timer Method 3: ACE_High_Res_Timer::gettimeofday_hr() ...
5000000 iterations in 1.229822 sec (0.245964 usec/instruction)
4999995 unique timestamps (99)%


Timer Method 4: asmGetTime ...
5000000 iterations in 0.040533 sec (0.008107 usec/instruction)
5000000 unique timestamps (100)%


Timer Method 5: asmGetTimeWithCpuId ...
5000000 iterations in 2.114848 sec (0.422970 usec/instruction)
5000000 unique timestamps (100)%


Timer Method 6: CPU_COUNT ...
5000000 iterations in 2.125668 sec (0.425134 usec/instruction)
5000000 unique timestamps (100)%


Timer Method 7: PROFILE(index) ...
5000000 iterations in 2.144431 sec (0.428886 usec/instruction)
5000000 unique timestamps (100)%


Timer Method 8: PROFILE_NEXT ...
5000000 iterations in 2.243161 sec (0.448632 usec/instruction)
4999000 unique timestamps (99)%


Timer Method 9: timeGetTime...
5000000 iterations in 0.060501 sec (0.012100 usec/instruction)
62 unique timestamps (0)%

testing granularity of timeGetTime()...
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

testing granularity of Sleep(1)...
  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Timer Method 10: timeGetSystemTime() TIME_MS...
5000000 iterations in 0.074838 sec (0.014968 usec/instruction)
76 unique timestamps (0)%
Reported time from timeGetSystemTime() 25411489 msec

Timer Method 11: GetSystemTimeAsFileTime() (low resolution)...
5000000 iterations in 0.024528 sec (0.004906 usec/instruction)
25 unique timestamps (0)%


Timer Method 12: ACE_OS::gettimeofday() (low resolution)...
5000000 iterations in 0.142652 sec (0.028530 usec/instruction)
144 unique timestamps (0)%



On 2014-03-19, 2:26 PM, "Charles Milutinovic" <[email protected]> wrote:

>In tcpreplay v4 the rdtsc timer option was removed from tcpreplay.  I
>have two questions about it:
>
>1.  What was the motivation?  I am having trouble tracking down any
>discussion on the mailing lists or the changelogs.
>
>2.  For windows users who use tcpreplay via cygwin, is there any way
>to get good sub-timer-resolution playback in v4?
>
>--------------------------------------------------------------------------
>----
>Learn Graph Databases - Download FREE O'Reilly Book
>"Graph Databases" is the definitive new guide to graph databases and their
>applications. Written by three acclaimed leaders in the field,
>this first edition is now available. Download your free book today!
>http://p.sf.net/sfu/13534_NeoTech
>_______________________________________________
>Tcpreplay-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
>Support Information: http://tcpreplay.synfin.net/trac/wiki/Support


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Tcpreplay-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
Support Information: http://tcpreplay.synfin.net/trac/wiki/Support

Reply via email to