flamegraph-rs / flamegraph

Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

perf regression: Symbols/function names not demangled

arctic-alpaca opened this issue · comments

Hi,

the function names in generated flamegraphs have become encapsulated by other characters. Please see the attached screenshot for details:
grafik

This started happening after using version 0.6.2 without issue for some time and updating to 0.6.3 did not change the behavior.

I'm guessing this is triggered by my environment as flamegraph was not updated at the time the issue appeared but I don't know what could be causing this.

Command used:
cargo flamegraph --bench ipv6 -- --bench --profile-time 10

Profile:

[profile.bench]
debug = true

Rust version: rustc 1.74.0-nightly (5c6a7e71c 2023-08-20)

What platform are you using flamegraph on? How is the code that you're profiling generated?

I'm using Fedora 38 (uname -r prints 6.4.11-200.fc38.x86_64) on x86_64.

How is the code that you're profiling generated?

I'm not entirely sure what you mean by this. I'm using criterion (version 0.5.1) with code I wrote and successfully generated flamegraphs with properly displayed function names for before.
I tried multiple old projects to see if there was any difference but they all show the unwanted characters.
The behavior also appears when using flamegraph on an example in my project (cargo flamegraph --example my_example --root --freq 50000):
grafik

I used perf on the example executable with sudo perf record -p 123 -F 500000 which resulted in the following output of perf report. The example was compiled with debug = true in profile.release.

grafik

I tracked the problem down to an issue with the installed perf version. After downgrading from perf-6.4.4-200.fc38 to perf-6.2.6-300.fc38, Rust symbols are demangled properly again. Sorry for the noise here.

No problem, glad you figured it out!

commented

I'm having the problem on Fedora as well. It appears the latest versions of perf do not demangle the names correctly?

Would be great if someone can look for/file a bug against Fedora and reference it here.

I did file an issue in the RedHat bugtracker as this is where the "File a new bug report" link on the fedora package site leads to.

@arctic-alpaca awesome, thanks!

On Fedora 39, the oldest available perf package is 6.5.4 (and the newest is 6.6.3), which still have the bug :( Will update if I find a workaround

@kangalio Building perf from source has worked for me. While I'm not sure how correct this is, these are the notes I found from when I built it:

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
cd linux
git checkout v6.6
make -C tools/perf  -s

PERF=./path_to_self_built_perf cargo flamegraph ...