Re: Add array type field for JFR Event

Denghui Dong denghui.ddh at alibaba-inc.com
Fri Nov 15 13:13:08 UTC 2019


Hi Erik,
  Thanks for your reply!
  I agree with you that we should avoid array types in normal cases.
  By the way, when I try to add array type support, I found a problem in implementation of WriterHost<BE, IE, WriterPolicyImpl>::ensure_size(size_t requested),
the method doesn't consider the length of the array (should use size_safety_cushion * length).
  Even if there is no array type field, it's still a problem, because string/char* is "array" too.
  What's your comment ?

Best Reards,
Denghui Dong
------------------------------------------------------------------
From:Erik Gahlin <erik.gahlin at oracle.com>
Send Time:2019年11月15日(星期五) 20:50
To:hotspot-jfr-dev <hotspot-jfr-dev at openjdk.java.net>
Subject:Re: Add array type field for JFR Event

Hi Denghui,

Previously, in the JRockit version of JFR we had support for arrays type 
fields in events.

For example, the SystemProperties event had a field with an array of 
UTFKeyValuePairs. However, they were problematic to consume for clients 
since you need to index into an array. It is easier if data comes in a 
normalized form, similar to a relational database where an event 
corresponds to a row in a table. JMC had to have special handling of 
these non-normalized events.

When we did the Hotspot port of JFR, we converted events such as 
SystemProperties into normalized versions and removed the support for 
array type fields in events. Unless there is a really good use case, I 
think we should try to avoid them.

Thanks
Erik

On 2019-11-15 11:25, Denghui Dong wrote:
> Hi team,
>    In the current implementation of JFR, it seems that we can't define array type field for JFR events.
>    I have made some changes in GenerateJfrFiles.java so that we can define array type field for native JFR events, it works now.
>    Do any others think it's useful?
>
> Thanks,
> Denghui Dong


More information about the hotspot-jfr-dev mailing list