Adaptive instrumentation runtime monitoring and analysis
First Claim
1. A method of instrumenting a program to provide instrumentation data for detecting memory leaks in the program, the method comprising:
- creating an instrumented version of the program comprising duplicate versions of at least some code paths in the program, such that a duplicate code path has an original version code path and an instrumented version code path with instrumentation code for capturing instrumentation data;
tracking a frequency of execution of the code paths;
when a code path is to be executed, determining to dispatch execution into the instrumented version code path at a sampling rate for the respective code path and otherwise into the original version code path such that, for a given sampling rate, a ratio of a number of executions of the instrumented version code path to a total number of executions of both the instrumented version code path and the original version code path is equivalent to the given sampling rate;
adapting the sampling rate for the code paths according to the frequency of execution of the code paths, such that, after adapting, the ratio of a number of executions of the instrumented version code path to a total number of executions of the code path is equivalent to the adapted sampling rate, wherein the sampling rate for executing the code paths is adapted such that the adapted sampling rate is inversely related to the frequency of execution of the code paths;
storing instrumentation data obtained by execution of the instrumented version of the software; and
reporting all objects that, according to the instrumentation data, satisfy a predefined staleness condition as memory leaks, wherein the predefined staleness condition comprises determining whether an object in the heap has been accessed within a predetermined length of time.
2 Assignments
0 Petitions
Accused Products
Abstract
Techniques described herein provide low-overhead adaptive instrumentation runtime monitoring and analysis of software. A method of instrumenting a program to provide instrumentation data creates instrumentation versions comprising duplicate versions of original procedures in the program with instrumentation code for capturing instrumentation data, and adaptively decreases the sampling rate of the instrumented version of a procedure as the frequency of execution of the procedure increases. Additionally, the instrumentation methods can be used to build runtime tools that monitor the correctness of a program with very little overhead.
-
Citations
25 Claims
-
1. A method of instrumenting a program to provide instrumentation data for detecting memory leaks in the program, the method comprising:
-
creating an instrumented version of the program comprising duplicate versions of at least some code paths in the program, such that a duplicate code path has an original version code path and an instrumented version code path with instrumentation code for capturing instrumentation data; tracking a frequency of execution of the code paths; when a code path is to be executed, determining to dispatch execution into the instrumented version code path at a sampling rate for the respective code path and otherwise into the original version code path such that, for a given sampling rate, a ratio of a number of executions of the instrumented version code path to a total number of executions of both the instrumented version code path and the original version code path is equivalent to the given sampling rate; adapting the sampling rate for the code paths according to the frequency of execution of the code paths, such that, after adapting, the ratio of a number of executions of the instrumented version code path to a total number of executions of the code path is equivalent to the adapted sampling rate, wherein the sampling rate for executing the code paths is adapted such that the adapted sampling rate is inversely related to the frequency of execution of the code paths; storing instrumentation data obtained by execution of the instrumented version of the software; and reporting all objects that, according to the instrumentation data, satisfy a predefined staleness condition as memory leaks, wherein the predefined staleness condition comprises determining whether an object in the heap has been accessed within a predetermined length of time. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A method for bursty tracing to detect memory leaks in software by adapting a sampling rate of executing instrumented procedures in the software during runtime, the method comprising:
-
creating an instrumented version of the software containing an original version and an instrumented copy version of each procedure in the software, wherein only one version of the each procedure will be executed each time when the each procedure is required to execute during the runtime; executing the instrumented version of the software; tracking frequency of execution of the procedures, wherein the instrumented copy version of the procedures are sampled at rates adjusted to be inversely related to the frequency of execution of the procedures, including; sampling at higher rates for the procedures whose total number of executions of both the original versions and the copy versions are executed less frequently, and sampling at lower rates for procedures whose total number of execution of both the original versions and the copy versions are executed more frequently, wherein the sampling rate for a given procedure comprises a number of executions of the instrumented version of the procedure taken as percentage of total number of executions of both versions of the procedure; storing instrumentation data obtained by execution of the instrumented version of the software; and reporting all objects that satisfy a predefined staleness condition as memory leaks, wherein the predefined staleness condition comprises determining whether an object in the heap has been accessed within a predetermined length of time. - View Dependent Claims (7, 8, 9)
-
-
10. A method of instrumenting a program to provide instrumentation data for detecting data races in the program, the method comprising:
-
creating an instrumented version of the program comprising duplicate versions of at least some code paths in the program, such that a duplicate code path has an original version code path and an instrumented version code path with instrumentation code for capturing instrumentation data; tracking a frequency of execution of the code paths; when a code path is to be executed, determining to dispatch execution into the instrumented version code path at a sampling rate for the respective code path and otherwise into the original version code path such that, for a given sampling rate, a ratio of a number of executions of the instrumented version code path to a total number of executions of both the instrumented version code path and the original version code path is equivalent to the given sampling rate; and adapting the sampling rate for the code paths according to the frequency of execution of the code paths, such that, after adapting, the ratio of a number of executions of the instrumented version code path to a total number of executions of the code path is equivalent to the adapted sampling rate, wherein the sampling rate for executing the code paths are adapted at a rate inversely related to the frequency of execution of the code paths; storing instrumentation data obtained by execution of the instrumented version of the software; and reporting variables, that, according to the instrumentation data, satisfy a predefined data race condition based on lock acquisitions and releases for the variables. - View Dependent Claims (11, 12, 13, 14, 15, 16)
-
-
17. A method for bursty tracing to detect data races in software by adapting a sampling rate of executing instrumented procedures in the software during runtime, the method comprising:
-
creating an instrumented version of the software containing an original version and an instrumented copy version of each procedure in the software, wherein only one version of the each procedure will be executed each time when the each procedure is required to execute during the runtime; executing the instrumented version of the software; tracking frequency of execution of the procedures, wherein the instrumented copy version of the procedures are sampled at rates adjusted to be inversely related to the frequency of execution of the procedures, including;
sampling at higher rates for the procedures whose total number of executions of both the original versions and the copy versions are executed less frequently, and sampling at lower rates for procedures whose total number of execution of both the original versions and the copy versions are executed more frequently, wherein the sampling rate for a given procedure comprises a number of executions of the instrumented version of the procedure taken as percentage of total number of executions of both versions of the procedure;storing instrumentation data obtained by execution of the instrumented version of the software; and reporting variables that, according to the instrumentation data, satisfy a predefined data race condition based on lock acquisitions and releases for the variables.
-
-
18. A method of instrumenting a program to provide instrumentation data for checking correctness of memory accesses in the program, the method comprising:
-
creating an instrumented version of the program comprising duplicate versions of at least some code paths in the program, such that a duplicate code path has an original version code path and an instrumented version code path with instrumentation code for capturing instrumentation data; tracking a frequency of execution of the code paths; when a code path is to be executed, determining to dispatch execution into the instrumented version code path at a sampling rate for the respective code path and otherwise into the original version code path such that, for a given sampling rate, a ratio of a number of executions of the instrumented version code path to a total number of executions of both the instrumented version code path and the original version code path is equivalent to the given sampling rate; and adapting the sampling rate for the code paths according to the frequency of execution of the code paths, such that, after adapting, the ratio of a number of executions of the instrumented version code path to a total number of executions of the code path is equivalent to the adapted sampling rate, wherein the sampling rate for executing the code paths are adapted at a rate inversely related to the frequency of execution of the code paths; storing instrumentation data obtained by execution of the instrumented version of the software; and reporting memory accesses, that, according to the instrumentation data, access memory locations incorrectly. - View Dependent Claims (19, 20, 21)
-
-
22. A method for bursty tracing to detect incorrect memory accesses in software by adapting a sampling rate of executing instrumented procedures in the software during runtime, the method comprising:
-
creating an instrumented version of the software containing an original version and an instrumented copy version of each procedure in the software, wherein only one version of the each procedure will be executed each time when the each procedure is required to execute during the runtime; executing the instrumented version of the software; tracking frequency of execution of the procedures, wherein the instrumented copy version of the procedures are sampled at rates adjusted to be inversely related to the frequency of execution of the procedures, including;
sampling at higher rates for the procedures whose total number of executions of both the original versions and the copy versions are executed less frequently, and sampling at lower rates for procedures whose total number of execution of both the original versions and the copy versions are executed more frequently, wherein the sampling rate for a given procedure comprises a number of executions of the instrumented version of the procedure taken as percentage of total number of executions of both versions of the procedure;storing instrumentation data obtained by execution of the instrumented version of the software; and reporting memory accesses, that, according to the instrumentation data, access memory locations incorrectly. - View Dependent Claims (23, 24, 25)
-
Specification