I'm trying to profile my Rust project by running a binary using cargo-flamegraph. But it is not showing function name for most of the functions. Instead it is showing [main]. Some functions which I believe are system calls are still shown.
My configuration is -
Ubuntu 22.04
perf version 6.2.13
rustc 1.74.0-nightly (84a9f4c6e 2023-08-29)
flamegraph 0.6.3
I've follow the instructions in cargo-flamegraph and run it like this.
sudo sysctl -w kernel.perf_event_paranoid=-1
echo 0 | sudo tee /proc/sys/kernel/kptr_restrict
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --bin main
However in the final output the function names in my library are not shown. They are replaced by [main].
