Modern standby SleepStudy

Starting with Windows 8.1, a software tool, SleepStudy, became available as an inbox component in all Windows PCs that implement the modern standby power model. SleepStudy can measure modern standby performance with minimal impact. Details on the report's contents can be found below.

Watch this video to learn how to use SleepStudy to find and fix components that cause unexpected battery drain.

Tracking system activity and battery drain during modern standby can be difficult because the tracking itself can cause unnecessary activity and battery drain. For example, traditional disk-based logging has the unwanted side effect of causing excessive battery usage when the disk is activated for logging. In contrast, the SleepStudy tool is designed to avoid generating activity that could interfere with the modern standby performance that it measures.

The most detailed way to measure power consumption during modern standby is to use an instrumented system, which is a physical system that has power measurement leads connected to every major hardware subsystem of interest. However, testing to this level of detail is not practical in many cases because of engineering cost, and systems that have already been sold to customers typically cannot be tested in this way.

The SleepStudy tool provides overview information about each modern standby session. This information includes the active time, the idle time, and the power consumed. A session starts when the system enters the modern standby state, and ends when it exits this state.

SleepStudy also provides first-level information about the causes of activities that occur during each modern standby session. This feature allows for easy investigation of long-running activities.

Battery Information: Each SleepStudy report concludes with information about the system battery configuration. In addition to name and manufacturer, this information includes battery size and design capacity. The battery size and design capacity are particularly important for SleepStudy because they are taken into account when estimating modern standby battery life.

In some cases, the capacity ratio will exceed 100 percent. This is expected and will change over time as the battery chemistry changes.

For more information about running SleepStudy and interpreting the results, please reference the following videos:

Running SleepStudy

The SleepStudy tool runs from a Command Prompt window and is simple to use. SleepStudy outputs an easy-to-read HTML report.

To run SleepStudy, open a Command Prompt window as Administrator and enter the following command:

powercfg.exe /SleepStudy

In response to this command, the built-in powercfg.exe command-line tool creates an HTML file named Sleepstudy-report.html in the current working directory.

Advanced Options

By default, the SleepStudy report covers the last three days of system operation. To change the duration covered by the SleepStudy report, use the powercfg.exe tool's /duration option. With this option, you specify an additional parameter, which is the number of days (up to 28) that the SleepStudy report covers.

For example, to generate a SleepStudy report for the last seven days of system operation, open a Command Prompt window as Administrator and enter the following command:

powercfg /sleepstudy /duration 7

For more information about powercfg.exe, see Powercfg command-line options.

SleepStudy Reports supporting TShell

On Windows versions after 2004, SleepStudy reports can be generated directly as HTML on mobile images supporting TShell. To do so, connect to TShell, navigate to writeable directory in data partition (e.g., 'cd c:\data\') and run 'powercfg /sleepstudy'. On Windows versions 2004 and earlier, the following steps are required after navigating to the writeable directory to generate the report as XML and convert it to HTML.

  1. Run the following command:

    powercfg /sleepstudy /xml
    
  2. Copy sleepstudy-report.xml that is generated in the local directory to the host machine.

  3. Run the following command:

    powercfg /sleepstudy /transformxml <path to sleepstudy-report.xml>
    

Sleep study traces are automatically generated on mobile for screen off sessions longer than 10 minutes and are maintained for the last 7 days. The reports contain the last 3 days, by default, but can be extended with the '/duration' flag.

Report Details

Beginning with Windows version 2004 on Modern Standby systems, the SleepStudy report is organized as a series of state changes -- primarily Active, Screen Off, and Sleep states. Therefore, while an overall modern standby session is defined as one instance of the screen turning off and back on again, the SleepStudy report will break this down into the time spent quiescing the system (the Screen Off state), and the time spent in its long term low power state (the Sleep state). Prior releases will just show details for the overall Modern Standby session.

For each state, an overview is provided at the top of the report with a hyperlink to its detailed section in the HTML report.

The SleepStudy report also contains:

  • Static configuration information about the hardware platform, its operating system installation, and firmware version.
  • A graphical view of the usage trend over the last 72 hours.
  • A summary table of each state segment, which includes:
    • Start time, end time, and duration.
    • Power source (AC or battery power).
    • Battery power consumed and average power consumption.
  • Each Screen Off session includes additional detailed information:
    • The information contained in the summary table.
    • Any blockers that prevented the system from quiescing immediately to enter sleep.
  • Each Sleep session includes additional detailed information:
    • The information contained in the summary table
    • The five most active components ("top offenders") in the modern standby session. The information shown for each component includes the component type, name, and device path (if applicable).
    • A histogram chart of idle time.
  • Information about the system battery configuration, including design capacity and cycle count.

The remainder of this topic describes a sample SleepStudy report, and explains how to interpret the report and understand the information that it contains.

System information

Every SleepStudy report begins with basic system information, which includes system name and firmware version. This information is essential because changes to the operating system, firmware, and BIOS can have significant impact on modern standby battery life.

Every SleepStudy report includes a graphical view of system usage that includes modern standby periods.

The graph is color-coded. Green, orange, and red segments correspond to low, medium, and high system activity, respectively.

The default period that the graph covers is three days.

The graph consists of dotted, solid, and no-line segments, which indicate AC power, battery power, and system-off periods, respectively. The following graph legend is included with each SleepStudy report.

Summary information

Each SleepStudy report includes a table that summarizes the modern standby sessions that are evaluated in the report.

Each row in the summary table contains information about one state of a modern standby session. The rows in the summary table are color-coded to identify sessions that could be investigated for improvement.

Color coding

Beginning in Windows version 2004 with the seaparation of Modern Standby sessions into Screen Off and Sleep states, colors for a row in sleep study reports are based on a few main rules:

  1. If the session is less than 2 minutes, no detailed data is shown.
    • If it's a Screen Off session, then it is colored Green, since most screen off sessions are expected to be very short.
    • If it's a Sleep session, then it is colored Grey, since there is no information to determine if it's a good or bad session based on drain or time spent in DRIPS.
  2. If the session is 2 minutes or greater, then both Sleep and Screen off sessions will be colored according to the following drain and DRIPS % thresholds.
    • For Screen Off sessions, this is:
      • Red indicates that the drain rate is >= 1% per hour
      • Yellow indicates that the drain rate is between .33 and 1% per hour
      • Green indicates all other cases
    • For Sleep sessions, this is:
      • Red indicates that the DRIPS rate is <80% or the drain rate is >= 1% per hour
      • Yellow indicates that the DRIPS rate is between 80-94% or the drain rate is between .33-1% per hour
      • Green indicates all other cases
  3. If there is a red child blocker, then the parent session will be colored red as well. Clearly incorrect third party child blockers will be colored purple.

By design, some sessions are active (red rows). But most sessions can be expected to reflect low activity and low power (green). The color scheme is designed to make potential high-drain sessions easy to identify. You should be most concerned about long sessions (of several hours) that show high sustained battery drain—these sessions have the most impact on the battery.

Legacy color coding

Prior to 20H1, the color coding for each overall modern standby session is based on a combination of the drain rate and the deepest runtime idle platform state (DRIPS) rate (percent low power). The color is determined by the worst performance of either drain rate or DRIPS rate, according to the following rules:

  • Red indicates at least one of the following:
    • The DRIPS rate is < 80 percent.
    • The drain rate is >= 1 percent per hour. (If the drain rate is >= 1 percent per hour, the modern standby battery life will be at most four days.)
  • Orange indicates at least one of the following:
    • The DRIPS rate is between 80 and 94 percent.
    • The drain rate is between 0.333 and 1 percent. (If the drain rate is under 0.333 percent, the platform will achieve 12+ days battery life in modern standby.)
  • Green indicates all other cases.

Drain rate calculation

SleepStudy calculates drain rate by using remaining capacity information that is provided by the platform battery and charging subsystem. The battery capacity, in milliwatt-hours, is recorded at the start and end of each SleepStudy session. The battery capacity information is provided by the platform through the ACPI _BST control method under the battery device object in the ACPI namespace.

List of summary information

The summary table includes the following basic information (from left to right):

  • The session number (left column) starts with one, and increments for each session that is reported during this period. The default report period covers the last three days.
  • START TIME (local time) is shown in YYYY-MM-DD HH:MM:SS format. Additional sessions on the same day do not repeat the year-month-day information.
  • DURATION, in hours:minutes:seconds, of the modern standby session. This duration time covers the approximate period between the transition to screen off and subsequent transition to screen on.
  • ENERGY CHANGE shows the number of absolute milliwatt-hours (mWh) that are consumed and the relative percentage of the battery's last full-charge capacity. A session in which no change occurs in remaining capacity is indicated by a hyphen (-), as shown in session 6 in the summary table in the preceding example.
  • ENERGY CHANGE shows the number of absolute milliwatt-hours (mWh) that are consumed and the relative percentage of the battery's last full-charge capacity. A session in which no change occurs in remaining capacity is indicated by a hyphen (-), as shown in session 6 in the summary table in the preceding example.
  • CHANGE RATE, in milliwatts, and AC (Charge) or DC (Drain) power source indicator. The change rate is calculated by dividing the ENERGY CHANGE value by the DURATION value.
  • % LOW POWER STATE TIME shows the DRIPS rate and (if applicable) hardware DRIPS as the percentage of time in which the SoC resides in the lowest power state (DRIPS). Hardware DRIPS (denoted by HW: preceding the residency percentage) is available on Intel and Qualcomm SoC-based Windows PCs only.

Overall modern standby sessions of less than ten minutes are not tracked by the SleepStudy report. To measure modern standby performance, overall session durations should be greater than ten minutes. Longer periods (more than one hour) are reflective of real user experience.

Energy change is not tracked for AC sessions (indicated by the Charge keyword under CHANGE RATE). This information is captured in other reports, such as the report that the powercfg/energy command generates, because energy policies that are used when the platform runs on AC power are different from the policies that are used when the platform runs on battery (DC) power. In general, these policies are less strict and allow for different use cases. Every row in the summary table is a hyperlink to per-session details that are presented in the SleepStudy report.

Session details

A per-session details section of the report starts by repeating the session information from the summary table.

The table can show the following types of offenders:

  • Fx Device. A device that has a driver that implements support for the Windows power framework (PoFx). Typically, this type of device resides on the SoC itself.
  • Activator. A software component that can keep the system active to perform valuable work during modern sleep. (In the preceding example, the name BI identifies the broker infrastructure, which is a Windows software component that coordinates background task execution.)
  • Networking. A networking subsystem device or component.
  • Processor. CPU active time that occurs outside of an activator being enabled.
  • PDC Phase. Time that is spent in the different phases of entering or exiting modern standby-- this is most applicable to Screen Off states. Please see Prepare software for modern standby for more information.
  • Other. Includes miscellaneous tracking information. For example, CPU utilization outside of an enabled activator is listed under TYPE as Other.

Each component in the Top Offenders table is color-coded by activity time. If it is over ten percent busy, the row is highlighted in red. If the component is between five and ten percent active, it is colored orange. Otherwise, the component row is highlighted in green.

Exit reasons

The detailed info section also includes exit reason for Sleep and Screen off sessions.

Sleep and screen off exit reasons

The below exit reasons are reasons that the system can wake from Modern Standby (Sleep or Screen off) to Active.

Exit reason code Exit reason
0 Unknown
1 Power Button
3 SC_MONITORPOWER
4 User Input
5 AC/DC Display Burst
6 User Display Burst
7 PoSetSystemState
8 SetThreadExecutionState
10 Session Unlock
11 Screen Off Request
12 Video Idle Timeout (VIDEOIDLE)
13 Policy Change
14 Sleep Button
15 Lid
16 Battery Count Change
17 Grace Period
19 Dynamic Partitioning
20 Hibernate, or Shutdown
21 System Idle Timeout (STANDBYIDLE)
22 Proximity Sensor
23 Thermal Standby
25 Resume S4 Display Burst4
26 Terminal
27 PDC Signal
28 AC/DC Display Burst Suppressed
30 Winrt API
31 Input Keyboard
32 Input Mouse
33 Input Touchpad
34 Input Pen
35 Input Accelerometer
36 Input Hid
37 Input UserPresent
38 Input SessionSwitch
39 Input Initialization
40 PDC Signal: Windows Mobile Power Notification
41 PDC Signal: Windows Mobile Shell
42 PDC Signal: Hey Cortana
43 PDC Signal: Holographic Shell
44 PDC Signal: Windows Biometric Framework Fingerprint
45 Directed DRIPS: Device-S4
46 Monitor Dim
47 Builtin Panel
48 Display Required Undim
49 Battery Count Change Suppressed
50 Transition From Sleep
51 Terminal Initialization
52 PDC Signal: Sensor - Human Presence Detected
53 Battery PreCritical
54 Input Touch

Sleep only (not Screen off) exit reasons

The below exit reasons are reasons the system can wake from Sleep to Screen off, without entering an active state.

Exit reason code Exit reason
16777216 PDC Task Client: Unknown
16777217 PDC Task Client: Network Refresh
16777220 PDC Task Client: Maintenance Scheduler
16777221 PDC Task Client: Sync Client
16777222 PDC Task Client: Tethering Client
16777223 PDC Task Client: SleepStudy Accounting
16777224 PDC Task Client: Windows Update Client
16777225 PDC Task Client: Wake on LAN
16777227 PDC Task Client: Terminal Server Remote Session
16777228 PDC Task Client: Servicing Session
16777229 PDC Task Client: User Mode Shutdown Client

See also