Sunday, September 06, 2009 10:45 PM
gzmarxr
Windows Driver Kit: Driver Development Tools PwrTest Sleep Scenario
The PwrTest Sleep scenario is designed to facilitate automated testing of sleep and resume transitions. PwrTest is capable of directing the platform into one or more sleep states in an automated fashion and logging sleep state performance information such as the BIOS initialization and total resume times.
To learn more about the Sleep Scenario, type:
PwrTest /sleep /?
The PwrTest Sleep scenario supports the following command-line arguments.
| Argument | Description | Default value |
| /c:n | n indicates the number of sleep cycles | /c:1 |
| /d:n | n indicates the delay time between consecutive sleep cycles, in seconds. | /d:90 |
| /p:n | n indicates the time the system will sleep before automatically waking for the next sleep cycle, in seconds. | /p:60 |
| /h:y | Indicates hybrid sleep transitions should be enabled. | Current user power policy |
| /h:n | Indicates hybrid sleep transitions should be disabled. | Current user power policy |
| /t:y | Indicates sleep transitions should be marked critical. Applications and services are not able to prevent the sleep transition. | Current user power policy |
| /t:n | Indicates sleep transitions should not be marked critical. Applications and services are able to prevent the sleep transition. | Current user power policy |
| /s:n | n indicates the target sleep state(s) for the sleep transitions. Possible values are: “all”, All ACPI sleep states should be used in sequential order (S1, S3, S4, S1, S3, S4…) “rnd”, All ACPI sleep states should be used in random order (S1, S4, S3, S1, S4, S1…) “1”, Only S1 state should be used. “3”, Only S3 state (“Standby”) should be used. “4”, Only S4 state (“Hibernate”) should be used. | /s:3 |
| /unattend | Indicates the system should wake unattended. PwrTest will not request the display to be enabled between each sleep cycle. | This feature is disabled by default. |
Examples
PwrTest /sleep /c:7 /s:3
PwrTest will cycle the system through 7 standby transitions and save the output file information to .\PwrTestlog.xml and .\PwrTestlog.wtl.
PwrTest /sleep /c:1 /s:1
PwrTest will cycle the system through a single S1 transition and save the output file information to .\PwrTestlog.xml and .\PwrTestlog.wtl.
PwrTest /sleep /c:10 /s:rnd /d:180 /p:600 /l:random
PwrTest will cycle the system through 10 sleep/resume cycles with a random target sleep state from the available sleep states on the system. The system will sleep for 10 minutes on each sleep cycle and the delay between sleep cycles will be 3 minutes. The output will be saved to .\random.xml and .\random.wtl.
XML Logfile Output
The Sleep scenario generates the following XML elements:
<SleepScenario>
<SleepTransitions
critical=""
hybrid=""
delay=”"
sleeptime="">
<SleepTransition
number=""
status="">
<StartT></StartT>
<EndT></EndT>
<Duration></Duration>
<TargetState></TargetState>
<EffectiveState></EffectiveState>
<BIOSInit></BIOSInit>
<DriverInit></DriverInit>
<Suspend></Suspend>
<Resume></Resume>
<HiberRead></HiberRead>
<HiberWrite></HiberWrite>
</SleepTransition>
<SleepTransition
number=""
status="">
<StartT></StartT>
<EndT></EndT>
<Duration></Duration>
<TargetState></TargetState>
<EffectiveState></EffectiveState>
<BIOSInit></BIOSInit>
<DriverInit></DriverInit>
<Suspend></Suspend>
<Resume></Resume>
<HiberRead></HiberRead>
<HiberWrite></HiberWrite>
</SleepTransition>
</SleepTransitions>
</SleepScenario>
This table describes the Sleep scenario XML elements in detail.
| Element | Description |
| <SleepScenario> | Contains information related to the sleep scenario. Only one <SleepScenario> element per PwrTest log file. |
| <SleepTransitions> | Provides overall data about the sleep transition cycles such as the state of critical and hybrid sleep features. |
| <SleepTransition> | Provides per-sleep cycle information such as the start and end times, as well as details about the resume time such as the BIOS initialization time. A <SleepTransition> element is generated for each sleep transition cycle. |
| <StartT> | Indicates the start time of the sleep cycle. (hh:mm:ss) |
| <EndT> | Indicates the end time of the sleep cycle. (hh:mm:ss) |
| <Duration> | Indicates the duration of the sleep cycle. (hh:mm:ss) |
| <TargetState> | Indicates the target sleep state. |
| <EffectiveState> | Indicates the effective sleep state. |
| <BIOSInit> | Indicates the amount of time required to initialize the BIOS (TargetState must be 3) on resume in milliseconds. |
| <DriverInit> | Indicates the amount of time required to initialize drivers on resume in milliseconds. |
| <Suspend> | Indicates the amount of time required to suspend the system in milliseconds. |
| <Resume> | Indicates the total amount of time required to resume the system in milliseconds. |
| <HiberRead> | Indicates the time required to read the hibernation file in milliseconds. (TargetState must be 4) |
| <HiberWrite> | Indicates the time required to write the hibernation file in milliseconds. (EffectiveState must be 4) |