Code Monkey home page Code Monkey logo

Comments (5)

king6cong avatar king6cong commented on July 30, 2024 2

on macOS,
sudo flamegraph rg will produce mangled names:
image

from inferno.

jasonrhansen avatar jasonrhansen commented on July 30, 2024 2

@king6cong This makes sense. The testing I did before was only for perf since inferno didn't yet support DTrace. Since you're on macOS, it's using DTrace. DTrace tries to demangle the names, but I believe it's demangling Rust names like C++. This sort of works, but not very well. After DTrace does its demangling, the result can't be demangled with the rustc demangler.

One way we could work around this is to pass the -xmangled option to dtrace so the names remain mangled. Then we could change the dtrace collapser to demangle the names. This would give much better results.

from inferno.

jasonrhansen avatar jasonrhansen commented on July 30, 2024

I added support for this in a branch using the symbolic_demangle crate. The problem is perf is already doing a great job demangling function names for me in all of the tests I've tried.

I used perf on some Rust programs to see if I could ever get function names that don't demangle correctly. The only way the names come out mangled is if I explicitly pass --no-demangle to perf script. I wonder why other people are getting different results.

Have you seen mangled Rust names from perf?

from inferno.

jasonrhansen avatar jasonrhansen commented on July 30, 2024

BTW, if I do pass --no-demangle to perf script, my branch's version of inferno-collapse-perf successfully demangles the function names. I could create some tests this way, but I'm wondering why perf's demangling isn't working for some people.

from inferno.

jonhoo avatar jonhoo commented on July 30, 2024

It could be that those people are using older versions of perf with broken or outdated demangling. Given your experiments, I'm inclined to just close this and leave perf to deal with it. If anyone having this problem could provide some more context, that'd be great!

from inferno.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.