Improving Energy Efficiency of Embedded Devices
This technical article contains information about the PowerCfg.exe command-line utility that is included in the Windows Embedded Standard 7 Power Management feature pack.
PowerCfg.exe is a command-line utility that has been in Windows. In Windows 7 this version includes two new capabilities that can assist you as an embedded-device developer. The enhancements let you detect many common energy efficiency problems, such as ineffective use of suspend by USB devices, excessive processor utilization, increased timer resolution, inefficient power-policy settings, and battery capacity degradation. For non-developers, this utility is typically used to list and modify power schemes for a user’s environment. Two new options are available for PowerCfg.exe in Windows 7 and Standard 7: /Energy analysis and /Requests modes.
The /Energy option analyzes the system for common energy efficiency and battery life problems. The /Energy command option should be used when the computer is idle and with no open programs or documents. The /Energy command option will analyze the system for 60 seconds and generate an HTML file that is named “energy-report.html”. The contents of the file can be valuable in identifying the hardware preventing certain sleep states, power-policy recommendations to improve your device’s power consumption, CPU optimizations, and more. For mobile devices, the data will also include battery utilization or degradation information.
We expect that OEMs will want to use the /Energy option as a first-pass validation of their device. It is also helpful when you compare systems. System manufacturers can run PowerCfg.exe on each new model of a device to verify that no severe energy efficiency problems exist before they ship their devices to customers. Software developers can use the new PowerCfg.exe capabilities to validate the effect of their applications on the overall system energy efficiency, especially when the applications are background processes.
The /Energy option is built on Event Tracing for Windows (ETW). Many other performance analysis utilities in Windows consume ETW instrumentation resources. If another performance-analysis utility is also using the instrumentation when an energy efficiency analysis is run, PowerCfg.exe will stop and display the following error:
Could not open the NT Kernel Logger.
To fix this, close all other performance-analysis utilities, such as PerfMon. For more information about Windows Performance Monitor (Perfmon.exe), see this Microsoft Web site.