Home | History | Annotate | Download | only in monotonic_time
      1 NAME = 'monotonic_time'
      2 AUTHOR = 'Michael Davidson <md (a] google.com>'
      3 TIME = 'MEDIUM'
      4 TEST_CLASS = 'Kernel'
      5 TEST_CATEGORY = 'Functional'
      6 TEST_TYPE = 'client'
      7 DOC = """
      8 monotonic_time checks various time interfaces:
      9   gettimeofday()
     10   clock_gettime(CLOCK_MONTONIC)
     11   TSC
     12 for monotonicity.
     13 
     14 Based on time-warp-test.c by Ingo Molnar.
     15 """
     16 
     17 #
     18 # Test gettimeofday(), TSC, and clock_gettime(CLOCK_MONOTONIC)
     19 #
     20 # Tests run for 'duration' seconds and check that the selected
     21 # time interface does not go backwards by more than 'threshold'.
     22 #
     23 # Note that the threshold value has the same resolution as the
     24 # clock source:
     25 #   gettimeofday()                 - microseconds
     26 #   clock_gettime(CLOCK_MONOTONIC) - nanoseconds
     27 #   TSC                            - CPU clock cycles
     28 #
     29 #
     30 job.run_test('monotonic_time', tag='gtod',  test_type='gtod',
     31              duration=300, threshold=0)
     32 
     33 job.run_test('monotonic_time', tag='clock', test_type='clock',
     34              duration=300, threshold=0)
     35 
     36 job.run_test('monotonic_time', tag='tsc',   test_type='tsc',
     37              duration=300, threshold=0)
     38