Strange timing results

Joel Sherrill joel.sherrill at
Thu May 18 17:01:33 UTC 2006

Alexandre Constantino wrote:

>I've obtained the strangest results on the tmtests (timing tests suites)
>on an i386 (AMD XP 2,4 GHz) with a pc386 BSP.
>For illustrations purposes, take the results for tm01:
>NOTE: all times are in microseconds
>rtems_semaphore_create                   926
>rtems_semaphore_delete                   618
>rtems_semaphore_obtain: available         92
>rtems_semaphore_obtain: not available     92
>rtems_semaphore_release                  180
>I have tested tm01 to tm10 and the time disparity is of the same
>magnitude. I have results from 2x to 15x higher than the ones mentioned
>on the i386.pdf for a 16 Mhz CPU!
The values reported by the timer driver may or may not be in 
microseconds.  On some
BSPs they are number of instructions, on others they are machine 
cycles.  On the pc386
BSP on a CPU with the TSC register, it is number of cycles from the TSC 

I think that makes the above times VERY VERY small.  I think that means 
that the
92 above is about 38 nanoseconds -- assuming I did the math right.

FWIW I don't trust Bochs or qemu yet for timing on the pc386.  I just 
don't know how
accurate their timing is.  Maybe someone can comment on this.

>Any clue on what might be wrong?
>Even stranger is the fact that the same executives where tested on bochs
>(*) in the very same computer, and the time results were 4x to 2x
>smaller than the ones i obtained while running the executives natively.
>(*) with a "tunned" IPS and clock settings - since i was able to get
>some "close" delay values
>Thank you for your time.
>Alexandre Constantino


More information about the users mailing list