7.3.1. P-headers

P-headers represent a sequence of Atoms that indicate the execution of instructions or Java bytecodes. There are three atom types, as follows:

These atoms are mapped onto several P-header encodings for efficient output in the trace. Different encodings are, depending on whether cycle-accurate mode is enabled. Where cycle-accurate tracing is not required, a more compressible stream can be generated by removing the W atoms.

Generation

The rules for P-header generation are implementation specific. Any P-headers that unpack to the correct set of P-header atoms is permitted, however inefficient. In the extreme, a device might generate one P-header per cycle, although this is not a preferred implementation.

P-header encodings in non cycle-accurate mode

The P-header encodings in non cycle-accurate mode are listed in Table 7.2.

Table 7.2. P-header encodings in non cycle-accurate mode

DescriptionValuePayload (max bytes)Remarks
Format 1 P-headerb1NEEEE00None

0-15 x E, 0-1 x N

Bits [5:2], shown as EEEE, are the count of E atoms.

Format 2 P-headerb1000FF10None

x (N/nE), 1 x (N/nE)

Bit [3] represents the first instruction and bit [2] represents the second instruction.

Reservedb1001xx10--
Reservedb101xxx10--
Reservedb11xxxx10--

Example 7.1 shows two non cycle-accurate mode encodings and their meanings.

Example 7.1. P-header encodings in non cycle-accurate mode

A header of value b11001000 is encountered in the trace when cycle-accurate mode is disabled. This is a format 1 P-header representing the atoms EEN. It indicates that two instructions were executed and passed their condition codes, followed by one instruction that failed its condition codes.

A header of value b10001010 is encountered in the trace when cycle-accurate mode is disabled. This is a format 2 P-header representing the atoms NE. It indicates that one instruction was executed that failed its condition codes, followed by one instruction that passed its condition codes.


P-header encodings in cycle-accurate mode

For details of the possible use of P-headers for tracing gaps in trace during cycle-accurate tracing, see Tracing long gaps in cycle-accurate trace.

The P-header encodings in cycle-accurate mode are listed in Table 7.3.

Table 7.3. Cycle count and P-header encodings in cycle-accurate mode

DescriptionValuePayload (max bytes)Remarks
Cycle countb00000100Cycle count (5)1 to (232-1) x W
Format 0 P-headerb10000000None

W

Permitted in ETMv3.0 only.

In all other versions of the ETM this encoding is reserved.

Format 1 P-header

b1N0EEE00

(except b10000000)

None

0-7 x (WE), 0-1 x WN

Bits [4:2], shown as EEE, are the count of WE atoms.

Format 2 P-headerb1000FF10None

x W, 1 x (N/nE), 1 x (N/nE)

Bit [3] represents the first instruction and bit [2] represents the second instruction.

Format 3 P-headerb1E1WWW00None

1-8 x W, 0-1 x E

Bits [4:2], shown as WWW, are the count of W atoms.

Format 4 P-headerb10010F10None

1 x (N/nE)

Only supported in ETMv3.3 and later.

In ETMv3.2 and earlier the 10010x10 encodings are reserved.

Reservedb10011x10--
Reservedb101xxx10--
Reservedb11xxxx10--

Example 7.2 shows three non cycle-accurate mode encodings and their meanings.

Example 7.2. P-header encodings in cycle-accurate mode

A header of value b1100 1000 is encountered in the trace when cycle-accurate mode is enabled. This is a format 1 P-header representing the atoms WEWEWN, that indicates that three instructions were executed as follows:

Cycle 1

An instruction was executed and passed its condition codes.

Cycle 2

An instruction was executed and passed its condition codes.

Cycle 3

An instruction was executed and failed its condition codes.

A header of value b1000 1010 is encountered in the trace when cycle-accurate mode is enabled. This is a format 2 P-header representing the atoms WNE, that indicates that two instructions were executed as follows:

Cycle 1

An instruction was executed that failed its condition codes, followed by an instruction that passed its condition codes.

A header of value b1110 1000 is encountered in the trace when cycle-accurate mode is enabled. This is a format 3 P-header representing the atoms WWWE, that indicates that one instruction was executed as follows:

Cycle 1

No instructions were executed.

Cycle 2

No instructions were executed.

Cycle 3

An instruction was executed and passed its condition codes.


The cycle-accurate mode format 4 P-header, ETMv3.3 and later

ETMv3.3 introduces a format 4 P-header in cycle-accurate mode. This packet is used to indicate that an instruction has executed without any cycle boundary. This is required when two instructions are executed in the same cycle and the first instruction is either an indirect branch or has some data associated with it.

The encoding of the format 4 P-header is included in Table 7.3. Table 7.4 illustrates a case where this packet is required.

Table 7.4. Use of format 4 P-header in cycle-accurate mode

Cycle countEventAtomsPacket, with P-header encoding
1000Instruction at address 0x1000 in ALU pipe 0W EFormat 1 P-header: b10000100
1000Data for instruction in ALU pipe 0DData header
1000Instruction at address 0x1004 in ALU pipe 1EFormat 4 P-header: b10010010

Copyright © 1999-2002, 2004-2009, 2011 ARM Limited. All rights reserved.ARM IHI 0014Q
Non-ConfidentialID101211