IP Library Granted Patent US 7,962,905
Granted Patent B2
US 7,962,905 · App. 11/854,640 · Granted Jun 14, 2011

Flexible and extensible java bytecode instrumentation system

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,962,905
App. No.
11/854,640
Granted
Jun 14, 2011
Kind
B2
Abstract

Code can be injected into a compiled application through the use of probes comprised of instrumentation code. Probes can be implemented in a custom high level language that hides low level instruction details. A directive file contains instructions on injecting a probe into a compiled application. An instrumentation engine reads these instructions and injects the probe into the compiled application at the appropriate injection points. Multiple probes can be used, and can be stored in a probe library. Each probe can inject code into the application at, for example, a package, class, method, or line of the compiled application. Calls can also be made to external runtime libraries.

Claims (45)

1. A computer implemented system for injecting code into a compiled software application, comprising:

a computer including a processor and computer-readable medium for storage of

a software application source code that is written in a high-level language and includes a plurality of classes, and

a compiled software application that includes a plurality of compiled classes corresponding to the source code;

a probe library containing a plurality of probes written in a high-level Probe Description Language (PDL) which is distinct from the source code language, wherein each probe is a unit of instrumentation code that can be injected into the compiled software application at a particular location, and wherein PDL enables each probe to invoke arbitrary runtime compiled classes to implement arbitrary functionality;

a directive file containing instructions on injecting one or more of said probes into the compiled software application, including indicating which probes are to be inserted into which classes; and

an instrumentation engine for reading the instructions in the directive file and injecting any probe indicated thereby into the corresponding compiled software application.

2. A computer implemented system according to claim 1 , wherein said probe is adapted to inject code into at least one of a package, class, method, and line of said compiled application.

3. A computer implemented system according to claim 1 , further comprising a user interface for allowing a user to create said directive file.

4. A computer implemented system according to claim 3 , wherein said user interface comprises an instrumentation directive.

5. A computer implemented system according to claim 3 , wherein said user interface comprises a text file in XML.

6. A computer implemented system according to claim 1 , further comprising a global configuration file for storing global configuration parameters for said system.

7. A computer implemented system according to claim 1 , further comprising external runtime libraries to which the user can call to implement additional functionality.

8. A computer implemented system according to claim 1 , wherein said compiled application contains compiled class files, and said implementation engine is adapted to accept a compiled class file and produce a functionally equivalent instrumented class using said probe.

9. A computer implemented method for injecting code into a compiled software application, comprising:

providing a computer including a processor and computer-readable medium for storage of a software application source code that includes a plurality of classes, and a compiled software application that includes a plurality of compiled classes corresponding to the source code:

reading a directive file containing instructions on injecting one or more probes into the compiled software application, including indicating which probes are to be inserted into which classes;

reading probe specifications from a probe library containing a plurality of probes written in a probe description language, wherein each probe is a unit of instrumentation code that can be injected into the compiled software application at a particular location;

interpreting the probe specifications into byte code; and

injecting the byte code into method bodies within the classes at specific injection points, as indicated by the directive file.

10. A computer implemented method according to claim 9 , further comprising: specifying injection points in the application at which to inject the byte code.

11. A method according to claim 9 , further comprising: specifying classes and injection points to the injection engine through a directive file.

12. A method according to claim 9 , further comprising: reading global information from a global configuration file before injecting said byte code.

13. A method according to claim 9 , further comprising: implementing additional functionality by calling external run-time libraries.

14. A computer readable medium including instructions stored thereon which when read and executed by a computer cause the computer to perform the steps comprising:

providing a software application source code that is written in a high-level language and includes a plurality of classes, and a compiled software application that includes a plurality of compiled classes corresponding to the source code;

reading a directive file containing instructions on injecting one or more probes into the compiled software application, including indicating which probes are to be inserted into which classes;

reading probe specifications from a probe library containing a plurality of probes written in a high-level Probe Description Language (PDL) which is distinct from the source code language, wherein each probe is a unit of instrumentation code that can be injected into the compiled software application at a particular location;

interpreting the probe specifications into byte code; and

injecting the byte code into method bodies within the classes at specific injection points, as indicated by the directive file.

15. A computer readable medium according to claim 14 , further comprising: specifying injection points in the application at which to inject the byte code.

16. A computer readable medium according to claim 14 , further comprising: specifying classes and injection points to the injection engine through a directive file.

17. A computer readable medium according to claim 14 , further comprising: reading global information from a global configuration file before injecting said byte code.

18. A computer readable medium according to claim 14 , further comprising: implementing additional functionality by calling external run-time libraries.

19. A system for injecting instrumentation code into a compiled software application, comprising:

a computer including a processor and computer-readable medium for storage of

a software application source code that is written in a high-level language and includes a plurality of classes, and

a compiled software application that includes a plurality of compiled classes corresponding to the source code;

a probe library that contains a plurality of probes written in a high-level Probe Description Language (PDL) which is distinct from the source code language, wherein each probe is a unit of instrumentation code that can be injected into the compiled software application at a particular location, and wherein PDL enables each probe to invoke arbitrary runtime compiled classes to implement arbitrary functionality;

directives for injecting one or more of said probes into the compiled software application, at indicated classes; and

wherein the system reads the directives and injects probes indicated thereby into the corresponding classes of the compiled software application.

20. A method for injecting instrumentation code into a compiled software application, comprising the steps of:

providing a computer including a processor and computer-readable medium for storage of a software application source code that is written in a high-level language and includes a plurality of classes, and a compiled software application that includes a plurality of compiled classes corresponding to the source code;

providing a probe library that contains a plurality of probes written in a high-level Probe Description Language (PDL) which is distinct from the source code language, wherein each probe is a unit of instrumentation code that can be injected into the compiled software application at a particular location, and wherein PDL enables each probe to invoke arbitrary runtime compiled classes to implement arbitrary functionality; and

reading directives for injecting one or more of said probes into the compiled software application, at indicated classes, and injecting probes indicated thereby into the corresponding classes of the compiled software application.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 15, 2010
From: BEA SYSTEMS, INC.
To: ORACLE INTERNATIONAL CORPORATION
Reel/Frame 025192/0244 →