flamegraph
flamegraph copied to clipboard
Incorrect warning given when running flamegraph for a unit test
When running the flamegraph command, I get the following warning:
WARNING: profiling without debuginfo. Enable symbol information by adding the following lines to Cargo.toml:
[profile.bench]
debug = true
Or set this environment variable:
CARGO_PROFILE_BENCH_DEBUG=true
However, this is incorrect since to make this warning go away, I need to use profile.release
instead. I am using the following command:
cargo flamegraph --unit-test -- example_test
It seems from here: https://github.com/flamegraph-rs/flamegraph/blob/6de8c66f2dda332ba83a74f3393a57dbdaba6ea7/src/bin/cargo-flamegraph.rs#L245 that unit tests should set the profile as release but that doesn't seem to be happening.
Thanks for the report. Unfortunately I probably won't be able to address this anytime soon -- however, happy to review a PR if you're able to suggest a fix (or answer questions about doing so).
@samyak-jain how did you manage to get the warning? I'm trying the command and for me it reports:
WARNING: profiling without debuginfo. Enable symbol information by adding the following lines to Cargo.toml:
[profile.release]
debug = true
Or set this environment variable:
CARGO_PROFILE_RELEASE_DEBUG=true