Partager via


Compare All Three Timers Drift - Busy Sleep and OS Sleep (Compact 2013)

3/26/2014

The Compare All Three Timers Drift - Busy Sleep and OS Sleep tests check for drift, timing irregularities and other timer problems on the three clocks (GetTickCount, High-Performance, and Real-Time Clock) by comparing them with each other. These tests periodically take data samples from the clocks. The system is kept in different states in the time period between samples, allowing identification of drift introduced by specific functions.

A good way to use these Three Timer Drift tests is to run them to confirm the clocks do not drift relative to each other, and to run at least one of the individual drift tests to confirm that the clock does not drift relative to outside sources. To measure drift on individual clocks, use the Wall Clock Timer tests. These allow one to compare a given clock against a stop watch or any other external clock source. Ideally, one would compare the RTC, since this clock is not expected to drift with respect to an outside clock.

The RTC and GTC also have an automated drift test that compares them to an NTP server. If you have access to an NTP server, you can take advantage of this test; see RTC and GTC to NTP Drift Test.

If there is a known drift between any two clocks on the platform which is by design, the test can be given drift bounds so that it passes when the drift is within the specified bounds.

Each subtest runs by default for 3 hours.

Test Prerequisites

The following table shows the software requirements for the test.

Requirements

Description

GetTickCount Clock

The clock that corresponds to the GetTickCount function

High-Performance Counter

The clock that corresponds to the QueryPerformanceCounter function

Real-Time Clock (RTC)

The clock that corresponds to the GetSystemTime function

The following table shows the software requirements for the test.

Requirements

Description

Tux.exe

Tux test harness

Kato.dll

Kato logging engine

OalTestTimers.dll

Library containing the timer tests

Subtests

The table below lists the subtests included in this test.

SubTest ID

Description

3010

Compare All Three - Busy Sleep

Confirms that the clocks do not drift relative to each other.

The test periodically takes data samples from each of the three clocks and these samples are compared to each other for drift. The default time between the samples is 2 minutes. This test remains in a busy while loop that mimics sleep for the whole 2 minutes. This keeps the processor busy throughout the test and OEMIdle is never called.

3020

Compare All Three - OS Sleep

Confirms that the clocks do not drift relative to each other.

The test periodically takes data samples from each of the three clocks and these samples are compared to each other for drift. The default time between the samples is 2 minutes. This test calls the standard Sleep function available in the OS to sleep for the whole 2 minutes. The OS is expected to call OEMIdle during this test and OEMIdle will sleep for the maximum possible time.

Setting Up the Test

This test has no additional requirements.

Running the Test

The Compare All Three Timers Drift Test - Busy Sleep and OS Sleep Test performs the following on default execution: tux.exe -o -d oaltesttimers.dll -x 3010,3020 -c "-cmdf OALStandardDriftTestCmdLines.txt"

You can modify the test by editing the command line for the test. To specify one or more of the following optional command line parameters for this test, use the -c command line parameter, which causes Tux to pass the specified string into the test module.

The following table shows the optional command line parameters for the test.

Command line parameter

Description

-driftRunTime <time>

Specifies the run time for the test. The default run time for each test is 3 hours. The value time is considered to be in seconds unless the time modifiers listed below are used.

-driftSampleSize <time>

Specifies the time between samples. The default is 2 minutes between samples. The value time is considered to be in seconds unless the time modifiers listed below are used.

-testname <bound numF numS>

Specifies the drift bounds when comparing the three different clocks for drift. '-testName' is one of -busySleep or -osSleep. 'bound' is one of GtcToRtc, GtcToHiPerf, HiPerfToRtc. 'numF' and 'numS' give the 'faster' and 'slower' bounds for the given comparison, respectively. The 'numF' and 'numS' are multiplied with the expected values to define the pass/fail range for the test. The default bounds for all tests are zero.

-cmdf <filename>

Read <filename> for bounds information. See OALStandardDriftTestCmdLines.txt for an example.

* s means seconds (12s = 12 seconds)

* m means minutes (12m = 12 minutes)

* h means hours (12h = 12 hours)

* d means days (12d = 12 days)

For example, the default run time for each sub-test is 3 hours and the samples are taken every 2 minutes. These can be changed using -c "-driftRunTime time1 -driftSampleSize time2", where time1 is the run time for the test and time2 is the time between samples, respectively.

Note

If a tested clock does not run accurately, the duration of a test case may differ from expected.

Verifying the Test

When the test completes running, verify that "PASS" appears in the test log for all sub-tests.

Troubleshooting the Test

Determine the point of failure and record the exact error message. Check that the setup steps were followed and that all pre-requisites were met. If the source code is available, examine the point of failure in code to see if any additional information can be gathered about the failure domain.

See Also

Other Resources

OAL - Timer Tests