Selective Execution Tracing System for Asynchronous Code
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current debugging techniques face challenges in efficiently tracing and recording execution paths across multiple threads, particularly in production environments, leading to performance slowdowns and large trace file sizes, which hinder the identification and remediation of software bugs.
Innovation Solution
A selective execution tracing system that uses a tracing disablement distance variable to control tracing, enabling tracing only when necessary, thereby reducing computational and storage costs, and focuses on tracing user code while excluding non-user code like kernel, compiler, or garbage collector code.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of information
If full execution tracing is performed to capture all state information for debugging, then debugging information completeness is improved, but system performance deteriorates due to execution slowdown
Solution Approach 1:
The patent segments the execution trace into multiple threads of execution, allowing the tracing system to process and record state information in parallel. This segmentation enables the system to maintain complete debugging information while distributing the tracing workload across multiple execution contexts, thereby reducing the performance impact on any single thread.
2Loss of information
If comprehensive execution tracing is performed across all code, then debugging coverage is improved, but trace file size increases excessively
Solution Approach 1:
The patent extracts and records only the essential state information needed for debugging purposes, rather than capturing all possible execution data. By selectively extracting relevant state information from the full execution context, the system maintains comprehensive debugging coverage while significantly reducing the volume of trace data that needs to be stored and processed.
3Reliability
If tracing is enabled continuously to capture all execution paths, then bug detection capability is improved, but computational overhead increases
Solution Approach 1:
The patent implements periodic sampling of execution state information rather than continuous tracing. By periodically capturing state information at strategic points in the execution flow, the system maintains effective bug detection capability while significantly reducing the computational overhead associated with constant tracing operations.
Data Source
Figure 1~3
Figure 4~6
Figure 7~8
AI summary
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. A create task function is modified to include the setting of an indicator that a newly created task is to be traced if a current task or thread is being traced. An execute task function is modified to request the tracing of the newly created task when it is executed based on the indicator, thereby enabling selective tracing that operates across process boundaries and traces asynchronous code execution.