Dynamic Binary Tracing for Software Maintenance
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Software maintenance is costly due to the difficulty in understanding complex software systems, particularly legacy systems, where long-living software systems lack comprehensive documentation, and existing tools struggle with scalability issues in processing and visualizing execution traces.
Innovation Solution
A method and system for automatically generating trace data sets by inserting tracing instructions into binary code, which are activated at runtime to record and analyze function calls, allowing for scalable and robust trace visualization, especially in C/C++ software systems, and dynamically excluding frequently called functions to reduce trace size and overhead.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of information
If tracing instructions are inserted into binary code to record execution traces, then program understanding is improved, but runtime overhead increases
Solution Approach 1:
The tracing instructions are made dynamically replaceable - they can be substituted with neutral instructions during runtime based on actual execution needs. This allows the system to transition between tracing and non-tracing states, optimizing performance while maintaining the ability to capture execution traces when necessary for program understanding.
Solution Approach 2:
The system changes the state parameter of tracing instructions from active to inactive by replacing them with neutral instructions. This parameter change allows the same binary code to operate in different modes (tracing vs. normal execution), reducing runtime overhead while preserving the capability to understand program behavior when needed.
2Measurement precision
If all function calls are traced to provide complete execution history, then analysis precision is improved, but trace data volume becomes unmanageably large
Solution Approach 1:
The system extracts and removes tracing instructions that correspond to functions not relevant to the current analysis task. By selectively taking out only the necessary tracing instructions rather than tracing all function calls, the system maintains analysis precision for relevant functions while significantly reducing the volume of trace data that needs to be processed and stored.
Solution Approach 2:
Different parts of the binary code are treated differently - some functions have tracing instructions inserted while others have neutral instructions. This local differentiation allows the system to focus tracing resources on functions that are most relevant to the current maintenance task, achieving precise analysis where needed while minimizing overall data volume.
3Reliability
If tracing instructions are permanently inserted in binary code, then trace generation capability is improved, but system complexity increases
Solution Approach 1:
The system discards tracing instructions by replacing them with neutral instructions after they have served their purpose or when not currently needed. This allows the system to maintain trace generation capability when required while reducing complexity during normal operation, as the tracing functionality can be recovered or reactivated if needed without permanently burdening the system.
Data Source
AI summary
The invention relates to a method, a computer system, and a computer program product for automatically generating a trace data set for a software system on a computer system. The method includes the step of providing a software system comprising a source code. Binary code is provided by compiling the source code by inserting a plurality of tracing instructions into the binary code. The tracing instructions initiate trace data generation during runtime of the software system. The method also includes modifying the binary code by replacing at least one tracing instruction of the plurality of tracing instructions with a neutral instruction. The modified binary code is run by activating trace data generation by re-replacing the neutral instruction with the at least one tracing instruction. The method further includes recording the trace data set. The recording step is initiated by the at least one tracing instruction.


