I have a system that only has an ETF as a trace sink, so I only have 8 kB of memory available for my trace, which limits me to quite small programs. What would be the go-to solution for longer trace-runs, when I want to do on- device-trace-capturing? Is it possible at all with my setup? It is important that I don't loose any trace, I need a trace of the whole execution. For tracing I use CSAL.
First question - have you got multiple cores, and can you dedicate one core to run CSAL and accept that you won't be able to trace that core?
If so, then you can use "halted debug" mode, triggered by the ETF buffer getting nearly full. Let's say 0 is the core that's running CSAL and you are tracing cores 1..N. You would configure the on-chip cross-trigger matrix to connect the "buffer full" signal from the ETF to the halt input of cores 1..N. On core 0 you detect a buffer full condition, extract the ETF contents, save it somewhere and restart cores 1..N.
Now clearly if cores 0..N are all running something like Linux, it can be problematic to halt cores - they might be holding locks, or they might be needed to run in order to service whatever I/O core 0 is doing. If you're not careful, core 0 ends up in a wait that can only be resolved by something on core 1..N which are stopped and waiting for core 0 to restart them. So ideally, CSAL should be running on a dedicated core.
Lots more details but that's the general scenario. I think you have to accept that if you collect trace on-chip (using CSAL) you can't have absolutely everything traced all the time. In particular you probably won't be able to trace the CSAL code itself.
The cores won't be responsive while they're halted, which could be a problem if the system is controlling or interacting in real time.
In principle you might be able to transfer the ETF contents to memory using a DMA engine (i.e. get it to do the word-by-word transfers that CSAL would be doing). Again though, to be sure of capturing all trace you might have to halt the cores.
Al
Best regards, Finn _______________________________________________ CoreSight mailing list -- coresight@lists.linaro.org To unsubscribe send an email to coresight-leave@lists.linaro.org