On Tue, 5 Mar 2024 11:31:13 GMT, Kevin Walls <kev...@openjdk.org> wrote:

>> Introduce the jcmd "VM.debug" to implement access to a useful set of the 
>> established debug.cpp utilities, with "jcmd PID VM.debug subcommand ...".
>> 
>> Not recommended for live production use.  Calling these "debug" utilities, 
>> and not including them in the jcmd help output, is to remind us they are not 
>> general customer-facing tools.
>
> Kevin Walls has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Test update

Having worked with this for a while, I'm quite liking simply adding jcmds, and 
not adding a group of commands as I initially proposed.

The VM.debug group had a story to it, as I mentioned, but maybe that's just 
history.  A  user just wants to use jcmd, and if VM.inspect is the command to 
inspect a JVM object, then OK.   The history in debug.cpp may not be that 
interesting.  

The command group does make it easy to restrict the commands with 
UnlockDiagnosticVMOptions, for example, so that was a benefit, but minor as 
it's just a flag check.  Another difference with the command group was you have 
to read the first argument and direct to the right utility, so you're doing 
some minor parsing rather than relying on the DiagnosticCommand parser, which 
is a minor downside.  Ease of adding commands is generally similar either way.

VM.inspect is the primary utility I want to add here.  I plan to rework this do 
to that. Others can be added in separate jcmds as needs arise.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17655#issuecomment-2015039530

Reply via email to