Software instrumentation method and apparatus
AssigneeOPNET Technologies, Inc.
InventorsRalph L. Beck, Michael Walter Romanchuk
Life of this patent
Estimating the term…
Abstract
Methods and an apparatus for instrumenting object oriented software that do not require modification to existing source code or to executable files, nor do they require modification to any existing sequences of object resident instructions. Methods include the class interceptor, doppelganger and method hijacking software instrumentation techniques. The class interceptor technique intercepts and monitors the paths of execution associated with methods inherited by a target class. The class doppelganger technique intercepts and monitors the paths of execution entering a target class. The method hijacking technique creates and adds instrumented methods directly to a target class.
Claims14
A method for instrumenting object-oriented virtual-machine-executable software comprised of class files containing bytecode including instructions, each class file being defined by a class and each class being associated with a class-hierarchy location and having a corresponding class name, the method comprising the steps of:
- (a) identifying a class included in the software as a target class wherein the target class is associated with a first class-hierarchy location and with a first class name;
- (b) instrumenting the target class by one of
- (i) creating a new instrumented class separate from the target class, adding instrumentation to the new instrumented class, and assigning the new instrumented class to a class-hierarchy location adjacent to and above the first class-hierarchy location of the target class, whereby the instructions of the target class remain in an original, unmodified form;
- and
- (ii) creating a new instrumented class separate from the target class, adding instrumentation to the new instrumented class, and assigning the new instrumented class to a class-hierarchy location adjacent to and below the first class-hierarchy location of the target class, assigning the first class name to the new instrumented class and assigning a second class name to the target class whereby the instructions of the target class remain in an original, unmodified form;
- and
- (iii) creating an instrumented class of the target class by adding instrumentation to the target class without modifying the instructions within the target class and retaining the first class name for the new instrumented class, whereby the target class becomes the instrumented class and the instructions of the target class remain in an original, unmodified form;
- and,
- (c) causing a virtual machine to process the class having the first class name as the target class.
An apparatus for instrumenting object oriented virtual-machine-executable software comprised of class files containing bytecode including instructions, each class file being defined by a class and associated with a class-hierarchy location and having a corresponding class name, comprising:
- (a) a target class identifier that identifies a class included in the software as a target class wherein the target class is associated with a first class-hierarchy location and with a first class name;
- (b) an instrumenter instrumenting the bytecode of the target class by one of
- (i) creating a new instrumented class separate from the target class, adding instrumentation to the new instrumented class, and assigning the new instrumented class to a class-hierarchy location adjacent to and above the first class-hierarchy location of the target class, whereby the instructions of the target class remain in an original, unmodified form;
- (ii) creating a new instrumented class separate from the target class, adding instrumentation to the new instrumented class, and assigning the new instrumented class to a class-hierarchy location adjacent to and below the first class-hierarchy location of the target class, assigning the first class name to the new instrumented class and assigning a second class name to the target class, whereby the instructions of the target class remain in original, unmodified form;
- and
- (iii) creating an instrumented class of the target class by adding instrumentation to the target class without modifying the instructions within the target class and retaining the first class name for the new instrumented class, whereby the target class becomes the instrumented class and the instructions of the target class remain in the original, unmodified form;
- and,
- (c) a virtual machine for processing the class having the first name as the target class.
Dependencies are inferred from the claim text.