japaric / cargo-call-stack

Whole program static stack analysis
Apache License 2.0
563 stars 51 forks source link

Add alternative top-like output #90

Closed Dirbaio closed 1 year ago

Dirbaio commented 1 year ago

Depends on #89

Add ability to print a sorted list of functions consuming the most stack, useful for pinpointing and iterating when profiling applications.

Example output:

Usage Function
19824 application::main::{{closure}}
2424 embassy_executor::raw::TaskStorage<F>::poll::h6b938d2b456dfec1
2360 application::rpc::server::Server::handle::{{closure}}::{{closure}}
1320 application::config::Config::get::{{closure}}
1040 embassy_executor::raw::TaskStorage<F>::poll::h4780acebd67af819
840 embassy_executor::raw::TaskStorage<F>::poll::h58c2a8bfea77ac49
832 apollo::noise::consume_initiation
832 apollo::stack::Stack::link_received
824 apollo::noise::create_initiation
688 apollo::stack::StackInner::dispatch
680 apollo::noise::decrypt
648 embassy_executor::raw::TaskStorage<F>::poll::h7b94bb28295786aa
616 apollo::noise::encrypt
576 embassy_executor::raw::TaskStorage<F>::poll::h858b811614c343cb
512 application::time::sync::{{closure}}
...

Credits go to @lulf , all I did is rebase it.

japaric commented 1 year ago

bors merge

bors[bot] commented 1 year ago

Build succeeded:

japaric commented 1 year ago

release v0.1.15 includes this feature