[jdk17] RFR: 8268702: JFR diagnostic commands lack argument descriptors when viewed using Platform MBean Server

Markus Grönlund mgronlun at openjdk.java.net
Wed Jun 16 18:37:18 UTC 2021


On Wed, 16 Jun 2021 16:37:18 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:

>> Greetings,
>> 
>> this changeset restores the diagnostic command argument descriptors that got lost as part of [JDK-8265271](https://bugs.openjdk.java.net/browse/JDK-8265271) .
>> 
>> Testing: jdk_jfr, manual verification
>> 
>> Thanks
>> Markus
>
> src/hotspot/share/jfr/dcmd/jfrDcmds.cpp line 349:
> 
>> 347:   assert(arguments != NULL, "invariant");
>> 348:   assert(arguments->is_array(), "must be array");
>> 349:   GrowableArray<DCmdArgumentInfo*>* const array = new GrowableArray<DCmdArgumentInfo*>();
> 
> Maybe we could assert here, making sure num_arguments match the array length

Thanks Erik - yes, I tried to have just this assert as you mention. The problem is that it's tricky to call the right function, because the num_arguments() needs to be static, unfortunately, and here we are in the context of the superclass.  It would require passing a string describing what type it is, and then downcasting to that type to invoke the correct num_arguments. It got a bit messy so I decided against it.

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

PR: https://git.openjdk.java.net/jdk17/pull/57


More information about the hotspot-jfr-dev mailing list