Table of contents
TOC
Collapse the table of content
Expand the table of content

PwrTest Execution State Scenario

Last Updated: 11/22/2016

The PwrTest Execution State Scenario (/es) monitors thread execution state changes of the currently running processes and services.

Note
This PwrTest Execution State Scenario is primarily used for applications that use legacy power request APIs, such as SetThreadExecutionState function (Windows)). To monitor applications that use newer power request APIs, such as PowerSetRequest function (Windows) use the PwrTest Requests Scenario instead.

Applications and services may temporarily override power management settings such as the monitor and sleep idle timeouts by changing their thread execution state. The PwrTest Execution State Scenario monitors thread execution state and system state changes that applications and services have made using the Win32 SetThreadExecutionState function (Windows).

You can use the /es scenario together with PwrTest Idle Scenario to help identify the applications and services that are preventing the monitor or system from going idle.

Syntax

pwrtest /es  [/t:n] [/stes:{y|n}] [/rss:{y|n}] [/sss:{y|n}] [/all] [/user] [/kernel] [/idle] [/?]

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

/stes:{y|n}
Specifies whether SetThreadExecutionState events should be logged (y (yes) is the default).

/rss:{y|n}
Specifies whether RegisterSystemState events should be logged (y (yes) is the default).

/sss:{y|n}
Specifies whether SetSystemState events should be logged (y (yes) is the default).

/all
Specifies that all events should be logged (SetThreadExecutionState, RegisterSystemState, SetSystemState).

/user
Specifies that all user events should be logged (SetThreadExecutionState).

/kernel
Specifies that only kernel-mode events should be logged (RegisterSystemState, SetSystemState).

/idle
Log idle statistics.

Examples

pwrtest /es /all
pwrtest /es /user
pwrtest /es /kernel
pwrtest /es /kernel /sss:n
pwrtest /es /kernel /rss:n
pwrtest /es /kernel /rss:y /sss:n
pwrtest /es /sss:n
pwrtest /es /rss:n /sss:n
pwrtest /es /stes:n
pwrtest /es /all /idle

XML log file output

<PwrTestLog>
  <SystemInformation>
  </SystemInformation>
  <ExecutionState> 
    <EsChange> 
      <Time>XX:XX:XX</Time>
      <Process></Process>
        <RawState></RawState>
        <Continuous></Continuous>
        <System></System>
        <Display></Display>
        <AwayMode></AwayMode>
    </EsChange> 
    <EsChange> 
      <Time>XX:XX:XX</Time>
      <Process></Process>
        <RawState></RawState>
        <Continuous></Continuous>
        <System></System>
        <Display></Display>
        <AwayMode></AwayMode>
    </EsChange> 
  </ExecutionState>
</PwrTestLog>

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

ElementDescription
<ExecutionState>

Contains information related to the execution state scenario. There can be only one <ExecutionState> element in a PwrTest log file.

<EsChange>

Contains information related a single thread execution state change event. There will be one <EsChange> element.

<Time>

Indicates the time when the execution state change event occurred.

<Process>

Indicates the path to the image file for the process that requested the execution state change.

<RawState>

Indicates the request execution state. This is a 32-bit value of type EXECUTION_STATE (see Windows.h).

<Continuous>

Indicates if the process requested the execution state change to be continuous (ES_CONTINUOUS).

<System>

Indicates (TRUE) if the process requested the system to be available (ES_SYSTEM_REQUIRED) or not (FALSE).

<Display>

Indicates (TRUE) if the process requested the display to be available (ES_DISPLAY_REQUIRED) or not (FALSE).

<AwayMode>

Indicates (TRUE) if the process requested away mode to be enabled (ES_AWAYMODE_REQUIRED) or not (FALSE).

PwrTest Syntax

Send comments about this topic to Microsoft

© 2016 Microsoft