0

I am working with two HW platforms that include two ARM processors:

  • Cortex-A15 and
  • Cortex-R5.

I would like to export via Lauterbach Trace32 a mixed trace composed of program flow and BMC values (benchmark counters / performance counters). To clarify my intent, I provide the following synthetic example:

Instruction | Cache Misses | ... |
------------+--------------+------
 0x1234     | 1            | 0
 0x1235     | 1            | 0
 0x1236     | 2            | 0 

I tried to utilize the following commands to properly set the tracer:

bmc.PMN0 DCMISS
bmc.export ON
bmc.trace ON
bmc.select PMN0

Unfortunately, I am not able to export a trace containing the BMC I set. I already tried with some of the trace.export commands but I never succeeded.

Does anyone know how to produce such a trace? Thanks.

acornagl
  • 521
  • 5
  • 24
  • Are you sure that you SoC is actually able to somehow export the values of the performance counters to the CoreSight ATB? As far as I know some Cortex-M chips can do this via the STM, but I don't thing that this is physically possible with Cortex-A. – Holger Mar 29 '19 at 15:32
  • What you always can do is using the SNOOPer to sample the BMC values. – Holger Mar 29 '19 at 15:33
  • I am not sure, I am relying on what is written in the Lauterbach [ARM debugger manual](documenthttp://www2.lauterbach.com/pdf/debugger_arm.pdf) . The document reports: "The counters of Cortex-A/R cores can be read at run-time.". – acornagl Apr 01 '19 at 11:47

1 Answers1

1

On Cortex-A and Cortex-R the performance counters (aka. "BenchMark Counters (BMC)") can usually not be transmitted via CoreSight trace.
(Btw.: Some Cortex-M can export the BMC via CoreSight ITM. A list of these processors is listed in this table, DWT column).

However the performance counters can be read during run-time, which allows to sample their values during run-time.

To sample the performance counters during run-time enable the SNOOPer with SNOOP.OFF and SNOOP.AutoArm ON and select the BMC counters with SNOOPer.Mode BMC. View the results with SNOOPer.List.

To save the results to hard drive for later analysis you can use SNOOPer.SAVE * and re-load it later with SNOOPer.LOAD *

acornagl
  • 521
  • 5
  • 24
Holger
  • 3,920
  • 1
  • 13
  • 35
  • Thanks for the answer. What do you think about bus events (EVNTBUSm)? Can't I trace these events tracing the bus? – acornagl Apr 04 '19 at 08:54
  • I am not totally sure, but I think you can record those events with ETMv4 (which is used on the Cortex-A15) but not with the ETMv3 (which is used on the Cortex-R5). Maybe you should contact the Lauterbach support about this. – Holger Apr 06 '19 at 22:33
  • Thanks, I am going to mark your answer as the one that "solved" my problem. I am also going to add a link in your answer that could be helpful for someone else in the future. – acornagl Apr 08 '19 at 13:45