Systems and methods of detecting power bugs
AssigneePurdue Research Foundation
InventorsYu Charlie Hu, Abhilash Jindal, Samuel Midkiff, Abhinav Pathak
Life of this patent
Estimating the term…
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.
Claims14
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.
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.
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.
Dependencies are inferred from the claim text.