# US 2024/0403057 A1 · Profiling system and methods

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0403057 A1
- Document ID: US20240403057A1
- Status: Published application
- Kind: A1
- Application number: 18/733,006
- Filed: 2024-06-04
- Published: 2024-12-05
- Earliest claimed: 2023-06-05
- Applicants: Norwegian University of Science and Technology (NTNU); Universiteit Gent
- Inventors: Magnus Jahre; Björn Gottschall; Lieven Eeckhout
- Web page: https://patentgrep.com/patent/US20240403057A1

## CPC

- G06F 9/3836: {Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution}
- G06F 9/3838: {Dependency mechanisms, e.g. register scoreboarding}
- G06F 9/3854: {Instruction completion, e.g. retiring, committing or graduating}
- G06F 9/38585: {with result invalidation, e.g. nullification}
- G06F 9/3861: {Recovery, e.g. branch miss-prediction, exception handling (error detection or correction G06F11/00)}
- G06F 11/3409: {for performance assessment}
- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 2201/86: Event-based monitoring
- G06F 2201/865: Monitoring of software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A processing system has a processor and profiling circuitry. The processor is configured to commit instructions in a program order, and comprises circuitry for determining and storing performance-event data for each instruction committed by the processor. The performance-event data for each instruction indicates whether the instruction experiences any of a predetermined set of one or more performance events. The profiling circuitry generates sample data at intervals, and writes the sample data to a sample register or memory. The sample data generated at each interval identifies one or more instructions that are next-to-be committed by the processor or one or more instructions that were last committed by the processor, and comprises the respective performance-event data for each of the identified instructions.

## Claims

### Claim 1

A processing system comprising:
a processor; and
profiling circuitry,
wherein the processor is configured to commit instructions in a program order, and comprises circuitry for determining and storing performance-event data for each instruction committed by the processor, wherein the performance-event data for each instruction indicates whether the instruction experiences any of a predetermined set of one or more performance events; and
wherein the profiling circuitry is configured to generate sample data at intervals, and to write the sample data to a sample register or memory, wherein the sample data generated at each interval identifies one or more instructions that are next-to-be committed by the processor or one or more instructions that were last committed by the processor, and comprises the respective performance-event data for each of the identified instructions.

### Claim 2 (depends on 1)

The processing system of claim 1, wherein the one or more performance events in the predetermined set are respective micro-architectural events that occur in the pipeline of the processor and slow down the running of the processor.

### Claim 3 (depends on 1)

The processing system of claim 1, wherein the processor comprises a front-end and a back-end, and wherein the predetermined set of one or more performance events comprises at least one event that occurs in the front-end of the processor and at least one event that occurs in the back-end of the processor.

### Claim 4 (depends on 1)

The processing system of claim 1, wherein the predetermined set of one or more performance events comprises any one or more, or all, of the following performance events: an instruction cache miss, an instruction translation look-aside buffer (TLB) miss, a store instruction stalled at dispatch, a mis-predicted branch, an instruction caused except, a memory ordering violation, a data cache miss, a data TLB miss, and a last-level cache (LLC) miss caused by a load instruction.

### Claim 5 (depends on 1)

The processing system of claim 1, wherein the performance-event data for each instruction comprises a respective performance-event vector, wherein the performance-event vector comprises one or more bits of information, wherein each bit in the vector indicates whether the instruction has experienced a different respective performance event from the predetermined set of performance events.

### Claim 6 (depends on 1)

The processing system of claim 1, wherein the processor is configured for executing software programs comprising static instructions and is configured to decode each static instruction into one or more dynamic instructions, and wherein, for each dynamic instruction committed by the processor, the processor is configured to store data identifying one or more respective static instructions from which the dynamic instruction was derived.

### Claim 7 (depends on 6)

The processing system of claim 6, wherein the processor supports execution of instructions out of program order and comprises a reorder buffer, and wherein the processor is configured, for each dynamic instruction committed by the processor, to store in the reorder buffer the performance-event data and the data identifying the respective one or more static instructions from which the dynamic instruction was derived.

### Claim 8 (depends on 1)

The processing system of claim 1, comprising state-determining circuitry configured to access information stored by the processor for committing instructions in program order, and to use the information to determine which of a computing state, a stalled state, a drained state and a flushed state the processor is in; and wherein the profiling circuitry is configured, when the processor is in the computing state, the drained state, or the stalled state, to generate sample data that identifies one or more instructions that are next to be committed by the processor, and, when the processor is in the flushed state, to generate sample data that identifies an instruction that was last committed by the processor.

### Claim 9 (depends on 8)

The processing system of claim 8, wherein the state-determining circuitry is configured to write state data to the sample register or memory that is representative of the determined state.

### Claim 10 (depends on 8)

The processing system of claim 8, wherein the profiling circuitry is configured, when the processor is in the computing state and will commit a plurality of instructions at the next commit cycle, to write sample data to the sample register or memory that identifies every instruction that is to be committed by the processor in the next commit cycle and that comprises the respective performance-event data for each of the identified instructions.

### Claim 11 (depends on 1)

The processing system of claim 1, wherein the intervals at which the profiling circuitry is configured to generate sample data are regular sampling intervals.

### Claim 12 (depends on 1)

The processing system of claim 1, wherein the profiling circuitry comprises sampling circuitry, and wherein the sampling circuitry is configured to write sample data to the sample register or memory in response to receiving a command from outside the sampling circuitry.

### Claim 13 (depends on 1)

The processing system of claim 1, comprising a memory storing profiling software, wherein the profiling software comprises instructions for processing at least some of the sample data to generate either or both of an instruction-level profile and a performance-event-level profile of a software program executed by the processor.

### Claim 14

A method for profiling execution of a processor, the method comprising:
determining and storing performance-event data for each instruction committed by the processor, wherein the performance-event data for each instruction indicates whether the instruction experiences any of a predetermined set of one or more performance events; and
generating sample data at intervals, and writing the sample data to a sample register or memory, wherein the sample data generated at each interval identifies one or more instructions that are next-to-be committed by the processor or one or more instructions that were last committed by the processor, and comprises the respective performance-event data for each of the identified instructions.

### Claim 15 (depends on 1)

A method of developing a software program comprising:
executing a version of the software program on a processing system according to claim 1 to obtain sample data in the sample register or memory of the processing system;
processing at least some of the sample data to generate either or both of an instruction-level profile and a performance-event-level profile of the software program executed by the processor; and
using either or both of the instruction-level profile and the performance-event-level profile to create an improved version of the software program.
