RFR: 8224479: New diagnostic command: VM.get_flag

Thomas Stüfe thomas.stuefe at gmail.com
Tue May 21 10:37:40 UTC 2019


I think this is useful. I have a vague preference for reusing VM.flags
though - giving it the option to only print one flag - instead of adding a
new command.

Just my 5c

.. Thomas

On Tue, May 21, 2019, 12:14 Stefan Karlsson <stefan.karlsson at oracle.com>
wrote:

> Hi all,
>
> Please review this patch to introduce a new diagnostic command:
> VM.get_flag.
>
> http://cr.openjdk.java.net/~stefank/8224479/webrev.01/
> https://bugs.openjdk.java.net/browse/JDK-8224479
>
> Today we have:
>
> - VM.set_flag - which allows the user to set a manageable flag
> - VM.flags - which allows the user to print all set flags or print
> similar output as -XX:+PrintFlagsFinal
>
> I propose that we add a new command to print the value of one flag.
>
> Output from help:
> ==========
> $ jcmd HelloSleep help VM.get_flag
> 1060:
> VM.get_flag
> Prints the value of a VM flag option.
>
> Impact: Low
>
> Permission: java.lang.management.ManagementPermission(monitor)
>
> Syntax : VM.get_flag  <flag name>
>
> Arguments:
>         flag name :  The name of the flag we want to get (STRING, no
> default value)
> ==========
>
> Output from usage:
> ==========
> $ jcmd HelloSleep VM.get_flag UseSerialGC
> 1060:
> false
> ==========
>
> I'll create a CSR if others also thinks this is a worthwhile feature.
>
> Thanks,
> StefanK
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20190521/f44e3acb/attachment.html>


More information about the serviceability-dev mailing list