-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GR-56601] Initial support for jcmd. #9963
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this PR @christianhaeubl! This looks really good to me.
|
||
@Override | ||
public List<Class<? extends Feature>> getRequiredFeatures() { | ||
return List.of(SigQuitFeature.class, AttachApiFeature.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the DCmdFeature
also be included in this list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, it is indeed cleaner if DCmdFeature
is included here as well.
return String.join(System.lineSeparator(), lines); | ||
} | ||
|
||
private static String[] getHelp(Target_jdk_jfr_internal_dcmd_AbstractDCmd cmd) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JFR.start DCMD from the JDK shows extended JFR configuration options (that aren't supported) as part of it's help text. It's not a big problem since you return a descriptive error message Warning! The .jfc option/setting 'xyz' doesn't exist or is not supported.
The other option would be to print custom help text, copy-pasting the parts we support in Native Image. However, maybe that's not really worth the duplication and maintenance of keeping it up to date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, there is a bit too much output. Most extended configuration options are already hidden due to the substitution of Target_jdk_jfr_internal_dcmd_DCmdStart.jfcOptions()
. I don't think that it is worth to duplicate the help text, so I think we will just live with the extra output for now.
a3dde59
to
d397bf3
Compare
d397bf3
to
10528ff
Compare
10528ff
to
25ae2cd
Compare
2545793
to
ea1ce56
Compare
This PR is based on #9232 (there is not much code left from the original PR though) and contains the following changes:
JCmdFeature
).jcmd
support builds on top of the attach API (seePosixAttachApiSupport
and the files incom.oracle.svm.core.attach
andcom.oracle.svm.core.posix.attach
)SIGQUIT
/SIGBREAK
and domain sockets for communicationcom.oracle.svm.core.jvmstat.SystemCounters
).jcmd
can access the performance counters to detect which process are running.SIGQUIT
/SIGBREAK
. This PR extends the existing feature and renames it fromDumpRuntimeCompilationOnSignalFeature
toSigQuitFeature
.com.oracle.svm.core.dcmd.*
) that can be triggered viajcmd
-XX:StartFlightRecording
andjcmd <pid> JFR.start
use the same code and have the same behavior.JVMSupport.makeFilename
and the JFR startup.jcmd <pid> GC.heap_dump dump.hprof
.