Detection of method calls to streamline diagnosis of custom code through dynamic instrumentation
First Claim
1. A computer-implemented method, comprising:
- identifying a method to analyze in an application;
determining a class of the method to analyze from among loaded classes in memory;
loading a byte code representation of the class of the method to analyze from a resource location;
parsing the byte code representation of the class of the method to analyze, the parsing identifies an instance of an invoke byte code in the byte code representation of the class of the method to analyze;
based on the instance of the invoke byte code in the byte code representation of the class of the method to analyze, identifying a child referenced method of, the method to analyze;
storing the child referenced method as a string;
determining a class of the child referenced method;
loading a byte code representation of the class of the child referenced method from a resource location;
parsing the byte code representation of the class of the child referenced method to identify an instance of an invoke byte code in the byte code representation of the class of the child referenced method;
based on the instance of the invoke byte code in the byte code representation of the class of the child referenced method, identifying a grandchild referenced method of the method to analyze; and
storing the grandchild referenced method as a string.
2 Assignments
0 Petitions
Accused Products
Abstract
A technique for analyzing software in which un-instrumented components can be discovered and dynamically instrumented during a runtime of the software. Initially, an application configured with a baseline set of instrumented components such as methods. As the application runs, performance data is gathered from the instrumentation, and it may be learned that the performance of some methods is an issue. To analyze the problem, any methods which are callable from a method at issue are discovered by inspecting the byte code of loaded classes in a JAVA Virtual Machine (JVM). Byte code of the class is parsed to identify opcodes which invoke byte code to call other methods. An index to an entry in a constants pool table is identified based on an opcode. A decision can then be made to instrument and/or report the discovered methods.
64 Citations
19 Claims
-
1. A computer-implemented method, comprising:
-
identifying a method to analyze in an application; determining a class of the method to analyze from among loaded classes in memory; loading a byte code representation of the class of the method to analyze from a resource location; parsing the byte code representation of the class of the method to analyze, the parsing identifies an instance of an invoke byte code in the byte code representation of the class of the method to analyze; based on the instance of the invoke byte code in the byte code representation of the class of the method to analyze, identifying a child referenced method of, the method to analyze; storing the child referenced method as a string; determining a class of the child referenced method; loading a byte code representation of the class of the child referenced method from a resource location; parsing the byte code representation of the class of the child referenced method to identify an instance of an invoke byte code in the byte code representation of the class of the child referenced method; based on the instance of the invoke byte code in the byte code representation of the class of the child referenced method, identifying a grandchild referenced method of the method to analyze; and storing the grandchild referenced method as a string. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 14)
-
-
11. A computer-implemented method, comprising:
-
identifying an instrumented method to analyze in a first instance of an application at a first application server; determining a class of the instrumented method from among loaded classes in memory; loading a byte code representation of the class from a resource location; parsing the byte code representation of the class to identify an instance of an invoke byte code; based on the instance of the invoke byte code, identifying an un-instrumented method which is referenced by the instrumented method; and reporting the un-instrumented method from the first application server to a central manager, the central manager pushes an identification of the un-instrumented method to a second instance of the application at a second application server. - View Dependent Claims (12, 13)
-
-
15. A tangible computer-readable memory comprising computer readable software embodied thereon for programming a processor to perform a method, the method comprising:
-
loading code of an application into memory of a computer system, the loading comprises configuring the code of the application with a baseline set of instrumented components comprising instrumented methods, the code of the application also comprises un-instrumented methods; while executing the code of the application in the memory, obtaining performance data from the instrumented methods; based on the performance data, selecting an instrumented method of the instrumented methods to analyze; based on the selecting, identifying a referenced method of the un-instrumented methods which is referenced by the instrumented method to analyze, the identifying the referenced method comprises; determining a class of the instrumented method to analyze from among loaded classes in the memory; loading a byte code representation of the class into the memory from a resource location; parsing the byte code representation of the class to identify an instance of an invoke byte code; and identifying the referenced method based on the instance of the invoke byte code; and providing information to assist in a determination of whether to add instrumentation to the referenced method, the information indicates at least one of whether the referenced method should not be instrumented, whether the referenced method is already instrumented or whether the referenced method refers to an interface. - View Dependent Claims (16)
-
-
17. A system, comprising:
-
a processor-readable storage device comprising instructions; and a processor, the processor configured to execute the instructions to; determine a class of a method of an application from among loaded classes of the application in memory; load a byte code representation of the class from a resource location; parse the byte code representation of the class to identify an instance of an invoke byte code; based on the instance of the invoke byte code, identify a referenced method; store the referenced method as a string; and provide information to assist in a determination of whether to add instrumentation to the referenced method, the information indicates at least one of whether the referenced method should not be instrumented, whether the referenced method is already instrumented or whether the referenced method refers to an interface. - View Dependent Claims (18, 19)
-
Specification