PwrTest Requests Scenario

The PwrTest Requests Scenario logs power requests from processes and services running in the system as they happen.

You can use the PwrTest Requests Scenario to diagnose why a computer doesn't go to sleep or why the monitor stays on.

You could also use the administrator tool PowerCfg (powercfg.exe) for this purpose (powercfg.exe /requests). PowerCfg is included with Windows (Windows\System32 directory). However, Powercfg.exe only captures the power requests that are active at the time you run the tool. In contrast, the PwrTest Requests Scenario runs for a specified time and logs power requests as they are created and closed, so the requests don’t need to be active when the tool is run.

Syntax

pwrtest /requests [/t:n] [/?] 

/t:n

Specifies the total time (in minutes) for the scenario to run (the default value for n is 30 minutes).

Examples

pwrtest /requests  
pwrtest /requests  /t:60

XML log file output


<PwrTestLog>
  <SystemInformation>
  </SystemInformation>
  <PowerRequests> 
    <CreatePowerRequestEvent>
        <Timestamp></TimeStamp>
        <Caller></Caller>
        <Context></Context>
        <RequestObject></RequestObject>
        <Type></Type>
        <ProcessID></ProcessID>
        <SessionID></SessionID>
        <Legacy></Legacy>
        <SystemAllowed></SystemAllowed>
        <DisplayAllowed></DisplayAllowed>
        <AwayModeAllowed></AwayModeAllowed>
        <PerfBoostAllowed></PerfBoostAllowed>
        <ExecutionRequiredAllowed></ExecutionRequiredAllowed>    
        <SystemCount></SystemCount>
        <DisplayCount></DisplayCount>
        <AwayModeCount></AwayModeCount>
        <PerfBoostCount></PerfBoostCount>
        <ExecutionRequiredCount></ExecutionRequiredCount>
    </CreatePowerRequestEvent>
    <ChangePowerRequestEvent>
        <Timestamp></TimeStamp>
        <Caller></Caller>
        <RequestObject></RequestObject>
        <SystemCount></SystemCount>
        <DisplayCount></DisplayCount>
        <AwayModeCount></AwayModeCount>
        <PerfBoostCount></PerfBoostCount>
        <ExecutionRequiredCount></ExecutionRequiredCount>
    </ChangePowerRequestEvent>
    <ClosePowerRequestEvent>
        <Timestamp></TimeStamp>
        <Caller></Caller>
        <RequestObject></RequestObject>
    </ClosePowerRequestEvent>
  </PowerRequests>
</PwrTestLog> 


The following table describes the XML elements that appear in the log file.

ElementDescription
<PowerRequests>

Contains all the different power request events. There can be only one <PowerRequests> element in a PwrTest log file.

<Timestamp>

Time stamp of any given event.

<Caller>

Name of the requester.

<Context>

Device instance path if applicable

<RequestObject>

Request object for the event.

<Type>

Numeric type of caller.

0 = driver

1 = process

2 = shared service

<ProcessID>

Process ID of caller.

<SessionID>

Session ID of caller if process.

<Legacy>

Reports True or False if the caller used legacy SetThreadExecutionState function (Windows) or PoSetSystemState APIs or the newer PowerSetRequest function (Windows) or PoSetPowerRequest APIs.

<SystemAllowed>

Reports whether system requests are allowed for this caller.

<DisplayAllowed>

Reports whether display requests are allowed for this caller.

<AwayModeAllowed>

Reports whether away mode requests are allowed for this caller.

<PerfBoostAllowed>

Reports whether performance boost requests are allowed for this caller.

<ExecutionRequiredAllowed>

Reports whether execution required requests are allowed for this caller.

<SystemCount>

Number of system requests for this caller.

<DisplayCount>

Number of display requests for this caller.

<AwayModeCount>

Number of away mode requests for this caller.

<PerfBoostCount>

Number of performance boost requests for this caller.

<ExecutionRequiredCount>

Number of execution required requests for this caller.

<CreatePowerRequestEvent>

Caller has created a new request.

<ChangePowerRequestEvent>

Caller has changed the request count.

<ClosePowerRequestEvent>

Caller has closed the request.

 

Related topics

PwrTest Syntax
PowerCfg

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft