1. Field of the Invention
Embodiments of the invention generally relate processing units and, more specifically to power telemetry remote monitoring.
2. Description of the Related Art
When a manufacturer designs a mobile device, the manufacturer attempts to optimize the battery usage of the mobile device by testing the battery usage under a set of controlled circumstances or particular power consumption models. For example, in a certain model, a specific video in a specific format may be played on the mobile device along with a known number and type of applications that also are simultaneously running on the mobile device. The manufacturer can then assess battery usage of the mobile device under this specific model to determine if one or more hardware elements or software programs are using an excessive or undesired amount of power. The information gathered using these models assists the manufacturer in making design choices to increase battery efficiency.
One problem, however, is that consumers do not use the mobile device under the same constrained circumstances used by the developer to determine power consumption. The models utilized by the manufacturer to determine power consumption are under-inclusive of real-world scenarios. Further, the assumptions used in these models may not even hold true in the real world. Thus, for example, because the manufacturer cannot monitor how the system is actually used by a consumer, the manufacturer cannot know which power optimization settings to apply to optimize power consumption for real-world use scenarios.
Furthermore, the inability to monitor the actual use of a mobile device makes diagnosing power consumption problems difficult for manufacturers and device suppliers and oftentimes results in a troubleshooter having to guess or extrapolate the cause of undesirable power consumption on a particular device. For example, someone troubleshooting a power issue may note that the power issues occur contemporaneously with running a particular application, causing that person to infer that the running application is responsible for the power consumption issues. However, the power consumption issues could just as likely be caused by a second application that also is running on the device or by a hardware-oriented problem within the device. Without accurate power consumption data for the mobile device, accurately diagnosing power consumption issues associated with the mobile device can be quite difficult.
As the foregoing illustrates, what is needed in the art is a better way to track and understand the power consumption behaviors of hand-held and other computing devices.
In one embodiment, a method of monitoring power consumption in a system is disclosed. The method includes receiving time-stamped power sensor data from a first buffer of a microcontroller, correlating the time-stamped power sensor data with time-stamped CPU process data, and logging the correlated data.
One advantage of the disclosed approach is that collecting and correlating power consumption data for mobile devices is based on how the mobile devices are actually used by consumers. The collection of power data for how the mobile devices are actually being used enhances diagnostic troubleshooting of power consumption issues for those devices. Because a troubleshooter can identify which processes are running on a CPU at a given time, as well as the amount and location of power consumption within a mobile system at the same time, the troubleshooter is able to more accurately identify the cause of power consumption issues within the mobile device. The collected and correlated power consumption data enables a troubleshooter to distinguishing between software-related power consumption issues or hardware-related power consumption issues.
So that the manner in which the above recited features of the present invention can be understood in detail, a more particular description of the invention, briefly summarized above, may be had by reference to embodiments, some of which are illustrated in the appended drawings. It is to be noted, however, that the appended drawings illustrate only typical embodiments of this invention and are therefore not to be considered limiting of its scope, for the invention may admit to other equally effective embodiments.
To facilitate understanding, identical reference numerals have been used, where possible, to designate identical elements that are common to the figures. It is contemplated that elements disclosed in one embodiment may be beneficially utilized on other embodiments without specific recitation.
The I/O bridge 107, which may be, e.g., a Southbridge chip, receives user input from one or more user input devices 108 (e.g., keyboard, mouse) and forwards the input to CPU 102 via path 106 and memory bridge 105. A parallel processing subsystem 112 is coupled to the memory bridge 105 via a bus or other communication path 113 (e.g., a PCI Express, Accelerated Graphics Port, or HyperTransport link). In one embodiment the parallel processing subsystem 112 is a graphics subsystem that delivers pixels to a display device 110 (e.g., a conventional CRT or LCD based monitor). A system disk 114 is also connected to the I/O bridge 107. A switch 116 provides connections between the I/O bridge 107 and other components such as a network adapter 118 and various add-in cards 120 and 121. Other components (not explicitly shown), including USB or other port connections, CD drives, DVD drives, film recording devices, and the like, may also be connected to the I/O bridge 107. Communication paths interconnecting the various components in
In one embodiment, the parallel processing subsystem 112 incorporates circuitry optimized for graphics and video processing, including, for example, video output circuitry, and constitutes a graphics processing unit (GPU). In another embodiment, the parallel processing subsystem 112 incorporates circuitry optimized for general purpose processing, while preserving the underlying computational architecture. In yet another embodiment, the parallel processing subsystem 112 may be integrated with one or more other system elements, such as the memory bridge 105, CPU 102, and I/O bridge 107 to form a system on chip (SoC).
It will be appreciated that the system shown in
The SoC 201 also includes a first coalesced timer 246 and a second coalesced timer 247. The first and second coalesced timers 246 and 247 are hardware timers, and are adapted to trigger particular events within the system 200 after expiring, as explained in further detail below. Upon expiration of the first and second coalesced timers 246 and 247, the first and second coalesced timers 246 and 247 reset. It is contemplated that the time intervals of the first and second coalesced timers 246 and 247 may be equal to one another, or may be different than one another. The first and second coalesced timers 246 and 247 are adapted to operate independently.
A microcontroller 211 is coupled to each of the voltage rails 238. The microcontroller 211 includes sensors 242, such as analog-to-digital converters and/or shunt current monitors, adapted to measure the voltage along each voltage rail 238. The microcontroller 211 determines the power consumption along each voltage rail 238 using the sensed voltages, and buffers the respective power consumptions within the buffer 238 located within the microcontroller 211. The power consumption along each voltage rail 248 is indicative of the power consumption of a particular hardware component in the system 200 to which a particular voltage rail 238 is connected. While
The sensors 242 and the microcontroller 211 consume relatively little power and are adapted to operate continuously, even when the system 200 is in a low power state. Thus, power consumption of components of the system 200 can be determined when the system 200 is in a low power state by monitoring power consumption along the voltage rails 238. The data collected by the sensors 242 is buffered in the buffer 248 by the microcontroller 211. The buffered data is stamped with a time stamp from a time stamp counter 245 operating on the SoC 201. Buffered data from the microcontroller 211 is provided to the SoC 201 via an I2C bus 244 at intervals determined by data collection software running on the SoC 201. In one embodiment, the data collection software does not operate when the system 200 is in a lower power state, and thus, only requests the time-stamped buffered power sensor data when the system 200 is operating in a normal power mode.
As shown, a method 300 begins at step 302, where the microcontroller 211 acquires power sensor data from the sensors 242. The power sensor data from the sensors 242 may be received by the microcontroller 211 in a substantially continuous manner, or may, for example, be received at predetermined time intervals. For example, power data may be received by the microcontroller at a frequency of about 20 Hz; however, this is only exemplary and it is to be understood that other frequencies are contemplated. After the microcontroller 211 receives the power sensor data, the microcontroller 211 requests and receives a time stamp from a time stamp counter 245 during step 304. In step 306, the microcontroller 211 correlates the received power sensor data with the time stamp received from the time stamp counter 245, and, in step 308, the microcontroller 211 buffers the time-stamped power sensor data in the buffer 248. The buffered time-stamped power data may be subsequently utilized by the system 200, as explained in more detail with respect to
The continued collection of power sensor data while the system 200 is in a lower power state facilitates the identification of faulty hardware. For example, collection of power data during a low power state assists in the identification of hardware that does not enter the low power state, which may indicate that the particular hardware is faulty. Additionally, the collection of power data while the system is in a normal operating state may also facilitate the identification of faulty hardware, for example, by identifying hardware that is consuming excessive amounts of power, or by identifying hardware that is receiving or utilizing insufficient amounts of power. In addition, the collected power data facilitates the optimization of system settings and design by identifying the proportionate shares of power consumption amongst the components of the system 200. A user or a third party can optimize the power consumption within the system using the collected power consumption data by adjusting hardware design, system settings, or application settings.
As shown, a method 400 begins at step 402, in which a first thread executing on the CPU 102 determines whether the first coalesced timer 246 has expired. If the first coalesced timer 246 has not expired, the first thread repeats step 402. Upon expiration of the first coalesced time, the first thread proceeds to step 404 and collects CPU process data, and the first coalesced timer resets. The CPU process data includes the number of CPUs currently operating, which processes are currently running on the CPUs, process run time, the number of threads of each process, the clock rate of the CPUs, and the like. In step 406, the first thread correlates the CPU process data with a time stamp using a time received from the time stamp counter 245. In step 408, the time-stamped CPU process data is buffered in the buffer 249 by the first thread.
In another embodiment, it is contemplated that the first thread described with respect to
As shown, a method 500 begins at step 502, where a second thread executing on the CPU 102 determines whether the second coalesced timer 247 has expired. If the second coalesced timer 247 has not expired, the second thread repeats step 502. Upon expiration of the second coalesced time, the second thread proceeds to step 504 and requests the time-stamped power sensor data from the buffer 248, and the second coalesced timer resets. The time-stamped power sensor data from the buffer 248 is transferred to the SoC 201 via the I2C bus 244. In step 506, the second thread correlates (e.g., aligns) the time-stamped power sensor data with the time-stamped CPU process data using the time stamps of the respective data. Thus, the correlated data provides accurate system information regarding the power consumption of the system 200 as the power consumption relates to specific processes executing on the CPU 102 at any instant in time. Particularly, the correlated time-stamped data facilitates the identification of hardware power consumption as the power consumption relates to the processes executing on the CPU 102.
In step 508, the correlated data from step 506 (e.g., the time-stamped power sensor data and the time-stamped CPU process data) is logged and stored by the second thread. The log may be stored, for example, in a memory such as system memory 104. The log may be accessible to a system user or to a third party (e.g., a hardware manufacturer or a software programmer) for trouble shooting, diagnostic, or design/improvement purposes. It is contemplated that the log may be provided over a network to a third party, or accessed locally on the system 100. The log provides a thorough overview of power consumption on the system 200 for components of the system 200 as the power consumption relates the processes executing on the CPU 102. The log facilitates the improvement of power consumption on the system 200, and the identification of power-related issues on the system 200, particularly because the log is generated from data of the system 200 under actual usage conditions of the system 200. The log may be provided to a third party hardware or application developer to facilitate the developer's understanding of power consumption on the system 200 as the system is utilized by a user under actual usage conditions. Thus, the log can be used to inform future design choices for the system 200 and applications that run thereon.
In another embodiment, it is contemplated that the second thread described with respect to
In sum, power consumption data for a mobile device is collected and correlated with system activity by monitoring what processes are being run on the CPU and measuring the power being consumed within the mobile device. The power being consumed within the mobile device is measured via a plurality of power monitors, such as sensors, disposed within the mobile device and buffered using an auxiliary microcontroller that resides separately from the CPU. Further, in some embodiments, temperature data also is measured via a temperature sensor.
During normal CPU operation, a first thread executing on the CPU records which processes are running on the CPU and the length of time these processes have been running. The first thread also time stamps this recorded information. The first thread for recording CPU processes executes at the expiration of a first coalesced timer. The auxiliary microcontroller obtains readings from the power and temperature sensors at predetermined intervals and buffers the obtained power and temperature data. The auxiliary microcontroller also time stamps the buffered data. In one embodiment, the power sensors are current or voltage sensors that are positioned within the mobile device to measure electrical current or voltage along power rails that provide power to various components of the mobile device.
A second thread executing on the CPU correlates the recorded information obtained by the first thread with the recorded power sensor data and temperature data, and logs the correlated information. The CPU requests the data buffered by the auxiliary microcontroller and correlates the requested data with the information obtained by the first thread according to the respective time stamps. The second thread executes at the expiration of a second coalesced timer.
When the CPU is powered down or turned off, the power sensors continue to operate, thereby allowing power consumption data to be tracked even when the CPU is in a standby mode. Power consumption data can be tracked when the CPU is powered down because the auxiliary microcontroller resides separately from the CPU, and thus, enables data buffering even when the CPU is powered down or turned off. If the first coalesced timer for the first thread or the second coalesced timer for the second thread expires while the CPU is powered down or turned off, the execution of the respective first thread and/or the second thread is suspended until the CPU is powered on or otherwise resumes a normal operating state. While embodiments herein are described with respect to a CPU, it is contemplated that operations need not be performed on a CPU, and may instead be performed on another processing unit.
One advantage of the disclosed approach is that it enables power consumption data for a mobile device to be collected and correlated based on how the mobile device is actually being used. The power consumption data under actual use facilitates the design of accurate power optimization settings for the mobile device. Additionally, the collection of power data based on how a mobile device is actually being used enhances diagnostic troubleshooting of power consumption issues for the mobile device. For example, data collected using the disclosed approach allows a troubleshooter to identify which processes are running on a CPU during a given period of time, the amount of power being consumed by the mobile device during that period of time, and where within the mobile device power is being consumed during that period of time. With this information, a troubleshooter can more easily and accurately identify the cause of power consumption issues within the mobile device, including whether the cause is software or hardware related.
While the forgoing is directed to embodiments of the present invention, other and further embodiments of the invention may be devised without departing from the basic scope thereof. For example, aspects of the present invention may be implemented in hardware or software or in a combination of hardware and software. One embodiment of the invention may be implemented as a program product for use with a computer system. The program(s) of the program product define functions of the embodiments (including the methods described herein) and can be contained on a variety of computer-readable storage media. Illustrative computer-readable storage media include, but are not limited to: (i) non-writable storage media (e.g., read-only memory devices within a computer such as CD-ROM disks readable by a CD-ROM drive, flash memory, ROM chips or any type of solid-state non-volatile semiconductor memory) on which information is permanently stored; and (ii) writable storage media (e.g., floppy disks within a diskette drive or hard-disk drive or any type of solid-state random-access semiconductor memory) on which alterable information is stored. Such computer-readable storage media, when carrying computer-readable instructions that direct the functions of the present invention, are embodiments of the present invention.
Therefore, the scope of the present invention is determined by the claims that follow.