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.64k stars 260 forks source link

JDK inline info not accurate in all cases #81

Closed jrudolph closed 5 years ago

jrudolph commented 5 years ago

For some methods there can be some chunks of code for which proper inline information seems to be missing (compared to PrintAssembly output).

I don't think there can be done anything about that realistically inside of perf-map-agent but if we find some clues why that would be the case it could be reported to openjdk (maybe it is but I couldn't find it).

For reference, here are the code locations where this info is gathered:

Through the agent/JVMTI interface:

https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/19fb8f93c59dfd791f62d41f332db9e306bc1422/src/hotspot/share/prims/jvmtiExport.cpp#L2093

In contrast, for PrintAssembly:

From here:

https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/3e78ed84f13da94b98f6365935b2192cf0ac2ee0/src/hotspot/share/compiler/disassembler.cpp#L359

to finally:

https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/3e78ed84f13da94b98f6365935b2192cf0ac2ee0/src/hotspot/share/code/nmethod.cpp#L2652

From my quick investigation, the issue might be the way that scopes_pcs_begin reports interesting (= scoped) code regions, in contrast to what scopes are reported if you consider every single PC of an nmethod.

jrudolph commented 5 years ago

I refiled my #25. Every other year, I guess...