The following command
$ cargo build
produces a non-optimized build with debugging information. On the con
As shown in the Cargo documentation, modify the release
profile to include debugging symbols:
[profile.release]
debug = true
Note that the release
profile and the bench
profile differ.
See also
Or basically any of the top search results for "rust profiling":
Another option that I found that does not require changing Cargo.toml
is to use the RUSTFLAGS environment variable:
$ RUSTFLAGS=-g cargo build --release