Parallel Program Tracing via Specification-Driven Code Generation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current tracing methods for computer programs are intrusive, affect program behavior, and increase execution time, making it difficult to analyze large amounts of trace information without tools, especially in DEBUG and RELEASE modes, and may mask bugs.

Innovation Solution

A device comprising non-transitory memory and processors that generate trace code from a trace specification program, allowing trace instructions to be inserted at predetermined locations in the computer program, executed in parallel, and recorded in a trace file, minimizing intrusion and enhancing performance by reducing tracing overhead.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of information

If traditional tracing methods are used to record program execution information, then trace data can be obtained for debugging and analysis, but the tracing process intrudes into program behavior and may mask bugs

Engineering Contradiction:
Improvetrace informationVSAvoidprogram behavior
Core Design Contradiction:
Loss of informationVSReliability

Solution Approach 1:

The tracing system is divided into separate components: the main program execution thread and the trace recording thread operate independently. The trace code is segmented into specific recording instructions that are inserted at predetermined locations, allowing the program to be traced without uniformly intruding into all program operations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

A queue mechanism is introduced as an intermediary between the program execution and trace recording processes. The queue stores trace information generated during program execution, allowing the trace function to retrieve and process data without directly interfering with the main program flow, thus preventing bug masking.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Loss of information

If traditional tracing methods insert auxiliary trace code into the program, then trace information can be recorded, but execution time increases due to tracing overhead

Engineering Contradiction:
Improvetrace informationVSAvoidexecution time
Core Design Contradiction:
Loss of informationVSLoss of time

Solution Approach 1:

Instead of continuous tracing that would slow down every program operation, the system uses periodic action by inserting trace recording instructions only at predetermined locations where trace information is needed. This selective approach reduces the frequency of trace operations and minimizes execution time overhead.

Inventive Principle:
Principle #19Periodic action

Solution Approach 2:

The trace recording functionality is extracted from the main program execution flow and placed in a separate parallel thread. This allows the trace recording to occur concurrently with program execution, removing the time overhead from the critical program path while still capturing necessary trace information.

Inventive Principle:
Principle #2Taking out (Extraction)

3Loss of information

If manual trace code insertion is performed to record specific variable states, then relevant trace information can be obtained, but the process is complex and requires programmer intervention

Engineering Contradiction:
Improvevariable state informationVSAvoidtracing setup
Core Design Contradiction:
Loss of informationVSEase of operation

Solution Approach 1:

The tracing system provides universal functionality through a standardized trace specification program format that can define multiple types of trace information (variable states, execution flow, etc.) using a single unified approach. This eliminates the need for different manual insertion methods for different tracing needs, simplifying the overall process.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The trace specification program is prepared in advance, defining all trace recording requirements before program execution. This preliminary action automates the generation of trace code and its insertion at appropriate locations, eliminating the need for manual programmer intervention during the tracing setup phase.

Inventive Principle:
Principle #10Preliminary action

4Ease of manufacture

If dynamic binary instrumentation is used to modify compiled binaries at run time, then tracing can be performed without recompilation, but the binary modification is intrusive and may alter program behavior

Engineering Contradiction:
Improvetracing implementationVSAvoidprogram behavior
Core Design Contradiction:
Ease of manufactureVSReliability

Solution Approach 1:

Instead of uniformly modifying the entire binary, the system applies local quality by inserting trace recording instructions only at specific predetermined locations where trace information is required. This selective modification approach maintains program behavior integrity while enabling effective tracing at critical points.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The tracing system creates a parallel copy of the execution flow in a separate thread that mirrors the main program's operations at predetermined locations. This copying approach allows trace data collection without directly modifying the original program's critical execution paths, preserving program behavior.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS10402306B2Parallel tracing
Publication Date: 2019.09.03 FUTUREWEI TECHNOLOGIES INC
  • US10402306B2 patent drawing
  • US10402306B2 patent drawing
  • US10402306B2 patent drawing

AI summary

A device for tracing a computer program comprises a non-transitory memory having instructions and one or more processors in communication with the memory. The one or more processors execute the instructions to generate trace code from a trace specification program to trace the computer program. The one or more processors calculate values by executing the computer program and the trace code records, in parallel, the values at a predetermined location in execution of the computer program.