Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tools/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ source "$PKGS_DIR/packages/tools/uORB/Kconfig"
source "$PKGS_DIR/packages/tools/RT-Tunnel/Kconfig"
source "$PKGS_DIR/packages/tools/Virtual-Terminal/Kconfig"
source "$PKGS_DIR/packages/tools/fee/Kconfig"
source "$PKGS_DIR/packages/tools/MRamTrace/Kconfig"
endmenu
30 changes: 30 additions & 0 deletions tools/MRamTrace/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
menuconfig PKG_USING_MRAMTRACE
bool "MRamTrace: low-overhead RAM-based function tracing"
default n
help
MRamTrace is a lightweight, RAM-resident function tracer for
microcontrollers. It uses GCC/Clang -finstrument-functions to capture
function enter/exit events into a ring buffer, then exports them for
offline call-graph / flamegraph analysis (Perfetto, Speedscope,
KCachegrind, FlameGraph).

if PKG_USING_MRAMTRACE

config PKG_MRAMTRACE_USING_DEMO
bool "Enable the RT-Thread demo"
default y
help
Builds a demo that runs a signal-processing workload (compiled with
-finstrument-functions), captures a trace window, and exports the
events to the console via the `ram_trace_demo` shell command.

config PKG_MRAMTRACE_DEMO_CPU_HZ
int "Demo timestamp frequency (CPU clock Hz)"
default 168000000
depends on PKG_MRAMTRACE_USING_DEMO
help
CPU clock frequency in Hz, used to convert the Cortex-M DWT cycle
counter timestamps into wall-clock time. Set this to the actual
core clock of your target.

endif
33 changes: 33 additions & 0 deletions tools/MRamTrace/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "MRamTrace",
"description": "MRamTrace is a lightweight RAM-backed function tracing and offline visualization tool for MCU firmware. It captures function enter/exit events via GCC/Clang -finstrument-functions into a ring buffer, then exports them (UART, log, file, Bluetooth, or custom backend) for offline call-graph, flamegraph, Perfetto, Speedscope and KCachegrind analysis.",
"description_zh": "MRamTrace 是一款轻量级基于 RAM 的 MCU 函数追踪与离线可视化工具,通过 GCC/Clang 的 -finstrument-functions 将函数进入/退出事件写入环形缓冲区,冻结后通过 UART、日志、文件、蓝牙或自定义后端导出,结合 ELF 生成调用图、火焰图、Perfetto、Speedscope 和 KCachegrind 等离线分析数据。",
"enable": "PKG_USING_MRAMTRACE",
"keywords": [
"trace",
"profiling",
"flamegraph",
"callgraph",
"perf",
"instrument"
],
"category": "tools",
"author": {
"name": "hanzhijian",
"email": "hanzhijian1991@gmail.com",
"github": "Zepp-Hanzj"
},
"license": "MIT",
"repository": "https://github.com/Zepp-Hanzj/MRamTrace",
"homepage": "https://github.com/Zepp-Hanzj/MRamTrace#readme",
"doc": "https://github.com/Zepp-Hanzj/MRamTrace/blob/main/README.md",
"readme": "MRamTrace is a lightweight RAM-backed function tracing and offline visualization tool for MCU firmware. It captures function enter/exit events via GCC/Clang -finstrument-functions into a ring buffer, then exports them for offline call-graph, flamegraph, Perfetto, Speedscope and KCachegrind analysis.",
"site": [
{
"version": "latest",
"URL": "https://github.com/Zepp-Hanzj/MRamTrace.git",
"filename": "MRamTrace.zip",
"VER_SHA": "81c2e76605c87eb387b06c98b8ab1162a655e888"
}
]
}