System and method for energy usage accounting in software applications
First Claim
1. A method for generating an energy usage profile comprising:
- executing program instructions corresponding to a first system call in a software program with a processor in a computing device, the processor operating a component that consumes power in the computing device in response to execution of the first system call;
generating a first call trace of the execution of the first system call with the processor, the generation of the first call trace further comprising;
generating a first timestamp corresponding to a first time at which the first system call is executed; and
generating a first identifier comprising at least one of the group consisting of a calling routine identifier, a thread identifier, and a process identifier for the software program that executes the first system call;
executing program instructions corresponding to a second system call in the software program with the processor in the computing device, the processor operating the component that consumes power in the computing device in response to execution of the second system call;
generating a second call trace of the execution of the second system call with the processor, the generation of the second call trace further comprising;
generating a second timestamp corresponding to a second time at which the second system call is executed; and
generating a second identifier comprising at least one of the group consisting of a calling routine identifier, a thread identifier, and a process identifier for the software program that executes the second system call;
identifying a first power consumption level of the component and a first duration of the first power consumption level during the first system call based on the first call trace and a first power state in a model stored in a first memory;
identifying a second power consumption level of the component and a second duration of the second power consumption level that occurs after completion of the first system call and prior to executing the program instructions corresponding to the second system call based on a second power state in the model, the first time stamp, the first duration, and the second timestamp;
identifying a third power consumption level of the component and a third duration of the third power consumption level during the second system call based on the second call trace and the first power state in the model;
identifying a fourth power consumption level of the component and a fourth duration of the fourth power consumption level that occurs after completion of the second system call based on the second power state in the model;
generating an energy usage profile for the software program associating the first identifier with an estimate of energy consumption of the component in response to the execution of the first system call based on the first power consumption level and the first duration and the second power consumption level and the second duration;
generating the energy usage profile for the software program associating the second identifier with another estimate of energy consumption of the component in response to the execution of the second system call based on the on the third power consumption level and the third duration and the fourth power consumption level and the fourth duration; and
storing the energy usage profile in a second memory.
1 Assignment
0 Petitions
Accused Products
Abstract
A method for generating an energy usage profile for a software program executed in a computing device includes generating a call trace of an executed system call, identifying a first power consumption and duration of a first power state due to the first system call using a model, identifying a second power consumption and duration of a second power state based on the model, and generating an energy usage profile for the software program. The energy usage profile includes energy consumption of the computing device for the system call based on the first power consumption level multiplied by the first duration and the second power consumption level multiplied by the second duration associated an identifier for the call trace.
6 Citations
11 Claims
-
1. A method for generating an energy usage profile comprising:
-
executing program instructions corresponding to a first system call in a software program with a processor in a computing device, the processor operating a component that consumes power in the computing device in response to execution of the first system call; generating a first call trace of the execution of the first system call with the processor, the generation of the first call trace further comprising; generating a first timestamp corresponding to a first time at which the first system call is executed; and generating a first identifier comprising at least one of the group consisting of a calling routine identifier, a thread identifier, and a process identifier for the software program that executes the first system call; executing program instructions corresponding to a second system call in the software program with the processor in the computing device, the processor operating the component that consumes power in the computing device in response to execution of the second system call; generating a second call trace of the execution of the second system call with the processor, the generation of the second call trace further comprising; generating a second timestamp corresponding to a second time at which the second system call is executed; and generating a second identifier comprising at least one of the group consisting of a calling routine identifier, a thread identifier, and a process identifier for the software program that executes the second system call; identifying a first power consumption level of the component and a first duration of the first power consumption level during the first system call based on the first call trace and a first power state in a model stored in a first memory; identifying a second power consumption level of the component and a second duration of the second power consumption level that occurs after completion of the first system call and prior to executing the program instructions corresponding to the second system call based on a second power state in the model, the first time stamp, the first duration, and the second timestamp; identifying a third power consumption level of the component and a third duration of the third power consumption level during the second system call based on the second call trace and the first power state in the model; identifying a fourth power consumption level of the component and a fourth duration of the fourth power consumption level that occurs after completion of the second system call based on the second power state in the model; generating an energy usage profile for the software program associating the first identifier with an estimate of energy consumption of the component in response to the execution of the first system call based on the first power consumption level and the first duration and the second power consumption level and the second duration; generating the energy usage profile for the software program associating the second identifier with another estimate of energy consumption of the component in response to the execution of the second system call based on the on the third power consumption level and the third duration and the fourth power consumption level and the fourth duration; and storing the energy usage profile in a second memory. - View Dependent Claims (2)
-
-
3. A method for generating an energy usage profile in a computing device comprising:
-
executing program instructions corresponding to a wake lock acquire system call in the software program with a processor in the computing device, a component that consumes power in response to the wake lock acquire system call in the computing device transitioning from a first power consumption level corresponding to a first power state in a model stored in a memory of the computing device to a second power consumption level corresponding to a second power state in the model stored in the memory of the computing device in response to the execution of the wake lock acquire system call, the second power consumption level being higher than the first power consumption level; generating a first call trace of the execution of the wake lock acquire system call with the processor, the generation of the first call trace further comprising; generating a first timestamp corresponding to a first time at which the wake lock acquire system call is executed; and generating a first identifier comprising at least one of the group consisting of a calling routine identifier, a thread identifier, and a process identifier for the software program that executes the wake lock acquire system call; executing program instructions corresponding to a wake lock release system call in the software program with the processor in the computing device, the component in the computing device transitioning from the second power state to the first power state in response to the execution of the wake lock release system call; generating a second call trace of the execution of the wake lock release system call with the processor, the generation of the second call trace further comprising; generating a second timestamp corresponding to a second time at which the wake lock release system call is executed; and generating a second identifier comprising at least one of the group consisting of a calling routine identifier, a thread identifier, and a process identifier for the software program that executes the wake lock release system call; generating an energy usage profile for the software program associating the first identifier and an estimate of energy consumption of the component in the computing device in response to the execution of the wake lock acquire system call based at least in part on the power consumption level of the second power state and an elapsed time from the first timestamp to the second timestamp; and storing the energy usage profile in a memory. - View Dependent Claims (4, 5, 6, 7, 8)
-
-
9. A system for generation of an energy usage profile in a computing device comprising:
-
a memory configured to store; programmed instructions corresponding to an operating system; programmed instructions corresponding to a user program; and data corresponding to a model of power states corresponding to a component in the computing device; a processor operatively connected to the memory; a component connected to the processor to enable the processor to communicate with the component; and the processor being configured to; execute the programmed instructions corresponding to a first system call in the user program, the processor operating the component that consumes power in the computing device in response to execution of the first system call; generate a first call trace of the execution of the first system call with the operating system, the processor being further configured to; generate a first timestamp corresponding to a first time at which the first system call is executed; and generate a first identifier comprising at least one of the group consisting of a calling routine identifier, a thread identifier, and a process identifier for the software program that executes the first system call; identify a first power consumption level of the component and a first duration of the first power consumption level in response to execution of the first system call based on a first power state in the model; identify a second power consumption level of the component and a second duration of the second power consumption level in response to execution of the first system call based on a second power state in the model, the component entering the second power state after the first power state; execute programmed instructions corresponding to a second system call in the user program, the processor operating the component that consumes power in the computing device in response to execution of the second system call; generate a second call trace of the execution of the second system call with the operating system, the processor being further configured to; generate a second timestamp corresponding to a second time at which the second system call is executed; and generate a second identifier comprising at least one of the group consisting of a calling routine identifier, a thread identifier, and a process identifier for the software program that executes the second system call; identify the first power consumption level of the component and a third duration of the first power consumption level in the first power state in response to execution of the second system call based on the model stored in the memory; identify that the second system call enters the first power state during the first duration of the first system call in response to the second timestamp occurring after the first timestamp during the first duration; identify a first extended duration for the first power consumption level of the component corresponding to the first power state based on a portion of the first duration of the first power state for the first system call that overlaps with the second duration of the first power state for the second system call; identify a second extended duration for the first power consumption level of the component for the second system call based on a portion of the second duration for the second system call that overlaps with the first duration for the first system call; generate an energy usage profile for the software program associating the first identifier with an estimate of energy consumption of the component in the computing device in response to the execution of the first system call based at least in part on the first power consumption level, the first duration, the second power consumption level, and the second duration in response to a time corresponding to the first extended duration after the first timestamp being later than another time corresponding to the second extended duration after the second timestamp; generate the energy usage profile for the software program associating the second identifier with another estimate of energy consumption of the component in the computing device in response to the execution of the second system call based on only the first power consumption level and the third duration in response to the time corresponding to the first extended duration after the first timestamp being later than another time corresponding to the second extended duration after the second timestamp; and store the energy usage profile in the memory. - View Dependent Claims (10, 11)
-
Specification