Context Tracing for Mixed Frame Pointer Systems

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current software analysis tools face challenges in determining the execution state of processors, especially in multi-processor systems, as they often require re-compilation or re-linking of code and rely on frame pointers, limiting their ability to analyze systems without special compiler flags or invasive system modifications.

Innovation Solution

A method for context tracing that allows determining the function call history by stepping through functions with and without frame pointers, tracking instructions that change stack and frame pointers, and calculating offsets to find parent functions, enabling analysis without re-compilation or re-linking, and applicable to both uni-processor and multi-processor systems.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If source code instrumentation method is used to gather system information, then information collection capability is improved, but application source code and re-compilation are required

Engineering Contradiction:
Improveinformation collection capabilityVSAvoidsource code modification requirement
Core Design Contradiction:
Measurement precisionVSEase of manufacture

Solution Approach 1:

The patent introduces a runtime system patching mechanism that acts as an intermediary between the application code and the profiling system. By patching the runtime system libraries instead of modifying application source code, the patent enables information collection without requiring access to or modification of the application's source code, thus resolving the contradiction between measurement precision and ease of manufacture

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent creates copies of runtime system libraries (such as libc.so) and patches these copies with instrumentation code. These patched library copies are then used during execution to intercept function calls and gather profiling information, enabling analysis without modifying the original application source code while maintaining accurate measurement capability

Inventive Principle:
Principle #26Copying

2Measurement precision

If object code instrumentation method is used to gather system information, then source code access is avoided, but re-linking of object code is required

Engineering Contradiction:
Improveinformation collection capabilityVSAvoidre-linking requirement
Core Design Contradiction:
Measurement precisionVSEase of manufacture

Solution Approach 1:

The patent uses runtime system libraries as intermediaries to avoid direct modification of application object code. By instrumenting the runtime libraries that the application links against, the patent enables information collection without requiring re-linking of the application's object code, thus resolving the contradiction between measurement precision and ease of manufacture

Inventive Principle:
Principle #24Intermediary (Mediator)

3Ease of operation

If runtime system patching method is used to gather system information, then re-compilation and re-linking are avoided, but system object code in memory must be modified

Engineering Contradiction:
Improvelive system monitoring capabilityVSAvoidsystem modification risk
Core Design Contradiction:
Ease of operationVSObject-affected harmful factors

Solution Approach 1:

The patent creates copies of runtime system libraries and patches these copies instead of modifying the original system libraries in memory. The patched library copies are loaded and used during execution, enabling live system monitoring without directly modifying the original system object code, thus reducing system modification risk while maintaining ease of operation

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent applies patching only to specific runtime system libraries that are necessary for profiling functionality, rather than modifying the entire system. This localized approach minimizes the scope of modifications, reducing potential harmful effects while enabling live system monitoring capability

Inventive Principle:
Principle #3Local quality

4Measurement precision

If periodic snooping method is used to analyze system state, then statistical information is obtained, but real-time execution state determination is limited

Engineering Contradiction:
Improvestatistical information accuracyVSAvoidreal-time analysis capability
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent instruments the runtime system in advance to automatically capture and store execution state information as it occurs, rather than periodically querying the system state. This preliminary instrumentation enables real-time capture of processor execution states, function call histories, and other dynamic information without the time losses associated with periodic snooping, while maintaining accurate statistical information

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS7870541B1Context tracing for software with a frame pointer and a stack pointer and with a stack pointer but without a frame pointer
Publication Date: 2011.01.11 WIND RIVER SYSTEMS INC
  • US7870541B1 patent drawing
  • US7870541B1 patent drawing
  • US7870541B1 patent drawing

AI summary

A computer implemented method or computer readable code for determining function call history for a system, which runs both code with a frame pointer and a stack pointer and code with a stack pointer and without a frame pointer. Execution is frozen on at least one CPU. A function of plurality of functions that were executing on the at least one CPU is stepped through, where some of the plurality of functions have a frame pointer and a stack pointer and some of the plurality of functions have a stack pointer but do not have a frame pointer. The stack offset to the stack memory location, where the return address in parent function is stored, is calculated to find the return address in parent function, which called the function being stepped through.