Trampoline-Based Dynamic Instrumentation for Low Overhead Data Collection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current dynamic instrumentation solutions face challenges in collecting data from both kernel and user modes with low overhead in computer systems, particularly in achieving efficient data collection without disrupting system operations.

Innovation Solution

The implementation of a trampoline-based instrumentation method that involves setting up a breakpoint, creating a trampoline, and associating it with a breakpoint instruction, allowing for data collection by saving and restoring register states and stack data, and executing the original instruction stream with minimal overhead.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If dynamic instrumentation is implemented to collect data from both kernel mode and user mode, then data collection capability is improved, but system overhead increases

Engineering Contradiction:
Improvedata collection capabilityVSAvoidsystem overhead
Core Design Contradiction:
Measurement precisionVSLoss of energy

Solution Approach 1:

The patent introduces a trampoline as an intermediary mechanism between the breakpoint handler and the original instruction stream. The trampoline contains a copy of the original instruction and serves as a bridge that allows the system to execute instrumentation code while maintaining the ability to return to the original execution flow, thereby reducing the overhead impact on system performance

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent segments the instrumentation process into distinct components: breakpoint detection, trampoline execution, original instruction execution, and state restoration. By separating these functions into modular segments, the system can efficiently manage the instrumentation overhead and minimize disruption to the original execution flow

Inventive Principle:
Principle #1Segmentation

2Loss of energy

If a trampoline is created and associated with a breakpoint instruction, then data collection overhead is reduced, but device complexity increases

Engineering Contradiction:
Improveinstrumentation overheadVSAvoidinstrumentation structure
Core Design Contradiction:
Loss of energyVSDevice complexity

Solution Approach 1:

The patent creates a copy of the original instruction and places it within the trampoline structure. This copying approach allows the trampoline to serve as a self-contained execution unit that can be independently managed and restored, simplifying the overall instrumentation management despite the increased structural complexity

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The trampoline structure is nested within the breakpoint handling mechanism, which itself is nested within the instruction stream. This nested structure allows the system to embed instrumentation code within the existing execution flow without requiring separate external management structures

Inventive Principle:
Principle #7Nested doll (Nesting)

Data Source

PatentUS9336001B2Dynamic instrumentation
Publication Date: 2016.05.10 LENOVO GLOBAL TECHNOLOGIES SWITZERLAND INTERNATIONAL GMBH
  • US9336001B2 patent drawing
  • US9336001B2 patent drawing
  • US9336001B2 patent drawing

AI summary

Techniques for dynamic instrumentation are provided. A method for instrumentation preparation may include obtaining address data of an original instruction in an original instruction stream, obtaining kernel mode data comprising a kernel breakpoint handler, obtaining user mode data comprising a user breakpoint handler, allocating a page of a process address space, creating a trampoline, associating the trampoline with a breakpoint instruction, and replacing the original instruction with the breakpoint instruction. A method for instrumentation may include detecting the breakpoint instruction, calling the kernel breakpoint handler, modifying an instruction pointer via the kernel breakpoint handler such that the instruction pointer points to the trampoline, and executing the trampoline. The system for instrumentation may include a breakpoint setup module and a breakpoint execution module for respectively setting up and completing instrumentation involving the trampoline.