# US 2019/0171547 A1 · Resource lifetime analysis using a time-travel trace

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

- Number: US 2019/0171547 A1
- Document ID: US20190171547A1
- Status: Published application
- Kind: A1
- Application number: 16/252,180
- Filed: 2019-01-18
- Published: 2019-06-06
- Earliest claimed: 2017-03-08
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Jordi MOLA; Kenneth Walter SYKES
- Web page: https://patentgrep.com/patent/US20190171547A1

## CPC

- G06F 11/3636: {by tracing the execution of the program}
- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 16/328: {Management therefor}
- G06F 16/43: Querying
- G06F 16/90335: {Query processing}
- G06F 16/9038: Presentation of query results
- G06F 2201/865: Monitoring of software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Querying resource lifetime using a trace of program execution. An embodiment includes identifying a query expression targeted at least a portion of the trace of program execution. The query expression specifies at least (i) a data object representing a plurality of events identified in the trace, each event associated with one or more attributes relating to resource lifetime, and (ii) one or more conditions matching the one attributes relating to resource lifetime. In response to receiving the query expression, the query expression is processed based at least on an analysis of an identified subset of the trace. Based on processing the query expression, a result data set that includes or identifies at least one of the plurality of events that meets the one or more conditions is presented.

## Claims

### Claim 1

(canceled)

### Claim 2

A method, implemented at a computer system that includes one or more processing units, for creating key frames during indexing of a trace for responsive trace replay, the method comprising:
identifying one or more responsiveness goals for trace replay, including identifying a target trace section replay time based on a computation using at least (i) an estimated number of trace sections to be replayed to obtain a replay result, and (ii) an estimated number of processing units available during replay;
replaying at least a portion of execution of one or more executable entities based on one or more traces;
while replaying execution of the one or more executable entities, and based at least on the identified target trace section replay time, identifying a plurality of points in execution of the one or more executable entities that bound trace sections that can each be replayed within the target trace section replay time;
determining that at least one of the identified plurality of points in execution of the one or more executable entities corresponds to execution of a particular function or module; and
creating at least one a key frame for one or more of the identified plurality of points in execution of the one or more executable entities, while refraining from creating any key frame for the at least one of the identified plurality of points in execution of the one or more executable entities that corresponds to execution of the particular function or module, each created key frame enabling replay of at least one trace section of the one or more executable entities beginning at the key frame.

### Claim 3 (depends on 2)

The method of claim 2, wherein the particular function or module corresponds to third party code.

### Claim 4 (depends on 2)

The method of claim 2, further comprising using machine learning in order to identify at least one point in execution of the one or more executable entities at which to create a key frame.

### Claim 5 (depends on 4)

The method of claim 4, wherein the machine learning identifies the at least one point in execution of the one or more executable entities based on determining that the at least one point in execution corresponds to a code entity that is part of a family of code entity invocations.

### Claim 6 (depends on 4)

The method of claim 4, wherein the machine learning is supervised machine learning that uses, as a training dataset, at least one of (i) a manually curated dataset, (ii) a dataset based on telemetry from a debugging session, (iii) a dataset based on coding activity by a particular user, (iv) a dataset based on telemetry from a version control system, or (v) a dataset based on telemetry from a bug tracking system.

### Claim 7 (depends on 2)

The method of claim 2, wherein identifying the plurality of points in execution of the one or more executable entities also comprises identifying at least one point in execution based on one or more of (i) a replay time interval, (ii) an orderable event, (iii) an exception, (iv) a kernel transition, (v) runtime environment activity, (vi) a cache flush, (vii) an amount of elapsed time, (viii) an amount of processing time, (ix) reaching a particular instruction count, or (x) an input/output activity.

### Claim 8 (depends on 2)

The method of claim 2, further comprising inserting created the at least one key frame into the one or more traces.

### Claim 9 (depends on 2)

The method of claim 2, further comprising inserting created the at least one key frame into one or more new traces.

### Claim 10 (depends on 2)

The method of claim 2, wherein identifying the one or more responsiveness goals for trace replay comprises identifying a target disk usage, and wherein identifying the plurality of points in execution of the one or more executable entities comprises identifying a number of the plurality of points based on the target disk usage.

### Claim 11 (depends on 2)

The method of claim 2, wherein identifying the one or more responsiveness goals for trace replay comprises identifying a target physical computing environment for replay of the one or more traces.

### Claim 12

A method, implemented at a computer system that includes one or more processors, for augmenting a trace with at least one reverse lookup data structure during indexing of the trace, the method comprising:
receiving one or more traces that store trace data observed during execution of one or more executable entities, the trace data enabling the execution of the one or more executable entities to be replayed;
replaying a plurality of trace sections of the one or more traces, each trace section comprising a different portion of the trace data, while recording attributes observed during the replay of the plurality of trace sections, the replay including, for each trace section:
executing a plurality of code instructions of the one or more executable entities based on the trace section's portion of the trace data; and
recording one or more attributes observed during the execution of the plurality of code instructions based on the trace section's portion of the trace data, along with an identity of the trace section;
based at least on recording the attributes observed during the replay of the plurality of trace sections, creating at least one reverse lookup data structure, the reverse lookup data structure associating each of at least a subset of the attributes observed during the replay of the plurality of trace sections with the identity of each trace section in which it was observed;
reducing a granularity of an index of the reverse lookup data structure; and
storing the reverse lookup data structure.

### Claim 13 (depends on 12)

The method of claim 12, wherein reducing the granularity of the index of the reverse lookup data structure comprises merging a plurality of individual attribute values into a range of attribute values.

### Claim 14 (depends on 13)

The method of claim 13, wherein merging the plurality of individual attribute values into the range of attribute values comprises merging a plurality of individual memory addresses into a range of memory addresses.

### Claim 15 (depends on 12)

The method of claim 12, wherein reducing the granularity of the index of the reverse lookup data structure comprises merging individual memory addresses into a plurality of ranges of memory addresses, and wherein the plurality of ranges of memory addresses include variable-sized ranges of memory addresses.

### Claim 16 (depends on 15)

The method of claim 15, wherein at least one of the variable-sized ranges of memory addresses is selected to align with frequent memory accesses due to code locality.

### Claim 17 (depends on 12)

The method of claim 12, wherein reducing the granularity of the index of the reverse lookup data structure comprises indexing only a portion of binary representations of a plurality of values.

### Claim 18 (depends on 12)

The method of claim 12, wherein reducing the granularity of the index of the reverse lookup data structure comprises specifying traces sections as ranges, rather than individually.

### Claim 19 (depends on 12)

The method of claim 12, further comprising annotating one or more functions identified in the one or more traces with information usable for contract verification, including information specifying a contract for each of the one or more functions.

### Claim 20 (depends on 12)

The method of claim 12, wherein storing the reverse lookup data structure comprises storing the reverse lookup data structure within the one or more traces.

### Claim 21 (depends on 12)

The method of claim 12, wherein storing the reverse lookup data structure comprises storing the reverse lookup data structure within one or more new traces.
