Patent ID: 7823129

Claim:
A computer implemented method of instrumenting code for tracing of a program, comprising: identifying a hot spot method of the program executing on a processor; responsive to identifying the hot spot method, instrumenting the hot spot method; identifying a caller method that calls the hot spot method; responsive to identifying the caller method, instrumenting the caller method by inserting one or more hooks into the caller method; maintaining a list of callers of instrumented methods in a memory in communication with the processor; measuring at least one execution characteristic metric using the inserted one or more hooks in the caller method; storing the at least one execution characteristic metric in a storage device, in communication with the processor, for analyzing execution of the program and system resource usage; responsive to a determination that the at least one execution characteristic metric has been measured for a predetermine period; identifying at least one calling method that calls the caller method; instrumenting the at least one calling method; and removing the one or more hooks from the caller method.