To integrate the Tracealyzer target-side library (TraceRecorder), follow the general guide at https://percepio.com/gettingstarted for your RTOS.
The trace data can be transferred in different ways. Continuous streaming does typically not depend on VS Code, but the data is then typically received by Tracealyzer directly (see the Tracealyzer User Manual and the getting started guides for details).
To save snapshots from the TraceRecorder RingBuffer module, the easiest way is to use the existing debug connection and make a memory dump of the TraceRecorder data. When in a debug session and halted, run the following command in the Debug Console:
-exec dump binary value trace.bin *RecorderDataPtr
This command saves the data from the RingBuffer module to trace.bin. Open this file in Tracealyzer (File -> Open -> Open File).
For frequent use, consider setting up the Tracealyzer GDB integration. This lets Tracealyzer connect to your GDB server and retrieve snapshots with a single click.
In Tracealyzer, click the “Take Snapshot” button to open that window.
- Under “Snapshot Engine”, select “GDB”.
- Now click on the “Settings” button in the “Take Snapshot” window to open the GDB settings.
- Path to GDB: Enter the path to your arm-none-eabi-gdb. This is found in your toolchain folder.
- Path to image: Specify the path to the .elf file generated by your build.
- Command to initialize: should be “target remote localhost:<port>”, where <port> is the TCP port number of your GDB server.
- The other settings can remain unchanged. Save the Tracealyzer settings.
You can now use the “Take Snapshot” button in Tracealyzer, assuming a debug session is active in the GDB server. Note that snapshots can only be read when the system is halted. If the system is running, it will be halted when reading the snapshot.