Microcontroller C/C++ runtime execution profiling toolkit using GNU instrumentation calls, SEGGER RTT and 🔬speedscope.
-
To use this library, you need
JLinkRTTLogger
from the J-Link Software and Documentation Pack. There is are releases available for Linux. -
Build and flash the firmware to the target MCU.
-
Ensure JLink is connected, run the device and launch the
JLinkRTTLogger
:sudo JLinkRTTLogger -Device STM32H750VB -If SWD -Speed 4000 -RTTChannel 2 ucprof.dat
-
Generate symbols file:
arm-none-eabi-nm -lnC .build/platform/STM32H750/STM32H750 > .build/platform/STM32H750/STM32H750.symbols
-
Fold stacks of all thread calls in
ucprof.dat
record and export a Speedscope JSON for each thread:python3 ucprof.py .build/platform/STM32H750/STM32H750.symbols ucprof.dat
-
Open
ucprof_*.json
in Speedscope.The
ucprof_0.json
will be the thread with the most stack calls, and theucprof_1.json
will be the second most, and so on.