Skip to content

PlayerData/rust-stack-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Analyse Rust Stack Allocations

Small utility to analyse stack size for rust libraries.

Installation

Dependencies

poetry install

Also requires that cargo and llvm-readobj are on your PATH.

On Mac, llvm-readobj can be installed using Homebrew:

brew install llvm

For convenience, rust_stack_analysis will automatically add Homebrew's default LLVM bin directory to PATH while attempting to execute llvm-readobj.

Rust

Until rustc's -Z emit-stack-size feature stabilizes (rust-lang/rust#54192), you must have the nightly toolchain installed.

rustup toolchain install nightly

Usage

Build for analysis

Enter the poetry shell:

poetry shell

From the root of your project:

analyse-rust-stack build

Pass any additional flags through to cargo (e.g.):

analyse-rust-stack build -- --no-default-features --target thumbv7em-none-eabi

Analyse

Now request analysis (e.g.):

analyse-rust-stack analyse target/thumbv7em-none-eabi/release/libgateway_nrf52840_rust.a
func_a: 10064 bytes
func_b: 4256 bytes
func_c: 792 bytes

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages