GithubHelp home page GithubHelp logo

Comments (7)

jrudolph avatar jrudolph commented on July 20, 2024

There are two possible explanations:

  1. Hotspot is indeed sometimes moving stuff around, so numbers may get inaccurate after a while because the map file is appended to during a run, restarting perf top should pickup the current data

  2. Currently the map file contains only "top-level" methods into which a lot of smaller methods may have been inlined. This means that an entry for a method in the profile may in fact serve as a kind of container for everything that was inlined into the method as well. I've got a local version of the agent that emits more accurate map-files which also specifies for every part of a method which method was inlined at this PC.

from perf-map-agent.

phraktle avatar phraktle commented on July 20, 2024

Thanks – I believe it was 1) in this case. I actually kinda like 2) as it is: perf top shows items with a reasonably large granularity :)

from perf-map-agent.

phraktle avatar phraktle commented on July 20, 2024

I'm still seeing some strange artifacts in perf top (started fresh) that don't fit my mental model of the application and do not correlate with what JMC reports as hotspots. Not sure how to go further with this observation, as various profilers seem to have very different sampling biases. My understanding was that traditional java profilers (e.g. YourKit, JProfiler, etc) can only sample at safepoints, which makes them very inaccurate (our application has low enough latency for this bias to be obviously wrong). JMC seems to be doing a much better job, and I expected perf to be quite close.

from perf-map-agent.

jrudolph avatar jrudolph commented on July 20, 2024

You should be able to track (re)compilations with the -XX:+LogCompilation flag. This may offer some advice if address ranges were used several times. Another (hardcore) way of checking results would be to use -XX:+PrintAssembly and log the assembly into a file. Then go through some of the entries which perf report reports in its more verbose output modes and check the actual addresses against the disassembly if it makes more sense. Also, I've read that the addresses reported by the performance counters are not completely accurate so there could be a slight skew that may associate a sample with the wrong method (IMO only relevant for very small methods).

from perf-map-agent.

brendangregg avatar brendangregg commented on July 20, 2024

I debugged these and found that the dynamic ordering of the map file confused perf_events. If I took the map file and cleaned it up (removed stale entries, sorted), then perf_events would show correct symbols. My program to do this is https://github.com/brendangregg/Misc/blob/master/perf_events/perfmaptidy.pl, however, Johannes just updated perf-map-agent to dump the map file on-demand, which hopefully clears the issue (and my perfmaptidy.pl program should not be needed).

from perf-map-agent.

jrudolph avatar jrudolph commented on July 20, 2024

Is there a way to check this (or documentation on the expected format of the perm-<pid>.map file? As we are now generating the whole file in one go, we could also sort entries by address if that's required.

from perf-map-agent.

jrudolph avatar jrudolph commented on July 20, 2024

As @brendangregg noted above this should be fixed by now.

from perf-map-agent.

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.