Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf regression: Symbols/function names not demangled #280

Closed
arctic-alpaca opened this issue Aug 21, 2023 · 11 comments
Closed

perf regression: Symbols/function names not demangled #280

arctic-alpaca opened this issue Aug 21, 2023 · 11 comments

Comments

@arctic-alpaca
Copy link

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)

@djc
Copy link
Contributor

djc commented Aug 21, 2023

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

@arctic-alpaca
Copy link
Author

arctic-alpaca commented Aug 21, 2023

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

@arctic-alpaca
Copy link
Author

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.

@djc
Copy link
Contributor

djc commented Aug 21, 2023

No problem, glad you figured it out!

@DevJac
Copy link

DevJac commented Aug 22, 2023

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

@djc
Copy link
Contributor

djc commented Aug 25, 2023

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

@arctic-alpaca
Copy link
Author

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 arctic-alpaca changed the title Function names encapsulated by other characters perf regression: Symbols/function names not demangled Aug 25, 2023
@djc
Copy link
Contributor

djc commented Aug 25, 2023

@arctic-alpaca awesome, thanks!

@kangalio
Copy link

kangalio commented Dec 5, 2023

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

@arctic-alpaca
Copy link
Author

@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 ...

@Omar-Elrefaei
Copy link

Omar-Elrefaei commented Mar 25, 2024

To install required dependencies to build perf with most optional features enabled:
dnf install elfutils-devel libdwarf libdwarf-devel libcap-devel elfutils-libelf-devel numactl-libs libunwind-devel lzma-sdk-devel libaio-devel libtraceevent-devel libfm-devel slang-devel systemtap-sdt-devel perl-devel binutils-devel libbabeltrace-devel

then you can run dnf mark remove {package_names}... in order to label them as "autoinstalled" if you want them to be removed later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants