GithubHelp home page GithubHelp logo

Comments (13)

apangin avatar apangin commented on July 26, 2024 2

@egor-ryashin Could you please open a separate issue?

from async-profiler.

apangin avatar apangin commented on July 26, 2024 1

You can dynamically inject agent library into the running JVM using HotSpot Attach API.
For instance, you can do this with my jattach utility:

jattach PID load /path/to/libasyncProfiler.so true start
jattach PID load /path/to/libasyncProfiler.so true stop

from async-profiler.

leventov avatar leventov commented on July 26, 2024

@apangin I've followed this and it just prints

Connected to remote JVM
Response Code = -1

from async-profiler.

apangin avatar apangin commented on July 26, 2024

This means the command was recognized, but the library could not be loaded.
Make sure you specify the absolute path to the library, and the file has proper permissions.

from async-profiler.

tartemov avatar tartemov commented on July 26, 2024

I'm trying to attach and dump summary info:
$ ./jattach $PID load /tmp/libasyncProfiler.so true start 1 10 Connected to remote JVM Response code = 0 0 $ ./jattach $PID load /tmp/libasyncProfiler.so true dumpRawTraces Connected to remote JVM Response code = 0 0 $ ./jattach $PID load /tmp/libasyncProfiler.so true stop Connected to remote JVM Response code = 0 0 $ ./jattach $PID load /tmp/libasyncProfiler.so true dumpRawTraces Connected to remote JVM Response code = 0 0
but I can't get any methods info. What am I doing wrong?

from async-profiler.

apangin avatar apangin commented on July 26, 2024

Note that profiling stats are printed on stdout of Java process (not on the console of jattach).

from async-profiler.

apangin avatar apangin commented on July 26, 2024

Alternatively you may dump raw traces to the specified file:

./jattach $PID load /tmp/libasyncProfiler.so true dumpRawTraces:/path/to/profile.txt

from async-profiler.

tartemov avatar tartemov commented on July 26, 2024

Thanks. With dumpRawTraces method it's working fine. But with other methods - summary, dumpMethods and others it doesn't work - no file created.

from async-profiler.

tartemov avatar tartemov commented on July 26, 2024

Hi again! Could you please get any advice how to get summary/dumpMethods info in file?

from async-profiler.

apangin avatar apangin commented on July 26, 2024

This is not supported right now, but will get fixed soon.

from async-profiler.

balmaster avatar balmaster commented on July 26, 2024

@tartemov you can use Brendan Gregg scripts to fold stacks and make svg

  1. clone https://github.com/brendangregg/FlameGraph

  2. FlameGraph/stackcollapse-ljp.awk mytrace.txt > mytrace.folded

  3. FlameGraph/flamegraph.pl mytrace.folded > mytrace.svg

from async-profiler.

apangin avatar apangin commented on July 26, 2024

Resolved by #13

from async-profiler.

egor-ryashin avatar egor-ryashin commented on July 26, 2024

I cannot attach to some JVM processes.
I made profiler.sh output more info:

    collect)
        $JATTACH $PID load $PROFILER true start,file=$FILE$INTERVAL$FRAMEBUF #> /dev/null
        if [ $? -ne 0 ]; then
            exit 1
        fi

Got this:

~/async-profiler $ sudo -u xncore ./profiler.sh -d 10 3515
Connected to remote JVM
Response code = -1

Is there a way to debug it further?

from async-profiler.

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.