- I first used the tool
flamegraph(which relies on
perf) to profile my Rust application. It works at first until it throw segmentation fault which seems to be a bug in
- I then tried to profile my Rust application using
valgrind. It sort of works but I found another issue with it. It seems that
valgrinddumps performance data of public methods only. Manually marking methods as
valgrinddump performance data for them but there were a few exceptions. I wonder is there any special configuration of
valgrindthat I missed or is this a compatible issue of
- Does anyone have good experiences with other (CPU) profiling tools for Rust?
Did you add debug info to your release build?
[profile.release] debug = true in
Cargo.toml. This should give you data for private methods too.
On macOS I use Xcode Instruments.app.
Yes, I do have
debug = true for the release profile. And I've tried the dev profile too. Both of them have the same issue. I'm using flamegraph and valgrind in Ubuntu 20.04 (via Docker).
Extra flag that might help with perf build
I tend to run
perf record with
I've used [cargo flamegraph] (https://crates.io/crates/flamegraph) successfully in the past. Maybe it will work better or more easily than the flamegraph you used?
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.