Patent ID: 7337433

Claim:
A method for real-time power profiling of a target system comprising the steps of: instrumenting an embedded application to be executed on the target system to capture task execution data by replacing an address of a task switch hook function with an address of a trigger function such that the trigger function is called at each task context switch, and replacing an address of a task create hook function with an address of a task creation support function such that the task creation support function is called when each task is created; generating the task execution data as each task is executed on the target system and as each task is created on the target system, wherein the task execution data comprises a set of task handles wherein each task handle is a task creation handle or a task execution handle taken in the order each task was created or executed; capturing power measurement data as each task is executed on the target system, wherein the power measurement data comprises a set of power measurements in the order each power measurement was taken wherein each power measurement in the set corresponds to an execution period of an executed task; receiving the task execution data on a host system as the task execution data is generated without halting the embedded application; and correlating the task execution data with the power measurement data to determine a power consumption for each task, wherein the step of correlating comprises: for each task handle in turn of the set of task handles if the task handle is a task creation handle then a. creating a Profile Task object; b. adding the Profile Task object to an array of Profile Task objects; and c. if a hash table has an entry for a task associated with the task handle then c1. replacing the entry with the Profile Task object else c2. adding an entry to the hash table for the task associated with the task handle and placing the Profile Task object in the entry; and if the task handle is a task execution handle then a. locating a Profile Task object within the array of Profile Task objects for the task associated with the task handle using the hash table; and b. attributing a next power measurement of the set of power measurements to the task associated with the Profile Task object.