Processor Performance Profiling Through Counter-Overflow Trace Actions

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional methods for profiling processor performance using performance monitoring hardware interrupts or hardware sampling mechanisms are inefficient, leading to performance impacts, profiling blind spots, and increased complexity, especially when interrupts are masked or require substantial circuitry.

Innovation Solution

A processor with a hardware performance monitoring unit (HPMU) that includes counters to count processing events, generating trace actions upon overflow, and a trace encoder to produce trace packets without interrupts, enabling statistical sampling with reduced performance impact.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If interrupt-based performance monitoring is used to collect profiling information, then performance information can be collected, but execution performance of the software program is adversely affected

Engineering Contradiction:
Improveperformance information collectionVSAvoidexecution performance
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent introduces a specialized interrupt handler that acts as an intermediary between the performance monitoring counters and the main software program. This handler efficiently captures counter overflow information and stores it in a buffer without requiring full context switches or blocking the main program execution, thereby minimizing the performance impact while maintaining accurate profiling data collection

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent segments the performance monitoring function into separate components: performance counters that continue counting independently, an interrupt handler that processes overflow events, and a buffer that stores profiling data. This segmentation allows the counting operation to proceed without interruption while the interrupt handler processes events in the background, reducing the impact on execution performance

Inventive Principle:
Principle #1Segmentation

2Reliability

If non-maskable interrupts (NMIs) are used to address profiling blind spots, then profiling information can be collected when interrupts are masked, but interrupt handling becomes complex and operates slowly

Engineering Contradiction:
Improveprofiling coverageVSAvoidinterrupt handling complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

Instead of using the traditional NMI approach that requires complex handling logic and firmware support, the patent inverts the approach by using a dedicated performance monitoring interrupt handler that is specifically designed for profiling events. This handler operates in a simplified manner compared to general NMI handling, reducing complexity while maintaining the ability to capture profiling information even when standard interrupts are masked

Inventive Principle:
Principle #13The other way round (Inversion)

3Productivity

If hardware sampling mechanisms are used to buffer processor state information, then interrupt frequency is reduced, but a substantial amount of circuitry is required and implementation is complicated

Engineering Contradiction:
Improveinterrupt frequencyVSAvoidcircuitry requirements
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent implements a buffer structure that serves multiple functions: it stores performance counter overflow information, holds profiling data temporarily, and provides a interface between the hardware counters and software analysis tools. This multi-functional buffer reduces the need for separate dedicated circuitry for each function, simplifying the overall hardware design while maintaining low interrupt frequency

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

4Measurement precision

If hardware sampling mechanisms store profiling information to memory using shared memory bandwidth, then profiling information is collected, but execution performance of the software program is adversely affected

Engineering Contradiction:
Improveprofiling information collectionVSAvoidexecution performance
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent implements a buffer that preliminarily stores profiling information in fast onboard memory before it needs to be transferred to external storage or analyzed by software. This preliminary buffering allows the profiling data to be captured without immediately consuming shared memory bandwidth during critical program execution, separating the data collection phase from the data transfer phase and thus minimizing performance impact

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS12393503B2Processor performance profiling using trace actions
Publication Date: 2025.08.19 RIVOS INC
  • US12393503B2 patent drawing
  • US12393503B2 patent drawing
  • US12393503B2 patent drawing

AI summary

In a general aspect, a processor can include an instruction processing unit configured to execute a software program that includes a plurality of machine-readable instructions, and a hardware performance monitoring unit. The hardware performance monitoring unit can include a plurality of counters configured to count respective processing events associated with execution of the software program, and a counter overflow monitor configured to generate an indication of a respective counter-overflow trace action in response to overflow of a counter of the plurality of counters. The processor can also include a trace encoder configured to receive the indication of the respective counter-overflow trace action from the hardware performance monitoring unit, and, in response to the indication of the respective counter-overflow trace action, perform the respective counter-overflow trace action.