Call Stack Sampling Using Tide Mark Pointer

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing data processing systems face challenges in efficiently sampling the call stack without disrupting ongoing data processing operations or incurring the limitations of fixed-sized call stack buffers.

Innovation Solution

The implementation of an apparatus with processing circuitry that performs data processing operations, including call stack sampling, using a stack pointer and a tide mark pointer to efficiently sample the call stack by retrieving subroutine information between the tide mark and stack pointers, and updating the tide mark pointer accordingly.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of information

If software is arranged to provide information relating to the content of the call stack, then call stack sampling can be performed, but software execution must be interrupted and data cache contents are disrupted

Engineering Contradiction:
Improvecall stack informationVSAvoidsoftware execution efficiency
Core Design Contradiction:
Loss of informationVSProductivity

Solution Approach 1:

A dedicated call stack buffer is introduced as an intermediary data structure between the main software execution and the sampling mechanism. This buffer stores call stack records separately from the main execution flow, allowing sampling to occur without interrupting software execution or disrupting data cache contents. The buffer acts as a mediator that decouples the sampling operation from the critical execution path.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If a hardware call stack buffer is provided, then separate sampling can be performed without disrupting software execution, but the buffer is of fixed size which is disadvantageous

Engineering Contradiction:
Improvesampling operation efficiencyVSAvoidcall stack buffer flexibility
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The call stack buffer is designed with dynamic characteristics through the use of a stack pointer that can be updated by call and return instructions. The buffer effectively adapts its content based on the runtime behavior of the software, with the stack pointer dynamically indicating which records are currently valid. This allows the buffer to accommodate varying call stack depths and patterns without being constrained by a rigid fixed-size structure.

Inventive Principle:
Principle #15Dynamics

3Loss of information

If periodic sampling is performed to analyze program performance, then performance data can be collected, but frequent sampling increases disruption to data processing operations

Engineering Contradiction:
Improveperformance analysis dataVSAvoidsampling operation time
Core Design Contradiction:
Loss of informationVSLoss of time

Solution Approach 1:

The call stack buffer is pre-configured and continuously updated by hardware call and return instructions during normal software execution. This preliminary action ensures that when sampling is triggered periodically or by events, the buffer already contains the current call stack state without requiring interruption of the software execution. The sampling operation simply reads from the pre-prepared buffer, minimizing the time loss associated with sampling.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentEP3935508B1Call stack sampling
Publication Date: 2025.05.28 ARM LTD
  • EP3935508B1 patent drawingFigure 1
  • EP3935508B1 patent drawingFigure 2A~2B
  • EP3935508B1 patent drawingFigure 3

AI summary

Apparatuses and methods of their operation are disclosed. A call stack is maintained which comprises subroutine information relating to subroutines which have been called during data processing operations and have not yet returned. A stack pointer is indicative of an extremity of the call stack associated with a most recently called subroutine which has been called during the data processing operations and has not yet returned. Call stack sampling can be carried out with reference to the stack pointer. A tide mark pointer is maintained, which indicates of a value which the stack pointer had when the call stack sampling procedure processing circuitry was last completed. The call stack sampling procedure comprises retrieving subroutine information from the call stack indicated between the value of the tide mark pointer and the current value of the stack pointer. More efficient call stack sampling is thereby supported, in that only modifications to the call stack need be sampled.