Run-time wait tracing using byte code insertion
First Claim
Patent Images
1. A method of tracing run-time waits to measure time spent waiting due to synchronization, comprising steps of:
- programmatically performing code analysis prior to execution of an application, further comprising steps of;
comparing byte code of the application to stored patterns that describe known wait points where code may wait to get a monitor that synchronizes access to a shared resource, thereby locating one or more locations in the code where a wait due to synchronization may occur at run time; and
recording the located locations; and
programmatically instrumenting the located locations, during execution of the application at run time, further comprising steps of;
intercepting load requests for executable elements of the application, as each executable element is to be loaded for execution; and
invoking an augmented class loader to carry out each of the intercepted load requests, wherein the augmented class loader creates an instrumented version of the executable element that is to be loaded by consulting the recorded locations to determine ones thereof which are found in the executable element and programmatically inserting pre-invocation byte code before each of the determined ones and post-invocation byte code after each of the determined ones, wherein the pre-invocation byte code and the post-invocation byte code are executable to generate data for measuring the time spent waiting at each of the determined ones due to synchronization, and then loads the instrumented version for execution instead of loading the executable element.
3 Assignments
0 Petitions
Accused Products
Abstract
Methods, systems, computer program products, and methods of doing business whereby programmatically-generated byte code insertion is used to perform run-time tracing of code that potentially encounters a wait during execution. The byte code insertion is performed at load time, and inserts byte codes before and after a located (potential) wait point. The inserted byte code functions to gather execution statistics, such as a time stamp before invoking a located wait point and a time stamp after invoking the located wait point. Preferred embodiments allow this tracing to be selectively activated/deactivated.
40 Citations
25 Claims
-
1. A method of tracing run-time waits to measure time spent waiting due to synchronization, comprising steps of:
-
programmatically performing code analysis prior to execution of an application, further comprising steps of; comparing byte code of the application to stored patterns that describe known wait points where code may wait to get a monitor that synchronizes access to a shared resource, thereby locating one or more locations in the code where a wait due to synchronization may occur at run time; and recording the located locations; and programmatically instrumenting the located locations, during execution of the application at run time, further comprising steps of; intercepting load requests for executable elements of the application, as each executable element is to be loaded for execution; and invoking an augmented class loader to carry out each of the intercepted load requests, wherein the augmented class loader creates an instrumented version of the executable element that is to be loaded by consulting the recorded locations to determine ones thereof which are found in the executable element and programmatically inserting pre-invocation byte code before each of the determined ones and post-invocation byte code after each of the determined ones, wherein the pre-invocation byte code and the post-invocation byte code are executable to generate data for measuring the time spent waiting at each of the determined ones due to synchronization, and then loads the instrumented version for execution instead of loading the executable element. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A system for tracing run-time waits to measure time spent waiting due to synchronization in a computing environment, comprising:
-
means for programmatically performing code analysis prior to execution of an application, further comprising; means for comparing byte code of the application to stored patterns that describe known wait points where code may wait to get a monitor that synchronizes access to a shared resource, thereby locating one or more locations in the code where a wait due to synchronization may occur at run time; and means for recording the located locations; and means for programmatically instrumenting the located locations, during execution of the application at run time, further comprising; means for intercepting load requests for executable elements of the application, as each executable element is to be loaded for execution; and means for invoking an augmented class loader to carry out each of the intercepted load requests, wherein the augmented class loader creates an instrumented version of the executable element that is to be loaded by consulting the recorded locations to determine ones thereof which are found in the executable element and programmatically inserting pre-invocation byte code before each of the determined ones and post-invocation byte code after each of the determined ones, wherein the pre-invocation byte code and the post-invocation byte code are executable to generate data for measuring the time spent waiting at each of the determined ones due to synchronization, and then loads the instrumented version for execution instead of loading the executable element. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16)
-
-
17. A computer program product for tracing run-time waits to measure time spent waiting due to synchronization, the computer program product embodied on one or more computer-readable media and comprising:
computer-readable program code for programmatically performing code analysis prior to execution of an application, further comprising; computer-readable program code for comparing byte code of the application to stored patterns that describe known wait points where code may wait to get a monitor that synchronizes access to a shared resource, thereby locating one or more locations in the code where a wait due to synchronization may occur at run time; and computer-readable program code means for recording the located locations; and
computer-readable program code for programmatically instrumenting the located locations, during execution of the application at run time, further comprising;computer-readable program code for intercepting load requests for executable elements of the application, as each executable element is to be loaded for execution; and computer-readable program code for invoking an augmented class loader to carry out each of the intercepted load requests, wherein the augmented class loader creates an instrumented version of the executable element that is to be loaded by consulting the recorded locations to determine ones thereof which are found in the executable element and programmatically inserting pre-invocation byte code before each of the determined ones and post-invocation byte code after each of the determined ones, wherein the pre-invocation byte code and the post-invocation byte code are executable to generate data for measuring the time spent waiting at each of the determined ones due to synchronization, and then loads the instrumented version for execution instead of loading the executable element. - View Dependent Claims (18, 19, 20, 21, 22, 23, 24)
-
25. A method of doing business by tracing wait points in an executing application to measure time spent waiting due to synchronization, comprising steps of:
-
performing programmatic code analysis prior to execution of an application, further comprising steps of; programmatically comparing byte code of the application to stored patterns that describe known wait points where code may wait to get a monitor that synchronizes access to a shared resource, thereby locating one or more locations in the code where a wait due to synchronization may occur at run time; and programmatically recording the located locations; programmatically instrumenting the located locations, during execution of the application at run time, further comprising steps of; intercepting load requests for executable elements of the application, as each executable element is to be loaded for execution; and invoking an augmented class loader to carry out each of the intercepted load requests, wherein the augmented class loader creates an instrumented version of the executable element that is to be loaded by consulting the recorded locations to determine ones thereof which are found in the executable element and programmatically inserting pre-invocation byte code before each of the determined ones and post-invocation byte code after each of the determined ones, wherein the pre-invocation byte code and the post-invocation byte code are executable to generate data for measuring the time spent waiting at each of the determined ones due to synchronization, and then loads the instrumented version for execution instead of loading the executable element; executing the pre-invocation byte code and the post-invocation byte code to generate the data for measuring the time spent waiting at at least one of the determined ones due to synchronization; computing, from the generated data for each of the at least one of the determined ones, the time spent waiting at that determined one; programmatically recording, for each of the at least one of the determined ones, the computed time spent waiting; and charging a fee for carrying out the steps of performing programmatic code analysis, programmatically instrumenting, executing, computing, and programmatically recording.
-
Specification