Trace Events

Trace events are a tuple (id, value). The identifier (id) can be used to identify the type of event. To achieve interoperability between implementations, some identifiers are specified, while others can be used for vendor extensions.

Generally, the trace identifiers are divided into these groups:

Identifiers Group Description
0x0000 N/A Not used
0x0001 - 0x3fff USER User-defined trace events
0x4000 - 0x7fff COM Commonly defined trace events
0x8000 - 0xbfff N/A Reserved
0xc000 - 0xffff SYS System-generated trace events

The implementation of all trace events is optional, both for software and for hardware.

User-defined trace events (USER)

Trace events from this group are generated from software execution. There are many possibilities to implement them in hardware, but from the ABI there are generally two data items that a software writes to emit a trace event: first it writes the value and then it writes the id.

As those are two memory accesses in two distinct operations the following properties must hold:

  • Sequential consistency: The write to the second data item must occur after the first data item. This property is usually enforced with memory fences.
  • Atomicity: The first data item must not be changed in multithreaded systems or by interrupt processing in general.

For more details see the section Trace Generation in the following.

Commonly defined trace events (COM)

Those are trace events identical to the user-defined trace events, but that have a commonly defined semantic meaning. Their semantic meaning is therefore still transparent to the hardware module, but common to all platforms. This eases implementation of trace debugger tools.

Identifier Name Description
0x4000 THREAD_NAME Emit a thread name, emitted repeatedly

System-generated trace events (SYS)

This group of trace events are generated by the hardware or by the operating/runtime system. For the latter the same method as user-defined trace events is used. For hardware-generated events the method of emitting the trace event is core-specific and examples are described in the the section Trace Generation.

Identifier Name Description
0x8000 THREAD_SWITCH Unique value of the scheduled thread