Giter Site home page Giter Site logo

[unknown] functions about flamegraph HOT 6 CLOSED

brendangregg avatar brendangregg commented on May 27, 2024
[unknown] functions

from flamegraph.

Comments (6)

do11 avatar do11 commented on May 27, 2024

Btw, do you have any tips how to resolve these [unknown] ([unknown]) references?

from flamegraph.

brendangregg avatar brendangregg commented on May 27, 2024

Yes, maybe we should change stackcollapse-perf.pl as you suggest.

As for seeing [unknown] references: you've got to fix the profiler, whatever it is. In this case, Linux perf_events. Just as one example as a guideline:

On Java, I run the java process with -XX:+PreserveFramePointer (which costs a small amount of overhead), so that at least perf can walk stacks sensibly. At that point you still get [unknown], but at least the address aren't total garbage (which they can be if the app steps on the frame pointer). Then I run a java agent, perf-map-agent, (immediately after the profile), which dumps a /tmp/perf-PID.map file for perf to do symbol translations.

How this works for other apps is up to the app, but may be similar. You need a way for stack traces to work (eg, frame pointer-based, or DWARF-based), and, a way for perf to do symbol translations (some thing that writes the /tmp/perf-PID.map file).

from flamegraph.

do11 avatar do11 commented on May 27, 2024

Thanks!

from flamegraph.

liliang1213 avatar liliang1213 commented on May 27, 2024

Hi,I've used '--perf-basic-prof' option when I profile nodejs,and I also get a file named '/tmp/perf-PID.map' under /tmp directory, but when I generate flame graph using 'perf script | ./stackcollapse-perf.pl | ./flamegraph.pl > MAIN.svg', it remains many 'unknown' label in my graph, how could that be?

perf script command returns like this:
image

from flamegraph.

do11 avatar do11 commented on May 27, 2024

As I understood it, it could be just garbage values on the stack. Garbage in a sense that there is not valid frame pointers (probably optimized stack logic, for example, code compiled with -fomit-frame pointer).

from flamegraph.

brendangregg avatar brendangregg commented on May 27, 2024

I'm going to close this ticket because it's not a problem with Flame Graphs, which visualize the profiler output. If the profiler is emitting "[unknown]", then fix the profiler. It's system software, so ask your OS vendor.

I'd check if perf was complaining about file permissions, and fix that. Another issue has been buffering in v8, which was fixed recently -- look it up in v8 bug tracking, I don't have the URL on hand. I don't know when that fix will arrive in node, if it isn't there already. There are other issues that can cause "[unknown]" too, especially in JIT runtimes.

from flamegraph.

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.