On 12/09/2019 01:53, Raj Swaminathan - C wrote:

Hello,


I have had some success streaming instruction trace to my Linux PC using RDDI (from ARM Development studio 2019) and a DStreamer ST. However I am also 

having some problems:


1. Failure to stop trace cleanly


I have enabled streaming from an ETM attached to a Cortex-R5 core.


As described in the RDDI documentation, to stop streaming, I call StreamingTrace_Flush() and wait for

RDDI_STREAMING_TRACE_EVENT_TYPE_END_OF_DATA event. 


Next i call StreamingTrace_Stop() which succeeds and then try StreamingTrace_Detach() which seems to fail with the following assert.

tpp.c:84: __pthread_tpp_change_priority: Assertion `new_prio == -1 || (new_prio >= fifo_min_prio && new_prio <= fifo_max_prio)' failed.
Aborted (core dumped)


If i try to avoid calling StreamingTrace_{Detach, Stop}  then Debug_CloseConn to the core never returns and i get a seg fault. 


2.  Raw trace does not start with A-SYNC bits


I do see A-SYNC bits later but my understanding was ETM always sends the A-SYNC bits first.



Cheers,

raj




Hi Raj,


This mailing list is for discussion and development of the driver and tools support for self-hosted trace on linux.  For support with Arm DS you should contact Arm's support team at https://developer.arm.com/support or post on https://community.arm.com/developer/tools-software/tools.


However in this case, I might be able to offer a couple of hints:


1.  Do you call StreamingTrace_WaitForEvent() between StreamingTrace_Stop() and StreamingTrace_Detach()?  You need to do this for each buffer submitted with StreamingTrace_SubmitEventBuffer() to transfer ownership of the data buffers back to your code.


There is an example program at https://github.com/ARM-software/coresight-wire-protocol/blob/master/rddi_streaming_trace/streaming_trace_capture/main.c which shows how to use this interface.



2. To ensure you capture the start of trace, you should start capture first, then enable the other CoreSight devices, and finally start the ETM.  At the end of trace, you should stop the ETM first, then stop the capture.



Regards


Rob