flamegraph-rs / flamegraph

Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3
Apache License 2.0
4.61k stars 141 forks source link

Unknown in svg image (Rust) #329

Closed nricciardi closed 2 months ago

nricciardi commented 2 months ago

I'm trying to profile my Rust project, but when I run flamegraph and then open flamegraph.svg I don't see function name, instead I see [unknown].

How can I fix?

flamegraph

djc commented 2 months ago

What OS are you on? What debug info have you configured for the Cargo profile you're profiling against?

nricciardi commented 2 months ago

I'm on Linux Mint 21.3 (kernel: 5.15.0-113-generic).

Following my Cargo.toml file:

[package]
...

[dependencies]
anyhow = "1.0.75"
base64 = "0.21.5"
build_html = "2.4.0"
clap = "4.4.18"
env_logger = "0.10.1"
image = "0.24.8"
log = "0.4.20"
notify = "6.1.1"
oxipng = { version = "9.1.1", features = ["parallel"]}
rayon = "1.8.0"
regex = "1.10.2"
reqwest = { version = "0.11.24", features = ["blocking"] }
serde = { version = "1.0.195", features = ["derive"] }
serde_json = "1.0.113"
serde_yaml = "0.9.31"
simple_logger = "4.3.3"
thiserror = "1.0.50"
url = "2.5.0"

[profile.release]
debug = true
djc commented 2 months ago

That looks okay. Are you sure flamegraph is using the release profile? Sorry, I'm not sure I can offer much further support here. Maybe try the perf CLI directly and see if it can see the debug symbols? I'm guessing it can't.

nricciardi commented 2 months ago

I have fix [unknown] using:

echo 0 | sudo tee /proc/sys/kernel/kptr_restrict