IP Library Granted Patent US 10,379,925
Granted Patent B2
US 10,379,925 · App. 15/357,473 · Granted Aug 13, 2019

Systems and methods of detecting power bugs

Inventors: Yu Charlie Hu (West Lafayette, IN); Abhilash Jindal (West Lafayette, IN); Samuel Midkiff (West Lafayette, IN); Abhinav Pathak (San Jose, CA)
Assignee: Purdue Research Foundation
G06F11/0742G06F1/28G06F1/3296G06F8/20G06F8/433G06F11/079G06F11/0751G06F11/0793G06F11/3604G06F11/3608G06F11/3636G06F11/3664G06F11/3466
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,379,925
App. No.
15/357,473
Granted
Aug 13, 2019
Kind
B2
Abstract

Embodiments of the present invention provide a system and methods for detecting power bugs. In one embodiment, a computer-implemented method for analyzing a computer code includes generating a control flow graph for at least a portion of the computer code at a processor. The method further includes identifying power bugs by traversing the control flow graph if the control flow graph exits without performing a function call to deactivate power to any component of a device configured to execute computer executable instructions based on the compute code after performing a function call to activate power.

Claims (48)

1. A computer-implemented method for analyzing a computer code, the method comprising:

at a processor, generating a control flow graph for at least a portion of the computer code; and

identifying power bugs by traversing the control flow graph to identify if the control flow graph exits without performing a function call to deactivate power to any component of a device configured to execute computer executable instructions based on the computer code after performing a function call to activate power,

wherein the step of identifying power bugs comprises applying a forward dataflow analysis,

wherein applying the forward dataflow analysis comprises

applying a depth-first search analysis to identify any mismatch in definitions relating to function calls for activating or deactivating power; and

wherein applying the depth-first search analysis comprises:

identifying any functions calls in the control flow graph for activating power,

performing a depth-first search traversal of the control flow graph from each function call for power activation to determine if there exists a path from the function call to an EXIT block of the control flow graph that does not include a function call for power deactivation, and wherein performing the depth-first search traversal comprises starting from the block in the graph containing the function call for power activation and exploring the graph as far as possible along each branch before backtracking, wherein if a block containing a function call for power deactivation is found the search does not visit neighboring blocks of the block, wherein if an EXIT block is found a power bug is reported, wherein if a block is visited that has been visited before the traversal does not re-visit the neighboring blocks of the previous visited block, and

identifying a power bug if any path from a power activation function call reaches an EXIT block of the control flow graph without encountering a power deactivation function call.

2. The method of claim 1 , further comprising generating an error message if the control flow graph exits without performing a function call to deactivate power to any component.

3. The method of claim 2 , further comprising storing the error message in a non-transitory memory medium.

4. The method of claim 1 , wherein the computer executable instructions are configured to run on a power constrained device.

5. The method of claim 4 , wherein the function call to activate power comprises a function call to prevent the power constrained device from going to sleep, and wherein the function call to deactivate power comprises a function call to re-allow the power constrained device to go to sleep.

6. The method of claim 4 , further comprising:

receiving the computer code; and

removing the identified power bugs.

7. The method of claim 6 , further comprising:

after removing the identified power bugs, generating the computer executable instructions by compiling the computer code if the computer code exits after performing a function call to deactivate power to any component previously activated; and

storing the computer executable instructions in a non-transitory memory medium.

8. The method of claim 7 , further comprising:

providing an application comprising the computer executable instructions to a user device at an online market place.

9. The method of claim 1 , wherein applying the forward dataflow analysis comprises applying a live variable analysis, or an available expressions analysis.

10. The method of claim 1 , wherein the computer code is configured to execute as a single thread process.

11. The method of claim 1 , wherein generating the control flow graph comprises:

generating individual control flow graph for each event handler in the computer code comprising a plurality of event handlers; and

stitching together the individual control flow graphs.

12. The method of claim 1 , wherein computer code is configured to execute as a multi-threaded application.

13. A computing device comprising:

a processor configured to execute a debugging tool, the debugging tool configured to:

generate a control flow graph for at least a portion of a computer code, and

identify power bugs by detecting if the control flow graph exits without performing a function call for deactivating power to any component of a device configured to execute computer executable instructions based on the computer code by traversing the control flow graph after performing a function call to activate power, wherein the step of identify power bugs comprises apply a forward dataflow analysis,

wherein apply the forward dataflow analysis comprises

applying a depth-first search analysis to identify any mismatch in definitions relating to function calls for activating or deactivating power, and

wherein applying the depth-first search analysis comprises

identifying any functions calls in the control flow graph for activating power,

performing a depth-first search traversal of the control flow graph from each function call for power activation to determine if there exists a path from the function call to an EXIT block of the control flow graph that does not consist of any function call for power deactivation, and wherein performing the depth-first search traversal comprises starting from the block in the graph containing the function call for power activation and exploring the graph as far as possible along each branch before backtracking, wherein if a block containing a function call for power deactivation is found the search does not visit neighboring blocks of the block, wherein if an EXIT block is found a power bug is reported, wherein if a block is visited that has been visited before the traversal does not re-visit the neighboring blocks of the previous visited block, and

identifying a power bug if any path from a power activation function call reaches an EXIT block of the control flow graph without encountering a power deactivation function call.

14. A non-transitory storage medium comprising a debugging tool, the debugging tool configured to analyze a computer code by:

generating a control flow graph for at least a portion of the computer code; and

identifying power bugs by detecting if the control flow graph exits without performing a function call for deactivating power to any component of a device configured to execute computer executable instructions based on the computer code by traversing the control flow graph after performing a function call to activate power,

wherein the step of identifying power bugs comprises applying a forward dataflow analysis,

wherein applying the forward dataflow analysis comprises

applying a depth-first search analysis to identify any mismatch in definitions relating to function calls for activating or deactivating power, and

wherein applying the depth-first search analysis comprises

identifying any functions calls in the control flow graph for activating power,

performing a depth-first search traversal of the control flow graph from each function call for power activation to determine if there exists a path from the function call to an EXIT block of the control flow graph that does not consist of any function call for power deactivation, and wherein performing the depth-first search traversal comprises starting from the block in the graph containing the function call for power activation and exploring the graph as far as possible along each branch before backtracking, wherein if a block containing a function call for power deactivation is found the search does not visit neighboring blocks of the block, wherein if an EXIT block is found a power bug is reported, wherein if a block is visited that has been visited before the traversal does not re-visit the neighboring blocks of the previous visited block, and

identifying a power bug if any path from a power activation function call reaches an EXIT block of the control flow graph without encountering a power deactivation function call.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 19, 2022
From: HU, YU CHARLIE; MIDKIFF, SAMUEL; JINDAL, ABHILASH; PATHAK, ABHINAV
To: PURDUE RESEARCH FOUNDATION
Reel/Frame 058694/0016 →
CONFIRMATORY LICENSE Recorded May 31, 2017
From: PURDUE UNIVERSITY
To: NATIONAL SCIENCE FOUNDATION
Reel/Frame 042642/0649 →
Continuity (3)
Continuation 14313890 · Jun 24, 2014
Provisional Application 61839334 · Jun 25, 2013
Related Publication 20170068586A1 · Mar 9, 2017