https://github.com/timeexceed/perf-prof-toolchain
https://github.com/timeexceed/perf-prof-toolchain
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/timeexceed/perf-prof-toolchain
- Owner: TimeExceed
- Created: 2022-09-26T09:15:22.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-27T02:52:43.000Z (over 3 years ago)
- Last Synced: 2024-04-20T08:08:32.447Z (about 2 years ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Toolchain to perf a Rust/C++ binary
## Prerequisites
1. install `perf`
```console
$ sudo apt-get install -y linux-tools-common linux-tools-generic
```
## Steps
1. rebuild the project with debug info
* For Rust, add `debug = true` in the `[profile.release]` section.
* For C++, add `-g` for release build.
1. profile with `flamegraph`
```console
$ sudo /path/to/flamegraph -- ${EXECUTABLE_AND_ARGS}
```
## References
* [Flame Graphs in main page of Brendan Gregg](https://www.brendangregg.com/flamegraphs.html)
* [Repository of Flame Graphs from Brendan Gregg](https://github.com/brendangregg/FlameGraph)
* [One single command implemented by Rust](https://github.com/flamegraph-rs/flamegraph)