GithubHelp home page GithubHelp logo

bitisony / perf-map-agent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jvm-profiling-tools/perf-map-agent

0.0 2.0 0.0 256 KB

A java agent to generate method mappings to use with the linux `perf` tool

License: GNU General Public License v2.0

Java 13.48% CMake 5.90% Shell 2.75% C 77.86%

perf-map-agent's Introduction

A java agent to generate /tmp/perf-<pid>.map files for JITted methods for use with perf.

Build

cmake .
make

Use

Use ./perf-java <pid> <options> to create a perf-<pid>.map file for the current state of the JVM and run perf top -p <pid> for this process afterwards. perf-java expects libperfmap.so in the current directory.

Over time the JVM will JIT compile more methods and the perf-<pid>.map file will become stale. You need to rerun perf-java to generate a new and current map.

Note: If perf top still doesn't show any detailled info it's probably because of a permission problem. A common solution is to run the java program as a regular user with the agent enabled and then run a chown root /tmp/perf-<pid>.map to make the file accessible for the root user. Then run perf top as root. The perf-java script tries to do that.

Options

You can add a comma separated list of options to perf-java (or the AttachOnce runner). These options are currently supported:

  • unfold: create extra entries for every codeblock inside a method that was inlined from elsewhere (named <inlined_method> in <root_method>)
  • msig: include full method signature in the name string
  • dottedclass: convert class signature (Ljava/lang/Class;) to the usual class names with segments separated by dots (java.lang.Class). NOTE: this currently breaks coloring when used in combination with flamegraphs.

Disclaimer

I'm not a professional C code writer. The code is very "experimental", and it is e.g. missing checks for error conditions etc.. Use it at your own risk. You have been warned!

License

This library is licensed under GPLv2. See the LICENSE file.

perf-map-agent's People

Contributors

jrudolph avatar brendangregg avatar davidcl avatar philipa avatar

Watchers

James Cloos avatar  avatar

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.