Hybrid Code Instrumentation for Source and Binary Coverage
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional code instrumentation methods, such as compiler-based and binary instrumentation, face inefficiencies when source code is unavailable, leading to slower execution and less intelligent instrumentation.
Innovation Solution
A hybrid approach using a compiler to instrument source code available portions and a runtime system to instrument machine code unavailable portions, allowing for efficient and intelligent instrumentation of the entire application.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If binary instrumentation is used to instrument machine code, then code can be instrumented even when source code is unavailable, but execution speed decreases and instrumentation intelligence is reduced
Solution Approach 1:
The patent divides the codebase into two segments: source code portions that can be instrumented by a compiler and machine code portions that require runtime instrumentation. This segmentation allows each instrumentation method to be applied where most appropriate, optimizing both speed and adaptability.
Solution Approach 2:
The patent merges compiler-based instrumentation and runtime binary instrumentation into a unified hybrid approach. The compiler instruments source code portions for optimal performance, while the runtime system instruments machine code portions for completeness, combining the advantages of both methods.
2Adaptability or versatility
If binary instrumentation is used to instrument machine code, then code can be instrumented when source is unavailable, but instrumentation intelligence decreases
Solution Approach 1:
The patent segments the instrumentation task based on code availability: compiler-based instrumentation for source code portions (where high intelligence is achievable) and runtime instrumentation for machine code portions (where adaptability is key).
Solution Approach 2:
The runtime system acts as an intermediary that bridges the gap between unavailable source code and the need for instrumentation. It provides the necessary instrumentation intelligence for machine code portions that lack source code, using metadata and type information as intermediaries.
3Speed
If compiler-based instrumentation is used, then execution speed is maintained and instrumentation is intelligent, but code cannot be instrumented when source code is unavailable
Solution Approach 1:
The patent segments code portions by availability of source code, applying compiler-based instrumentation to available source portions for optimal performance and intelligence, while using runtime instrumentation for unavailable portions to maintain completeness.
Solution Approach 2:
The hybrid instrumentation system provides universal coverage by combining two instrumentation approaches: compiler-based for source code portions and runtime-based for machine code portions, making the system applicable to all code regardless of source availability.
Data Source
AI summary
One embodiment of a method for code instrumentation. The method includes in response to determining that a first portion of machine code was not instrumented during compilation of the first portion of machine code: performing one or more operations to instrument at least one part of the first portion of machine code, and executing the first portion of machine code.


