Closed robertvazan closed 6 months ago
Hmm, this is a tricky one. It sounds like OpenJDK is shelling out to it if it exists, but it isn't actually an official part of the OpenJDK project itself. Have I understood that correctly? :thinking:
(If so, this isn't likely something we'd include by default, especially without a simple and reliable means of installing it short of compiling it ourselves from source :grimacing:)
I don't know what's your policy on including optional components, but hsdis is in OpenJDK sources, so I guess it's official in a sense. JVM has a soft dependency on it, perhaps because building it adds third party dependencies (binutils), but that should not be an issue in a linux image. Anyways, hsdis is useful when diagnosing perf problems and when checking JMH benchmarks. Not sure whether that's a use case you wish to support.
Looking at this again, and it appears hsdis
lives in https://github.com/openjdk/jdk/tree/a7dde578a8c18ae7f38fe2061773eba6f8086aa4/src/utils/hsdis, which is as you say part of the OpenJDK source tree. It's interesting that the pre-compiled binaries we download from Oracle (https://jdk.java.net/) do not contain this binary but are configured to use it if it exists.
I guess the biggest complication here is downloading and building that source code (which we don't otherwise have in the image).
This is a use case that might be interesting to support, but I don't feel comfortable with us maintaining much code to do so. Hopefully sometime in the future Oracle will include a precompiled copy of this in their published builds. :bow: :heart:
It would make my life easier if the images included hsdis. Without it
-XX:+PrintAssembly
just prints binary code instead of assembly instructions.