Software Instrumentation via Linked List Byte Code Merging

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing instrumentation methods for software application code, such as wrapper and in-line instrumentation, face challenges like complexity in interacting with runtime environments and potential security threats, as well as the need for multiple passes through the code to address branch target offsets, making the process inefficient and labor-intensive.

Innovation Solution

The method involves pre-created template methods for different categories of software application code, which are used to instrument target methods by converting byte code to linked lists, replacing branch target offsets with pointers, and merging with template methods to simplify the instrumentation process, reducing computational cost and time.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If wrapper methods are used for instrumentation, then code recording capability is improved, but device complexity and security risks increase due to extra call levels and call stack modifications

Engineering Contradiction:
Improvecode recording capabilityVSAvoidcall tree hierarchy complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent extracts the instrumentation logic from wrapper methods and integrates it directly into the target code method through in-line instrumentation. The prolog and epilog code are inserted directly within the method body, eliminating the need for separate wrapper methods and reducing call tree complexity while maintaining recording capability

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent introduces a sentinel sequence as an intermediary marker within the target code that signals where instrumentation should occur. This sentinel acts as a mediator between the code analysis phase and the instrumentation phase, enabling automatic identification of instrumentation points without complex wrapper method logic

Inventive Principle:
Principle #24Intermediary (Mediator)

2Device complexity

If in-line instrumentation is used, then wrapper method complexity is reduced, but manufacturing precision deteriorates due to multiple passes required for branch target offset recalibration

Engineering Contradiction:
Improveinstrumentation structure complexityVSAvoidbranch target offset accuracy
Core Design Contradiction:
Device complexityVSManufacturing precision

Solution Approach 1:

The patent performs preliminary conversion of branch target offsets to pointers during the code analysis phase, before instrumentation is applied. This preliminary action ensures that offset accuracy is established early, eliminating the need for multiple recalibration passes during subsequent instrumentation iterations

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent creates a copy of the target code in the form of a linked list representation during analysis. This copy allows for precise manipulation and offset-to-pointer conversion without affecting the original code, enabling accurate instrumentation planning in a single pass

Inventive Principle:
Principle #26Copying

3Manufacturing precision

If multiple passes through code are performed for instrumentation, then branch target offset accuracy is improved, but productivity decreases due to repeated analysis and re-computation

Engineering Contradiction:
Improvebranch target offset accuracyVSAvoidinstrumentation process efficiency
Core Design Contradiction:
Manufacturing precisionVSProductivity

Solution Approach 1:

The patent performs all necessary branch target offset conversions to pointers during the initial code analysis phase. This preliminary action eliminates the need for repeated offset recalculations in subsequent instrumentation passes, significantly improving productivity while maintaining accuracy

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent creates a universal linked list representation of the code that serves multiple functions: it enables both the analysis phase (for offset conversion) and the instrumentation phase (for code generation). This multi-functional representation eliminates the need for separate processing passes, improving overall instrumentation efficiency

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

Data Source

PatentUS9064042B2Instrumenting computer program code by merging template and target code methods
Publication Date: 2015.06.23 ATERNITY LLC
  • US9064042B2 patent drawing
  • US9064042B2 patent drawing
  • US9064042B2 patent drawing

AI summary

Embodiments provide systems, methods, and computer program products for instrumenting software application code. A target method and a template method may each be elevated to respective linked lists that maintain offsets in a relative relationship using pointers. The lists are merged and converted back to byte code as an instrumented method.