8 releases

0.1.7 Dec 1, 2020
0.1.6 Dec 1, 2020
0.1.5 Nov 29, 2020

#121 in Cargo plugins

Download history 4/week @ 2021-05-30 9/week @ 2021-06-06 2/week @ 2021-06-13 1/week @ 2021-06-20 3/week @ 2021-06-27 9/week @ 2021-07-04 6/week @ 2021-07-11 20/week @ 2021-07-18 14/week @ 2021-07-25 21/week @ 2021-08-01 3/week @ 2021-08-08 18/week @ 2021-08-15 6/week @ 2021-08-22 4/week @ 2021-08-29 2/week @ 2021-09-05 6/week @ 2021-09-12

58 downloads per month

Apache-2.0/MIT

36KB
913 lines

cargo-profile

Profiling rust program made easy.

Installation

cargo install cargo-profile

Features

flamegraph

Supported os: linux, mac os.

Usage

# Just use cargo's syntax
cargo profile flamegraph bench --lib
# If you have a my_bench in benches directory, you can do
cargo profile flamegraph bench --bench my_bench

bin-path

Binaries built by cargo have some random strings as a suffix, and it makes invoking files generated by cargo harder. Here comes cargo profile bin-path to aid it.

Usage

perf record `cargo profile bin-path bench --bench fixture`

cpu time profiling

You can get cpu time usage per function on mac os using the command below.

(For linux, you can use perf directly, although I'll add linux aupport soon.)

Usage

cargo profile cpu per-fn bench --bench fixture

trace

Note: It does not support dtrace and perf yet. Same as above, I'll implement it if there's a need.

xctrace

xctrace is a tool to profile applications on

Usage

cargo profile trace xctrace bench --lib

cargo profile trace xctrace bench --bench my_bench

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~6MB
~122K SLoC