5.3.2. Using the ETB for profiling

The ETB RAM cannot store enough trace to produce reliable profiling information. However, you can perform profiling with an ETB if the following apply:

This method takes advantage of the FULL output from the ETB, that you must connect to a CTI for cross-triggering. You must also connect an interrupt request signal to one of the CTI outputs. Both signals might be on the same CTI, or they might be on different CTIs connected by a CTM.

Configure the system as follows:

  1. Arrange an off-chip store to store the trace in.

  2. Configure the CTI to cause the generation of an interrupt when the FULL signal occurs. This indicates that the ETB is full of trace.

  3. Install an interrupt handler that is invoked when the CTI requests an interrupt. This handler must:

    • disable ETB trace capture

    • transfer the ETB RAM contents to an off-chip store

    • initialize and re-enable the ETB as before.

  4. Configure the ETB to accept trace data and the trace sources to produce trace.

This drains the contents of the ETB whenever the ETB becomes full. Some trace is lost, because of latency between the output of the FULL signal and the invocation of the interrupt handler. To prevent the loss of any trace, you can configure the ETB to cause an interrupt early by causing the ETB to wrap around before it is full. To do this, configure the system as follows:

  1. Arrange an off-chip store.

  2. Configure the CTI to cause the generation of an interrupt when the FULL signal occurs.

  3. Configure the CTI to output a trigger to the ETB when the FULL signal occurs.

  4. Decide how many ETB entries (n) before the end of the buffer to reserve until after the generation of the FULL signal:

    • set the ETB write pointer to n

    • set the ETB trigger counter to slightly less than n.

  5. Install an interrupt handler that reinitializes the ETB in this new way. The handler must place the first n entries in the ETB RAM after the remaining entries in the trace store.

Copyright © 2004, 2007, 2010 ARM Limited. All rights reserved.ARM DGI 0012D
Non-ConfidentialID062610