Trace Replay Memory Value Retrieval via Persistence Structures

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing 'time travel' debugging approaches face challenges in efficiently preserving and retrieving memory values during trace replay, particularly due to the large memory requirements and poor performance associated with storing and loading full memory copies, as well as the complexity of partial replay methods.

Innovation Solution

The method involves maintaining a plurality of persistence data structures, each corresponding to a different trace section, which store the most recently seen memory values for each address encountered, allowing for parallel replay and efficient retrieval of memory values by progressively searching these structures.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If a full copy of addressable memory is stored at trace time, then memory values can be retrieved directly during replay, but prohibitively large amounts of data are produced and require large memory to load and maintain

Engineering Contradiction:
Improvememory value retrieval accuracyVSAvoiddata volume
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent extracts only the necessary memory information (read/write operations on memory addresses) from the full memory copy, storing these operations in a trace file instead of storing the entire memory state. This reduces the data volume from gigabytes to a manageable size while preserving the ability to retrieve memory values during replay.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent performs preliminary recording of memory operations (reads and writes) during the trace phase, storing these operations in a trace file. During replay, these pre-recorded operations are used to reconstruct memory values on-demand, eliminating the need to load and search through a full memory copy.

Inventive Principle:
Principle #10Preliminary action

2Productivity

If a full copy of addressable memory is loaded at replay time, then memory reads and writes can be performed directly, but large amounts of data must be loaded and maintained in memory

Engineering Contradiction:
Improvememory operation speedVSAvoidmemory data volume
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

Instead of loading the full memory copy, the patent extracts and applies only the necessary memory operations from the trace file during replay. This reconstructs the memory state incrementally, using minimal memory data volume while maintaining the ability to perform memory operations at the required speed.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The memory operations are pre-recorded in the trace file during the trace phase. During replay, these pre-recorded operations are applied to reconstruct memory values on-demand, eliminating the need to load large amounts of memory data while preserving operation speed through efficient trace processing.

Inventive Principle:
Principle #10Preliminary action

3Quantity of substance

If code is replayed up to the last point a memory address was consumed to return its value, then much less memory is required, but complexity increases and performance deteriorates due to replay being performed for every memory value request

Engineering Contradiction:
Improvememory data volumeVSAvoidmemory value retrieval speed
Core Design Contradiction:
Quantity of substanceVSProductivity

Solution Approach 1:

The patent performs preliminary recording of all memory operations (reads and writes) during the trace phase, organizing them in the trace file with their temporal relationships preserved. During replay, these pre-organized trace operations allow direct retrieval of memory values without performing replay for every request, improving retrieval speed while maintaining low memory usage.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

Instead of replaying code to obtain memory values, the patent uses a copied and stored representation of memory operations from the trace file. This trace copy contains all necessary information to determine memory values directly, eliminating the need for repeated replay operations and improving retrieval performance.

Inventive Principle:
Principle #26Copying

4Adaptability or versatility

If a full memory copy is maintained at replay time, then parallel or speculative replay operations become impractical, but the patent enables these operations through alternative approaches

Engineering Contradiction:
Improveparallel replay capabilityVSAvoidmemory data volume
Core Design Contradiction:
Adaptability or versatilityVSQuantity of substance

Solution Approach 1:

The patent segments the trace file into independent trace operations that can be processed in parallel. Each memory operation in the trace file is self-contained with its temporal ordering information, allowing multiple processing units to replay different segments simultaneously without requiring a shared full memory copy, thus enabling parallel replay with minimal memory usage.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent uses copied trace operations from the trace file to support multiple replay instances. Each processing unit can have its own copy of the trace operations, enabling speculative and parallel replay without requiring a single large shared memory space, thereby improving adaptability while maintaining low memory data volume.

Inventive Principle:
Principle #26Copying

Data Source

PatentEP3577564B1Efficient retrieval of memory values during trace replay
Publication Date: 2022.03.02 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP3577564B1 patent drawingFigure 1
  • EP3577564B1 patent drawingFigure 2
  • EP3577564B1 patent drawingFigure 3

AI summary

Preserving memory values during replay includes identifying trace sections that each represents events executed by an entity over a period of time. A parallel replay of trace sections is performed at a plurality of processing units. While performing the parallel replay, a persistence data structure corresponding to each trace section is maintained. This includes, for each trace section, storing, in the trace section's persistence data structure, a record of each memory address consumed by the processing unit while replaying the trace section, and a most recent memory value stored at each memory address. Returning a memory value during replay includes identifying relevant persistence data structures, and searching these data structures, in turn, based on a defined ordering. When a relevant memory address is identified during the search, the search is ceased and the value associated at the memory address, as stored in a persistence data structure, is returned.