Partager via


OAL High Performance Timer Tests (Compact 2013)

3/26/2014

The OAL High Performance Timer Tests verify the behavior of the high performance timer, accessed through the QueryPerformanceCounter interface.

The tests verify the high performance timer, which is useful for performance measurements and timing operations, where high precision is needed.

Test case 1120 will take approximately 30 minutes to execute, with the provided command line parameters. Therefore this test may take in excess of 30 minutes to run.

Test Prerequisites

Your device must meet the following requirements before you run this test.

The test should be run on a minimal OS design, such as one with only the following SYSGENs set to minimize the likelihood of interactions from other system components:

SYSGEN_NETWORKING=1

SYSGEN_SHELL=1

The following table shows the hardware requirements for the High Performance Timer Backwards Check Test.

Requirement

Description

High-performance Counter

Corresponding to the QueryPerformanceCounter function

The following table shows the software requirements for the High Performance Timer Backwards Check Test.

Requirements

Description

Tux.exe

Tux test harness, required for executing the test

Kato.dll

Kato logging engine, required for logging test data

OalTestTimers.dll

Library containing the timer tests

Subtests

The table below lists the subtests included in this test.

SubTest ID

Description

1110

High Performance Resolution (high priority)

This test determines the resolution of the high-performance clock. The test case records the resolution of the clock for 1000 iterations and then averages the recorded values to report a result.

This test case runs at a scheduler priority of 1.

This test case prints out the calculated resolution; the user must verify that it is as expected.

Note: This test case evaluates resolution, not precision. The precision of a clock is the smallest unit of measurement that the clock displays. The resolution is the smallest interval/tick that the clock accurately measures.

1120

High Performance Backwards Check - busy sleep

Confirms that the high-performance counter is a monotonically increasing value that runs backward only when it overflows.

This test case reads each subsequent clock tick and verifies that the value is greater than the previous value. If the value is less than the previous value, the difference between the values must be less than twice the resolution of the clock. If the difference between the values is greater than twice the resolution of the clock, this test case fails.

By default, this test case runs for 3 hours. You can specify the length of time that it runs by specifying -c "-backwardsRunTime seconds", where seconds is the run time for the test in seconds.

The test must run a quick calibration to determine how many iterations are needed to run for the full test time. The default length of the calibration test is 10 seconds, but the length of the calibration test can be changed with the -CalibThresh <time in ms> option on the command line.

1150

Print High Performance Clock

Prints out the value of the high-performance counter ten times, sleeping for one second between each call.

Setting Up the Test

This test has no additional requirements, beyond the standard test environment setup.

Running the Test

The OAL High Performance Timer Test executes the 'tux -o -d oalTestTimers.dll -x 1100-1150 -c"-backwardsRunTime 1800"' command line on default execution.

You can modify the test by editing the command line for the test. To specify an optional command line parameter for this test, use the -c command line parameter, which causes Tux to pass the specified string into the test module. For more information about how to edit the command line for a test, see Editing the Command-Line for a Test.

The following table shows the command line parameter for the High Performance Timer Tests.

Command line parameter

Description

-backwardsRunTime time

Specifies the run time for the test. The value time is considered to be in seconds unless the following modifiers are used:

* s means seconds (12s = 12 seconds)

* m means minutes (12m = 12 minutes)

* h means hours (12h = 12 hours)

* d means days (12d = 12 days)

The default run time without command line parameters is 3 hours.

Verifying the Test

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

Troubleshooting the Test

* Ensure that you are running on a minimal OS Configuration

* Ensure that drivers and servers running on the OS meet real time constraints and do not interrupt the test.

* Ensure that the High Performance counter is implemented correctly (and not running off the system timer) .

* 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