Selective Execution Tracing via Distance Variable Control
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Trace-based debugging in complex software systems often results in significant performance overhead and large trace file sizes due to the need to record and analyze all executed code, including non-relevant portions like kernel, compiler, and garbage collector code, which hinders efficient bug identification and mitigation.
Innovation Solution
Implementing a selective execution tracing system that uses a tracing disablement distance variable to control tracing, enabling tracing only for relevant code sections, thereby reducing computational and storage costs by dynamically enabling and disabling tracing based on a distance variable that increments or decrements as the code executes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of information
If full execution tracing is performed to capture all code execution for debugging, then complete debugging information is obtained, but performance overhead increases significantly and trace file sizes become large
Solution Approach 1:
The patent segments the execution trace into distinct portions: traced portions containing user code of interest and non-traced portions containing system code. This segmentation allows the tracing mechanism to selectively record only relevant user code execution while skipping system code, thereby reducing trace file size and performance overhead while maintaining completeness of debugging information for the code that matters most.
Solution Approach 2:
The patent applies local quality by differentiating between traced and non-traced portions of code execution. Instead of uniformly tracing all code, the system applies tracing selectively to specific regions (user code sections of interest) while excluding others (system code). This localized approach ensures high-quality debugging information where needed while minimizing performance impact in less critical areas.
2Loss of information
If all code portions are traced to ensure comprehensive debugging coverage, then no debugging information is lost, but trace file sizes increase significantly
Solution Approach 1:
The patent extracts and removes non-essential portions of code execution from the trace. By identifying and excluding system code (kernel, compiler, garbage collector) from the traced portions, the system extracts only the essential user code execution paths that are relevant to debugging. This extraction process significantly reduces trace file size while preserving all necessary debugging information for user code analysis.
3Loss of information
If continuous tracing is performed to capture all execution details, then complete execution history is recorded, but computational overhead increases
Solution Approach 1:
The patent implements periodic action by alternately enabling and disabling tracing based on the code portion being executed. The tracing mechanism periodically switches between traced and non-traced states, activating only when user code of interest is executing and deactivating when system code is running. This periodic tracing approach maintains execution history completeness for relevant code while dramatically reducing computational overhead compared to continuous tracing.
Data Source
Figure 1~3
Figure 4~6
Figure 7~8
AI summary
Expressly turning tracing on and off at each juncture between code that a developer wants to have traced and other code may reduce trace file size but adds computational cost. Described technologies support selectively tracing a process's execution, with some extra tracing done beyond the code the developer wanted traced, but with significantly reduced computational cost, by reducing the number of trace enablement and disablement operations. A trace controller uses a tracing disablement distance variable whose values indicate the computational distance from trace disablement. A distance variable modifier automatically moves the distance variable closer to a stop-tracing value as the process executes. The amount of extra tracing is balanced against the reduction in trace enablement/disablement operations by tuning thresholds, based on information about routine size and computational cost. Operation of the trace controller is illustrated by sample APIs, a tracing state diagram, and a side-by-side comparison, among other items.