System and method for measuring code segment performance
First Claim
1. A method of monitoring performance of a program executing in a computer, comprising:
- installing a uniquely identifiable probe at each of N probe points (N≧
2) by;
copying an original instruction at the probe point to a corresponding probe function;
modifying the original instruction path to branch to said probe function prior to the original instruction; and
configuring said probe function to return to the original instruction path; and
during execution of a first probe function corresponding to a first probe point;
updating a first timestamp associated with the first probe point with a current timestamp; and
for each of N-1 other probe points;
retrieving another timestamp associated with another probe point that preceded the first probe point during execution of the program; and
updating a probe path matrix on a computer readable medium to reflect the time difference between said current timestamp and said retrieved timestamp.
2 Assignments
0 Petitions
Accused Products
Abstract
A system and methods are provided for inserting probe points into an executing program, and measuring the time spent traversing code paths from one probe point to any other probe point or some other performance metric (e.g., instructions executed, cache misses, memory addresses accessed). One method is implemented by inserting N probes. Each probe has a corresponding function configured to: retrieve the identifier and timestamp of the previous probe executed, calculate the time spent traversing the path from the previous probe to the current probe, and update a matrix of N×N elements, wherein each element corresponds to a path from one probe to another probe. After completion of the program, this matrix is useful for identifying code paths that are bottlenecks and hence candidates for optimization.
35 Citations
40 Claims
-
1. A method of monitoring performance of a program executing in a computer, comprising:
-
installing a uniquely identifiable probe at each of N probe points (N≧
2) by;copying an original instruction at the probe point to a corresponding probe function; modifying the original instruction path to branch to said probe function prior to the original instruction; and configuring said probe function to return to the original instruction path; and during execution of a first probe function corresponding to a first probe point; updating a first timestamp associated with the first probe point with a current timestamp; and for each of N-1 other probe points; retrieving another timestamp associated with another probe point that preceded the first probe point during execution of the program; and updating a probe path matrix on a computer readable medium to reflect the time difference between said current timestamp and said retrieved timestamp. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A computer readable storage medium storing instructions that, when executed by a computer, cause the computer to perform a method of monitoring performance of a program executing in a computer, the method comprising:
-
installing a uniquely identifiable probe at each of N probe points (N≧
2) by;copying an original instruction at the probe point to a corresponding probe function; modifying the original instruction path to branch to said probe function prior to the original instruction; and configuring said probe function to return to the original instruction path; and during execution of a first probe function corresponding to a first probe point; updating a first timestamp associated with the first probe point with a current timestamp; and for each of N-1 other probe points; retrieving another timestamp associated with another probe point that preceded the first probe point during execution of the program; and updating a probe path matrix on a computer readable medium to reflect the time difference between said current timestamp and said retrieved timestamp.
-
-
10. A method of monitoring performance of a program executing in a computer system, comprising:
-
installing a uniquely identifiable probe at each of N probe points (N≧
2) by;copying an original instruction at the probe point to a corresponding probe function; modifying the original instruction path to branch to said probe function prior to the original instruction; and configuring said probe function to return to the original instruction path; and during execution of a first probe function corresponding to a first probe point; obtaining a measurement of a predetermined performance metric of the computer system; updating a first performance metric measurement associated with the first probe point; and for each of the N-1 other probe points; retrieving another performance metric measurement associated with another probe point executed before the first probe point; and updating a matrix on a computer readable medium to reflect a difference between said first performance metric and said other performance metric. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. A computer readable storage medium storing instructions that, when executed by a computer, cause the computer to perform a method of monitoring performance of a program executing in a computer system, the method comprising:
-
installing a uniquely identifiable probe at each of N probe points (N≧
2) by;copying an original instruction at the probe point to a corresponding probe function; modifying the original instruction path to branch to said probe function prior to the original instruction; and configuring said probe function to return to the original instruction path; and during execution of a first probe function corresponding to a first probe point; obtaining a measurement of a predetermined performance metric of the computer system; updating a first performance metric measurement associated with the first probe point; and for each of the N-1 other probe points; retrieving another performance metric measurement associated with another probe point executed before the first probe point; and updating a matrix on a computer readable medium to reflect a difference between said first performance metric and said other performance metric.
-
-
20. A computer readable storage medium containing a data structure configured for facilitating the measurement of an amount of time spent traversing a path of execution of a computer program, the data structure comprising:
-
an array configured to store N timestamps, wherein each said timestamp reflects a most recent time of execution of a corresponding one of N probes inserted into the computer program; an identifier configured to identify which of said N probes was executed most recently; and an N×
N array of path elements, wherein each said path element corresponds to a path from a first of said N probes to a second of said N probes and comprises;a number of times said path has been traversed; and the total amount of time spent traversing said path during said number of times; wherein said N×
N array of path elements is updated each time one of said N probes is executed.
-
-
21. A computer readable storage medium containing a data structure configured to facilitate the measurement of the performance of a portion of a computer program, the data structure comprising:
-
an array configured to store N measurements of a predetermined performance metric, wherein each said measurement reflects a measure of the performance metric at the time of execution of a corresponding one of N probes inserted into the computer program; an identifier configured to identify which of said N probes was executed most recently; and an N×
N array of path elements, wherein each said path element corresponds to a path from a first of said N probes to a second of said N probes and comprises;a number of times said path has been traversed; and the accumulated differences between said performance metric measurement at the time of execution of the first probe and said performance metric measurement at the time of execution of the second probe; wherein said N×
N array of path elements is updated each time one of said N probes is executed.
-
-
22. A computer system for measuring the time spent traversing a portion of a computer program, comprising:
-
a computer program comprising a series of processor executable instructions; an instrumentation module configured to insert N probes (N>
2) into the computer program;a processor configured to execute the computer program and said N probes; for each of said N probes, a corresponding probe function configured to generate a timestamp at which said probe is executed; and a data module tangibly embodied on a computer readable medium and configured to store; said timestamps of said probe executions; an identifier of the last probe executed; and for each pair of probes within said N probes, the number of times a program path between said pair of probes has been traversed and the accumulated amount of time spent traversing the program path; wherein said data module is updated each time one of said N probes is executed. - View Dependent Claims (23, 24, 25, 26, 27, 28, 29, 30, 31, 32)
-
-
33. A computer system for measuring resource usage of a computer program, comprising:
-
a computer program comprising a series of processor executable instructions; an instrumentation module configured to insert N probes (N>
2) into the computer program;a processor configured to execute the computer program and said N probes; for each of said N probes, a corresponding probe function configured to obtain a measurement of a performance metric of the computer system at the time said probe is executed; and a data module tangibly embodied on a computer readable medium and configured to store; said measurements of said performance metrics; an identifier of the last probe executed; and for each pair of probes within said N probes; the number of times a program path between said pair of probes has been traversed; and the accumulated differences between said performance metric measurements of said pair of probes during the number of times a program path between said pair of probes was traversed; wherein said data module is updated each time one of said N probes is executed. - View Dependent Claims (34, 35, 36, 37, 38, 39, 40)
-
Specification