Power and CPU frequency counters in Timing Captures

PIX can collect System Monitor counters that describe system power state, battery state, processor C-states, and requested processor frequency. These counters help you optimize your title on battery-powered devices, such as tablets and Windows handheld gaming devices. Graph these counters with your frame, event, and budget metrics to see whether performance changes line up with power events such as unplugging AC power, entering battery saver, or cores moving into deeper idle states.

Collect power counters in a Timing Capture

The Timing Capture option Capture System Monitor counters controls whether PIX writes System Monitor counters into the capture. The option is on by default for captures started from the PIX UI and for programmatic Timing Captures. If you previously turned it off, turn it back on before you take the capture.

After you open a capture, the counters are available in the metrics selector panel anywhere Timing Captures let you choose metrics:

  • The Metrics layout, where you can graph the counters with PIX CPU events and other metrics.
  • The Budgets layout, where you can define budget lines for counter values.
  • The Comparison layout, where you can compare event durations across ranges selected by metric behavior.

The same counters are also available in the System Monitor view while PIX is connected to the machine, but System Monitor doesn't graph them by default. To add them to a new or existing graph, open Modify Graphs, create or select a graph under Graph to Modify, select counters under Available Counters, and then select Add selected counters to graph.

System power status counters

The System Power Status group contains counters that come from the Windows power status APIs.

Counter Unit Meaning
AC Power Status None Reports 0 when AC power is offline and 1 when AC power is online.
Battery Life Percentage % Reports the remaining battery charge from 0 to 100. PIX omits this counter value when Windows reports that the percentage is unknown.
Battery Saver Status None Reports 0 when battery saver is off and 1 when battery saver is on. In battery saver mode, the system limits the resources available to your title to conserve power, which reduces game performance.
Battery Discharge Rate W Reports battery discharge rate in watts. Positive values indicate discharge, and negative values indicate charging. PIX reports this counter only when Windows reports that a battery is present.

Use these counters to correlate frame time, CPU work, GPU work, or custom counters with power changes. For example, graph AC Power Status and your frame event in the Metrics layout to see whether a frame-time spike lines up with unplugging or reconnecting AC power.

Per-processor C-state counters

PIX reports one counter per logical processor in the CPU C-State group and the CPU Max C-State group.

Group Counter name pattern Meaning
CPU C-State CPU {n} C-State The current processor C-state, also known as the CPU idle state. C-states indicate when the CPU has reduced or turned off selected functions.
CPU Max C-State CPU {n} Maximum C-State The maximum processor C-state for the same logical processor. Use it as context for the current C-state value.

Code executes only in C0. Deeper idle states save power by reducing or turning off selected processor functions, but the processor must return to C0 before it can run your thread again, and that transition takes time. This wake-up latency can affect game performance. For more information about C-states, see P-states and C-states.

If you see a frame-time spike near a C-state transition, inspect the Timeline layout around the same range to see which thread was running, stalled, or unscheduled.

Tip

If your machine has heterogeneous CPU cores, use the Timeline's heterogeneous cores support to see whether critical work ran on performance or efficiency cores. That view answers core-placement questions; the counters in this article answer power-state and requested-frequency questions.

Per-processor frequency counters

PIX reports one counter per logical processor in the CPU Requested Frequency group and the CPU Nominal Frequency group.

Group Counter name pattern Unit Meaning
CPU Requested Frequency CPU {n} Requested Frequency MHz The processor clock frequency requested by the OS power manager. This is a requested performance state, not the achieved clock, and it doesn't exceed the nominal frequency.
CPU Nominal Frequency CPU {n} Nominal Frequency MHz The nominal processor clock frequency. Boost clocks can exceed this value.

Higher processor frequency means faster performance and more power consumption. Use requested frequency counters to see whether OS power management changed the requested processor state while your workload was running, and compare them with CPU {n} Nominal Frequency for context. Don't treat CPU {n} Requested Frequency as the measured clock rate. It doesn't show boost clocks.

Interpret the counters with other Timing Capture data

Power counters are most useful when you graph them with the work that matters to your frame. A typical workflow is:

  1. In the Metrics layout, graph your frame event or another important PIX CPU event.
  2. Add one or more power counters, such as AC Power Status, Battery Saver Status, CPU {n} Requested Frequency, or CPU {n} C-State.
  3. Select the range where the frame-time behavior changes.
  4. Zoom the Timeline layout to that range to inspect thread scheduling, CPU samples, and PIX events.
  5. Use the Comparison layout when you have two ranges, such as an AC-power range and a battery-power range, and want a statistical comparison of the event hierarchy.

Example: Compare frame time on AC and battery power

This example shows how the counters reveal the effect of unplugging a laptop or handheld device while a game runs.

  1. In the Metrics layout, graph AC Power Status and CPU {n} Requested Frequency for one or more processors. The requested frequency changes when the device switches between AC and battery power.
  2. Add the PIX CPU event that represents a frame in your game to the same graph. In this example, frame time spikes both when the device is unplugged and when it's plugged back in, and the average frame time differs between the two power states.
  3. Select a time range where AC Power Status is 0 (on battery) and note the average frame time. In this example, it's about 47 ms.
  4. Select a time range where AC Power Status is 1 (on AC power) and note the average frame time. In this example, it's faster, at about 29 ms.
  5. Open the Comparison layout with the battery range and the AC range to get a statistical analysis of the difference in frame times between the two cases.

Requirements and limitations

  • Power and processor counters depend on values reported by Windows. PIX doesn't synthesize missing battery or processor-power data.
  • Battery-specific counters depend on the machine's hardware and current OS-reported battery state. Desktop machines and devices without batteries might not report Battery Discharge Rate, and Battery Life Percentage values are omitted when Windows reports the percentage as unknown.
  • CPU {n} Requested Frequency is a requested OS power-manager state, not an achieved clock measurement.
  • CPU {n} Nominal Frequency is the nominal, rated base frequency, not the boost ceiling.
  • The current PIX source doesn't add an extra OS-version, hardware, or administrator requirement specifically for these counters beyond the normal requirements for taking the capture or connecting System Monitor.