Patent ID: 9087153
Filing Date: 2015-07-21
Classification: G06F

Abstract:
1. A method for recording an execution of a program instruction, the method comprising: receiving user interaction with a user interface of a code coverage tool, the user interaction specifying at least a set of thread recording criteria for a program unit of computer application program code; storing, based on the received user interaction, a code coverage registration entry in a code coverage registration table, the code coverage registration entry comprising registration details of a set of instructions in the program unit of computer application program code, the registration details comprising indication of instruction execution recording criteria for the set of instructions in the program unit and indication of a set of thread recording criteria for the program unit, at least the set of thread recording criteria for the program unit being specified by the user interaction; storing, based on the stored code coverage registration entry, a table comprising flags representing the set of instructions in the program unit, each flag corresponding to an instruction in the program unit, a value of each flag in the table indicating whether a corresponding instruction in the set of instructions in the program unit has been executed; updating, based on the stored code coverage registration entry, operating system data structures that manage computer programs on the operating system to reserve the program unit for code coverage collection, the updating comprising: determining, with the second at least one system hook and based on the registration details stored in the code coverage registration entry and the updated operating system data structures including the updated at least one entry in the system program table, and independent of instrumentation within the computer application program code, that a thread has entered the program unit that has been selected for recording an execution of an instruction in the set of instructions in the program unit; determining, based on the registration details stored in the code coverage registration entry and on the determination that the thread has entered the program unit, whether the thread is associated with at least one attribute that matches the set of thread recording criteria; and at least one of dynamically activating and deactivating, in response to determining whether the at least one attribute of the thread matches the set of thread recording criteria and that the thread is in the program unit, an instruction recording mechanism for the thread, a dynamically activated instruction recording mechanism using the start address stored in the at least one entry in the system program table and the instruction address of a fetched instruction in the code of the program unit to index to a corresponding flag in the table comprising flags.