Async-profiler: per-thread reverse call tree

Created on 30 May 2020  路  7Comments  路  Source: jvm-profiling-tools/async-profiler

Is there a way to do an HTML per-thread reverse call tree ?

The only way I found to do it is via jdr // JMC.

Anyway thanks, this tool is a lifesave since I understood the safepoints issue in most profilers.

Edit to explain : I'm profiling a complex application doing network I/O. I need :

  • -e wall to see the I/O time in the graphs
  • --reverse because there is a LOT of different call trees so i'm more interested in the cpu-consuming leafs
  • per-thread view because there are many other idle threads that I don't care about

Currently with "-e wall -t --reverse", the part of code I'm interested in is "squashed" by (and mixed within) all other idle threads (executors, server sockets).

enhancement

Most helpful comment

@egwepas have a look at https://www.speedscope.app/ for viewing the collapsed stacks format(with threads). In addition, current IDEA supports loading collapsed stacks as profiles to be navigated in their profiler flame graph view. Either one (or JMC/VisualVM) makes a good place for feature requests and contibutions.

All 7 comments

Per-thread reverse trees / flamegraphs indeed worked counterintuitively.
I've fixed that.

Thanks a lot, I'll use it as soon as a build will be released.

On a side note : do you think it would be interesting for you to have a lightweigth swing viewer with thread selection, hotspots, forward and backward call tree, that would use the collapsed format as a source ?

I'm thinking about trying myself at it.

BTW, you may use -I/-X options to filter out irrelevant threads.
Also, in wall clock mode, you may specify --filter <thread IDs> to profile only selected threads.

do you think it would be interesting for you to have a lightweigth swing viewer with thread selection, hotspots, forward and backward call tree, that would use the collapsed format as a source ?

Isn't JMC good enough? It can open .jfr profiles produced by async-profiler, too.

Alternatively, it's relatively easy to write a tool to convert collapsed format to the format supported by NetBeans/VisualVM, which already have the above features. I find their viewer pretty handy.

Thanks for the type.

About the viewer ... You're probably right, yeah. I also agree with you about VisualVM's viewer, I find it more user-friendly than JMC.

Althought I'm not sure it will be able to properly display your memory profiling (I didn't test it), theirs only display a snapshot of the heap. No hierarchy.

@egwepas have a look at https://www.speedscope.app/ for viewing the collapsed stacks format(with threads). In addition, current IDEA supports loading collapsed stacks as profiles to be navigated in their profiler flame graph view. Either one (or JMC/VisualVM) makes a good place for feature requests and contibutions.

FYI, I made a simple converter to transform .collapsed format to .nps profile snapshots supported by NetBeans and VisualVM: https://gist.github.com/apangin/0f2ec45af901a05cbb3862106a957ebf

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nobeh picture nobeh  路  5Comments

franz1981 picture franz1981  路  4Comments

qqibrow picture qqibrow  路  5Comments

ceeaspb picture ceeaspb  路  5Comments

apangin picture apangin  路  5Comments