# US 6,732,357 B1 · Determining and compensating for temporal overhead in trace record generation and processing

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 6,732,357 B1
- Document ID: US6732357B1
- Status: Granted
- Kind: B1
- Application number: 09/414,345
- Filed: 1999-10-07
- Granted: 2004-05-04
- Earliest claimed: 1997-12-12
- Assignees: International Business Machines Corporation
- Inventors: Robert Francis Berry; Jesse Mannes Gordon; Riaz Y. Hussain; Frank Eliot Levine; Robert J. Urquhart
- Web page: https://patentgrep.com/patent/US6732357B1

## CPC

- G06F 11/3636: {by tracing the execution of the program}
- G06F 11/3419: {by assessing time}
- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 2201/835: Timestamp
- G06F 2201/865: Monitoring of software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A program is profiled with enablement of trace record generation during a first period of time and with disablement of trace record generation during a second period of time. The number of trace records output during the first period of time is determined, and a trace overhead calibration value is computed as an average time for writing the number of trace records output during the first period of time. The trace overhead calibration value may be stored for subsequent use in a profiling-related process in the data processing system. The trace overhead compensation value represents the amount of time required to generate a trace record, and the trace times retrieved from the trace records are adjusted to compensate for the amount of time required to generate those trace records.

## Claims

### Claim 1

A method for determining temporal overhead in generating trace records in a data processing system, the method comprising the computer-implemented steps of:
profiling a program with enablement of trace record generation during a first time period;
profiling a program with disablement of trace record generation during a second time period;
obtaining a number of trace records generated during the first time period;
calculating a trace overhead time value as a difference in length between the first time period and the second time period;
computing a trace overhead calibration value as an average time for writing the number of trace records output during the trace overhead time value; and
storing the output overhead calibration value for subsequent use in a profiling-related process in the data processing system.

### Claim 2 (depends on 1)

The method of claim 1, wherein the step of profiling a program with enablement of trace record generation during the first time period further comprises:
retrieving a first start time;
executing the program during which trace records are generated;
retrieving a first end time; and
computing the first time period as a difference between the first start time and the first end time.

### Claim 3 (depends on 1)

The method of claim 1, wherein the step of profiling a program with disablement of trace record generation during the second time period further comprises:
retrieving a second start time;
executing the program during which trace records are not generated;
retrieving a second end time; and
computing the second time period as a difference between the first start time and the first end time.

### Claim 4

A method for processing trace data output in a data processing system, the method comprising the computer-implemented steps of:
reading a first timestamp from a first trace record and a second timestamp from a second trace record;
computing the difference between the two timestamps to obtain a delta time;
retrieving a trace overhead compensation value; and
adjusting the delta time by subtracting the trace overhead compensation value, wherein the trace overhead is determined by comparing a calibration run preceding a trace process.

### Claim 5 (depends on 4)

The method of claim 4, wherein a calibration run compares an execution time of a program with profiling and an execution time of the program without profiling.

### Claim 6 (depends on 5)

The method of claim 5 further comprising:
computing an average amount of time to generate a trace record during the calibration run.

### Claim 7 (depends on 4)

The method of claim 4 wherein the trace overhead compensation value is directly proportional to a time required to generate a trace record.

### Claim 8 (depends on 4)

The method of claim 4 wherein the first trace record and the second trace record are output to a trace file during execution of a profiling process in the data processing system.

### Claim 9 (depends on 4)

The method of claim 4 further comprising:
attributing the adjusted delta time to a routine whose execution caused the first trace record or the second trace record to be output.

### Claim 10 (depends on 4)

The method of claim 4 further comprising:
adjusting the delta time using a plurality of trace overhead compensation values.

### Claim 11 (depends on 4)

The method of claim 4 further comprising:
setting the adjusted delta time to zero if the adjusted delta time is negative.

### Claim 12

A data processing system for determining temporal overhead in generating trace records in the data processing system, the data processing system comprising:
first profiling means for profiling a program with enablement of trace record generation during a first time period;
second profiling means for profiling a program with disablement of trace record generation during a second time period;
obtaining means for obtaining a number of trace records generated during the first time period;
calculating means for calculating a trace overhead time value as a difference in length between the first time period and the second time period;
first computing means for computing a trace overhead calibration value as an average time for writing the number of trace records output during the trace overhead time value; and
storing means for storing the output overhead calibration value for subsequent use in a profiling-related process in the data processing system.

### Claim 13 (depends on 12)

The data processing system of claim 12, wherein the profiling means for profiling a program with enablement of trace record generation during the first time period further comprises:
first retrieving means for retrieving a first start time;
first executing means for executing the program during which trace records are generated;
second retrieving means for retrieving a first end time; and
second computing means for computing the first time period as a difference between the first start time and the first end time.

### Claim 14 (depends on 12)

The data processing system of claim 12, wherein the profiling means for profiling a program with disablement of trace record generation during the second time period further comprises:
third retrieving means for retrieving a second start time;
second executing means for executing the program during which trace records are not generated;
third retrieving means for retrieving a second end time; and
third computing means for computing the second time period as a difference between the first start time and the first end time.

### Claim 15

A data processing system for processing trace data output in the data processing system, the data processing system comprising:
reading means for reading a first timestamp from a first trace record and a second timestamp from a second trace record;
first computing means for computing the difference between the two timestamps to obtain a delta time;
retrieving means for retrieving a trace overhead compensation value; and
first adjusting means for adjusting the delta time by subtracting the trace overhead compensation value, wherein the trace overhead is determined by comparing a calibration run preceding a trace process.

### Claim 16 (depends on 15)

The data processing system of claim 15, wherein a calibration run compares an execution time of a program with profiling and an execution time of the program without profiling.

### Claim 17 (depends on 15)

The data processing system of claim 15 further comprising:
second computing means for computing an average amount of time to generate a trace record during the calibration run.

### Claim 18 (depends on 15)

The data processing system of claim 15 wherein the trace overhead compensation value is directly proportional to a time required to generate a trace record.

### Claim 19 (depends on 15)

The data processing system of claim 15 wherein the first trace record and the second trace record are output to a trace file during execution of a profiling process in the data processing system.

### Claim 20 (depends on 15)

The data processing system of claim 15 further comprising:
attributing means for attributing the adjusted delta time to a performance statistic for a routine whose execution caused the first trace record or the second trace record to be output.

### Claim 21 (depends on 15)

The data processing system of claim 15 further comprising:
second adjusting means for adjusting the delta time using a plurality of trace overhead compensation values.

### Claim 22 (depends on 15)

The data processing system of claim 15 further comprising:
setting means for setting the adjusted delta time to zero if the adjusted delta time is negative.

### Claim 23

A computer program product in a computer-readable medium for use in a data processing system for determining temporal overhead in generating trace records, the computer program product comprising:
first instructions for profiling a program with enablement of trace record generation during a first time period;
second instructions for profiling a program with disablement of trace record generation during a second time period;
third instructions for obtaining a number of trace records generated during the first time period;
fourth instructions for calculating a trace overhead time value as a difference in length between the first time period and the second time period;
fifth instructions for computing a trace overhead calibration value as an average time for writing the number of trace records output during the trace overhead time value; and
sixth instructions for storing the output overhead calibration value for subsequent use in a profiling-related process in the data processing system.

### Claim 24 (depends on 23)

The computer program product of claim 23, wherein first instructions for profiling a program with enablement of trace record generation during the first time period further comprise:
instructions for retrieving a first start time;
instructions for executing the program during which trace records are generated;
instructions for retrieving a first end time; and
instructions for computing the first time period as a difference between the first start time and the first end time.

### Claim 25 (depends on 23)

The computer program product of claim 23, wherein the second instructions for profiling a program with disablement of trace record generation during the second time period further comprise:
instructions for retrieving a second start time;
instructions for executing the program during which trace records are not generated;
instructions for retrieving a second end time; and
instructions for computing the second time period as a difference between the first start time and the first end time.

### Claim 26

A computer program product in a computer-readable medium for use in a data processing system for processing trace data output, the computer program product comprising:
first instructions for reading a first timestamp from a first trace record and a second timestamp from a second trace record;
second instructions for computing the difference between the two timestamps to obtain a delta time;
third instructions for retrieving a trace overhead compensation value; and
fourth instructions for adjusting the delta time by subtracting the trace overhead compensation value, wherein the trace overhead is determined by comparing a calibration run preceding a trace process.

### Claim 27 (depends on 26)

The computer program product of claim 26 wherein a calibration run compares an execution time of a program with profiling and an execution time of the program without profiling.

### Claim 28 (depends on 27)

The computer program product of claim 27 further comprising;
instructions for computing an average amount of time to generate a trace record during the calibration run.

### Claim 29 (depends on 26)

The computer program product of claim 26 wherein the trace overhead compensation value is directly proportional to a time required to generate a trace record.

### Claim 30 (depends on 26)

The computer program product of claim 26 wherein the first trace record and the second trace record are output to a trace file during execution of a profiling process in the data processing system.

### Claim 31 (depends on 26)

The computer program product of claim 26 further comprising:
instructions for attributing the adjusted delta time to a performance statistic for a routine whose execution caused the first trace record or the second trace record to be output.

### Claim 32 (depends on 26)

The computer program product of claim 26 further comprising:
instructions for adjusting the delta time using a plurality of trace overhead compensation values.

### Claim 33 (depends on 26)

The computer program product of claim 26 further comprising:
instructions for setting the adjusted delta time to zero if the adjusted delta time is negative.
