A static analyzer for Rust programs that computes stack usage and generates call graphs, primarily for embedded systems.
cargo-call-stack is a Rust tool that performs static, whole-program stack usage analysis and generates call graphs. It helps developers understand and optimize memory consumption in embedded and resource-constrained applications by analyzing function call hierarchies and computing stack bounds.
Embedded Rust developers working on microcontroller or `no_std` projects where stack overflow prevention is critical, and those needing to visualize program call structures for debugging or optimization.
It provides a unique, automated way to analyze stack usage statically without runtime instrumentation, offering insights into maximum stack consumption and call relationships that are essential for reliable embedded systems.
Whole program static stack analysis
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses LLVM's -Z emit-stack-sizes to compute local and maximum stack usage per function, providing exact byte counts for embedded memory planning.
Generates Graphviz dot files that visualize the entire call hierarchy, helping developers understand function relationships and optimize code paths.
Allows filtering the call graph from any entry function, enabling focused stack usage analysis on specific subsystems or functions.
Can compute stack bounds for recursive functions where possible, addressing complex scenarios in embedded control flow.
Relies on the unstable -Z stack-sizes feature and internal rustc details, making it fragile and prone to breakage with toolchain updates.
Analysis for function pointers and dynamic dispatch is imperfect, often missing edges or including incorrect ones, limiting accuracy in polymorphic code.
Only supports ELF binaries and has inline assembly analysis primarily for ARM Cortex-M, restricting its use in other embedded platforms.