# US 10,956,303 B2 · Trace data representation

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

- Number: US 10,956,303 B2
- Document ID: US10956303B2
- Status: Granted
- Kind: B2
- Application number: 15/915,473
- Filed: 2018-03-08
- Published: 2018-09-27
- Granted: 2021-03-23
- Earliest claimed: 2017-03-24
- Assignees: Arm Limited
- Applicants: ARM Limited
- Inventors: Alasdair Grant
- Web page: https://patentgrep.com/patent/US10956303B2

## CPC

- G06F 11/3636: {by tracing the execution of the program}
- G06F 9/30058: {Conditional branch instructions}
- G06F 9/323: {for indirect branch instructions}
- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 11/348: {Circuit details, i.e. tracer hardware}
- G06F 11/3648: {using additional hardware}
- G06F 2201/865: Monitoring of software
- G06F 2201/88: Monitoring involving counting
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Trace circuitry 22, 6 forms trace objects 34 representing a sequence of executed program instructions and comprising a start address indicator indicating a start address of a sequence of executed program instructions, a branch outcome indicator indicating a sequence of branch outcomes within the sequence of executed program instructions starting from the start address and a count indicator indicating a count of times the sequence of branch outcomes was detected. The trace circuitry may be on-chip 22 or off-chip 6. A trace object may include an indicator of a start address of a next sequence of program instructions to be followed following the sequence of program instructions represented by the trace object concerned.

## Claims

### Claim 1

Apparatus for processing data comprising:
processing circuitry to execute program instructions of a program; and
trace circuitry to generate a plurality of trace objects, wherein
a trace object represents a sequence of executed program instructions and when a sequence of executed program instructions includes multiple passes of a sequence of branch outcomes for which the sequence of branch outcomes is identical for each of the multiple passes, a single trace object represents the multiple passes as:
a start address indicator to indicate a start address of said sequence of executed program instructions;
a branch outcome indicator to indicate the sequence of branch outcomes within said sequence of executed program instructions starting from said start address; and
a count indicator included within said trace object to indicate a count of passes of said sequence of branch outcomes detected in the sequence of executed program instructions represented by the single trace object.

### Claim 2 (depends on 1)

Apparatus as claimed in claim 1, wherein said trace object comprises a next address indicator to indicate a starting address of a next sequence of program instructions to be executed following said sequence of executed program instructions.

### Claim 3 (depends on 2)

Apparatus as claimed in claim 2, wherein said trace circuitry collects together said trace objects to form profile precursor data, and said profile precursor data represents a count of pairs of branch instruction addresses with respective branch target addresses.

### Claim 4 (depends on 3)

Apparatus as claimed in claim 3, wherein said profile precursor data comprises data representing said trace objects ordered by respective represented start addresses.

### Claim 5 (depends on 4)

Apparatus as claimed in claim 4, wherein at least some of said start addresses of trace objects forming said profile precursor data are represented as address offsets from start addresses of other trace objects forming said profile precursor data.

### Claim 6 (depends on 1)

Apparatus as claimed in claim 1, wherein said count indicator saturates at one and said trace objects provide coverage data indicative of whether or not program instructions have been executed.

### Claim 7 (depends on 1)

Apparatus as claimed in claim 1, wherein said processing circuitry comprises a plurality of processors executing respective streams of program instructions and said trace circuitry is configured to generate said trace objects to represent separately said streams of program instructions.

### Claim 8 (depends on 1)

Apparatus as claimed in claim 1, wherein processing circuitry is configured to provide said trace circuitry with data indicative of branch instruction outcomes for branch instructions executed by said processing circuitry and program instruction addresses of non-static branch targets of branch instructions executed by said processing circuitry.

### Claim 9 (depends on 8)

Apparatus as claimed in claim 8, wherein said processing circuitry is configured to provide said trace circuitry with data indicative of program instruction addresses of program instructions executed by said processing circuitry as synchronization points.

### Claim 10 (depends on 8)

Apparatus as claimed in claim 8, wherein said trace circuitry is configured to respond to program instruction address data received from said processing circuitry to terminate tracking a currently tracked sequence of program instructions and to start tracking a next tracked sequence of program instructions.

### Claim 11 (depends on 1)

Apparatus as claimed in claim 1, wherein said trace circuitry collects together said trace objects to form profile precursor data, and said profile precursor data in combination with said program represents how many times given sequences of program instructions were executed by said processing circuitry.

### Claim 12 (depends on 11)

Apparatus as claimed in claim 11, wherein said profile precursor data runlength encodes said sequences of branch outcomes.

### Claim 13 (depends on 1)

Apparatus as claimed in claim 1 wherein said trace object specifies a plurality of branching execution paths corresponding to respective sequences of branch outcomes starting from a common start address passing through shared intermediate branching nodes and individually terminating in a leaf node.

### Claim 14 (depends on 13)

Apparatus as claimed in claim 13, wherein each of said leaf nodes has an associated count indicator indicating a count of times a branching execution path terminating at said leaf node was executed by said processing circuitry.

### Claim 15 (depends on 14)

Apparatus as claimed in claim 14, wherein a trace object comprising a given intermediate node represents a count of how many times a sequence of program instruction extending between said common start address and said given intermediate node was executed by a sum of count values associated with leaf nodes of executing paths that include said given intermediate node.

### Claim 16 (depends on 13)

Apparatus as claimed in claim 13, wherein at least some of leaf nodes have an associated next address indicator indicating an address of a next program instruction executed by said processing circuitry following a branching execution path terminating at said leaf node.

### Claim 17 (depends on 1)

Apparatus as claimed in claim 1, wherein said processing circuitry is a processor core of an integrated circuit and said trace circuitry is one of:
on-chip trace circuitry within said integrated circuit; and
off-chip trace circuitry coupled via a communication interface with said integrated circuit.

### Claim 18

Trace circuitry for coupling to processing circuitry executing program instructions of a program to generate a plurality of trace objects, wherein
a trace object represents a sequence of executed program instructions and when a sequence of executed program instructions includes multiples passes of a sequence of branch outcomes for which the sequence of branch outcomes is identical for each of multiple passes, a single trace object represents the multiple passes as:
a start address indicator to indicate a start address of said sequence of executed program instructions;
a branch outcome indicator to indicate the sequence of branch outcomes within said sequence of executed program instructions starting from said start address; and
a count indicator included within said trace object to indicate a count of passes of said sequence of executed program instructions executed in the sequence of executed program instructions represented by the trace object.

### Claim 19

A method of processing data comprising:
executing program instructions of a program; and
generating a plurality of trace objects, wherein
a trace object represents a sequence of executed program instructions and when a sequence of executed program instructions includes multiple passes of a sequence of branch outcomes for which the sequence of branch outcomes is identical for each of the multiple passes, a single trace object represents the multiple passes as:
a start address indicator to indicate a start address of said sequence of executed program instructions;
a branch outcome indicator to indicate the sequence of branch outcomes within said sequence of executed program instructions starting from said start address; and
a count indicator included within said trace object to indicate a count of passes of said sequence of executed program instructions executed in the sequence of executed program instructions represented by the trace object.

### Claim 20

A method of analyzing execution of a program comprising:
receiving data specifying program instructions of said program;
receiving data specifying trace objects representing a sequence of executed program instructions and when a sequence of executed program instructions includes multiple passes of a sequence of branch outcomes for which the sequence of branch outcomes is identical for each of the multiple passes, a single trace object represents the multiple passes as:
a start address indicator to indicate a start address of said sequence of executed program instructions;
a branch outcome indicator to indicate the sequence of branch outcomes within said sequence of executed program instructions starting from said start address; and
a count indicator included within said trace object to indicate a count of passes of said sequence of executed program instructions executed in the sequence of executed program instructions represented by the trace object; and
analyzing said data specifying program instructions and said data specifying trace objects to determine at least how many times a given program instruction was executed.

### Claim 21 (depends on 20)

A method as claimed in claim 20, wherein said analyzing determines in which execution paths said given program instruction is included.
