Patent ID: 9575864
Date: 2017-02-21
CPC Classifications: G06F

Claim:
1. A method for inserting instrumentation into a program, comprising: identifying a first function associated with the program; determining a first memory address within a system memory corresponding with a first machine instruction to be executed for the first function; inserting an instrumentation hook into the system memory based on the first memory address, the inserting an instrumentation hook includes writing a new instruction different from the first machine instruction into the system memory starting at the first memory address; acquiring profiling information for the first function during a particular time period in response to inserting the instrumentation hook into the system memory; determining that the first function ran within a baseline time duration during the particular time period based on the profiling information; removing the instrumentation hook from the system memory while the program is executing in response to determining that the first function ran within the baseline time duration; automatically inserting the instrumentation hook back into the system memory for a survey time period subsequent to the particular time period without user input; determining a second baseline time duration for the first function during the survey time period; and removing the instrumentation hook from the system memory while the program is executing in response to determining that the first function ran within the second baseline time duration.