jvm-profiling-tools / perf-map-agent

A java agent to generate method mappings to use with the linux `perf` tool
GNU General Public License v2.0
1.65k stars 260 forks source link

Provide disassemblage for JIT methods #29

Open jrudolph opened 8 years ago

jrudolph commented 8 years ago

The code needs more cleanup and stability before I will merge it.

The code is also very non-portable. I know it works for at least one of the JVMs I have installed but as this code contains some evil hacks like trying to guess C++ class memory layout to construct C++ classes from C code, it will probably break badly in sufficiently different environments. If someone has better ideas how to figure out the memory layout (maybe by accessing debug symbols?), please advice.

You need to put hsdis-<arch>.so to one of the places where hotspot expects it.

Also, we need to support calling out to proper objdump for non-JITted DSOs.

Another improvement would be to use a named pipe or a socket instead of this brittle write file / read file setup to transfer data from the target process to the agent loader.

Will fix #7 when ready.