![]() ![]() | |||
![]() ![]() | ![]() ![]() | ||
| |||
| Home > Program Flow Tracing > Timestamping | |||
The PFT architecture supports timestamping. This is a mechanism where a time value is inserted into the trace stream periodically. The PTM inserts additional timestamps in the trace stream at points where you are likely to find them useful. A system that implements timestamping must include a 48-bit counter to provide the source of the timestamp values, and must broadcast the same value to all compatible trace sources in the system. Each trace source samples the timestamp value and inserts it as an absolute value in the trace stream.
This timestamping mechanism provides the following features:
Correlation of multiple independent trace sources in a system, for example, multiple PTMs in a multi-processor environment.
Simple analysis of code performance, with a coarse granularity.
Faster searching of large trace buffers when looking for points in multiple trace streams where code was executed in close proximity.
The PTM inserts timestamps in the trace stream with optional cycle accuracy. It also inserts timestamps:
when it traces an ISB operation
when it traces a DMB or DSB operation, if this option is supported.
This enables close temporal correlation of code around spinlocks and other inter-processor communications.
Bit [25] of the ETMCCER determines whether the PTM inserts timestamps for DMB and DSB operations, see Configuration Code Extension Register, ETMCCER.
Each timestamp value inserted in the trace is a gray-coded number. The PTM outputs the 48-bit gray code that is calculated from a 48-bit binary number using the following equation, where gray[n] is the nth bit of the resultant gray code, and binary[n] is the nth bit of the binary number:
gray[n] = binary[n] XOR binary[n+1]
The debugger generates the 48-bit binary number from the traced 48-bit gray code using the following equation:
binary[n] = XOR(gray[47:n]).