RFR: 8357828: Add a timestamp to jcmd diagnostic commands
Ivan Bereziuk
duke at openjdk.org
Tue Oct 7 20:14:15 UTC 2025
On Wed, 24 Sep 2025 22:24:35 GMT, Larry Cable <duke at openjdk.org> wrote:
> My proposal would entail
> * adding a new standard option to jcmd
> * somehow funneling that option to the JVM
> * the option should be optional, so that:
> * old jcmd still works with new JVMs (and produces legacy jcmd output)
> * new jcmd still works with old JVMs (and produces legacy jcmd output)
> How complex would this be? There are two approaches to this. You
> can either create a new attach listener protocol (we already have
> ATTACH_API_V2 vs ATTACH_API_V1, so the precedence is there). Or,
> you can expand the jcmd parsing (see |jcmd(AttachOperation* op,
> attachStream* out)| in attachListener.cpp).
>
> ATTACH_API_V2 supports "options".
> Client (jcmd) detects options supported by the target VM ("getversion
> options" command) and can set option values in attach command request.
> Currently the only supported option is "streaming" (it allows turn off
> streaming output).
> The option is needed only for tests and needs to work for all attach
> tools (jcmd, jstack, etc.), so it can be set by specifying java
> property launching attach tool (like |jcmd
> -J-Djdk.attach.allowStreamingOutput=false PID command|)
Agreed. I will be working on the proposal. Thank you.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27368#issuecomment-3360367314
More information about the serviceability-dev
mailing list