RFR: 8185525: [Event Request] Add Tracing event for DictionarySizes

coleen.phillimore at oracle.com coleen.phillimore at oracle.com
Wed Apr 10 22:01:45 UTC 2019


http://cr.openjdk.java.net/~gziemski/8185525_rev5/src/hotspot/share/utilities/tableStatistics.cpp.html

Sorry I didn't notice this before but these constructors should have 
initializers like:

   31 TableRateStatistics::TableRateStatistics() {
   32   _added_items = 0;
   33   _removed_items = 0;
   34
   35   _time_stamp = 0;
   36   _seconds_stamp = 0.0;
   37   _added_items_stamp = 0;
   38   _added_items_stamp_prev = 0;
   39   _removed_items_stamp = 0;
   40   _removed_items_stamp_prev = 0;
   41 }

Should be:

   31 TableRateStatistics::TableRateStatistics() :
   32   _added_items(0), _removed_items(0), _time_stamp(0), etc. {}

Kim could tell you why this is better but he's on vacation.

http://cr.openjdk.java.net/~gziemski/8185525_rev5/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp.udiff.html

The template looks great!

Thanks,
Coleen

On 4/10/19 1:10 PM, gerard ziemski wrote:
> Thank you Coleen!
>
>
> On 4/9/19 10:57 AM, coleen.phillimore at oracle.com wrote:
>>>>
>>>> I didn't think this should be moved from jfrPeriodic.cpp.  I 
>>>> thought it could be something like an X macro.
>>>>
>>>> Or just make this bit a function that they all call with event as 
>>>> parameter.
>>>>
>>>> + event.set_numberOfBuckets(statistics._number_of_buckets);
>>>> + event.set_numberOfEntries(statistics._number_of_entries);
>>>> + event.set_totalFootprint(statistics._total_footprint);
>>>> + event.set_maximumBucketCount(statistics._maximum_bucket_size);
>>>> + event.set_averageBucketCount(statistics._average_bucket_size);
>>>> + event.set_varianceOfBucketCount(statistics._variance_of_bucket_size);
>>>> + event.set_stdDevOfBucketCount(statistics._stddev_of_bucket_size);
>>>> + event.set_insertionRate(statistics._add_rate);
>>>> + event.set_removalRate(statistics._remove_rate);
>>>> + event.commit();
>>>
>>> Each of those JFR events are an instance of a different class, so 
>>> the best I can do is a macro here (otherwise I'd have to create a 
>>> base class for the TableStatistics events from which to extend our 6 
>>> table events, but I'm not sure JFR architecture supports that - it 
>>> generates class automatically from the event's meta description)
>>>
>>> Updated webrev http://cr.openjdk.java.net/~gziemski/8185525_rev4/
>>
>> Yes, that looks better to me.
>>
>> + //statistics.print(tty, "SymbolTable");
>>
>> You should remove commented out code.   You can always add it back 
>> locally if you want to debug it again.  (I don't need to see this 
>> change).
>
> It was pointed out to me, that we can use templates instead of macro 
> here, so I tried it and I like it:
>
> http://cr.openjdk.java.net/~gziemski/8185525_rev5
>
>
> cheers
>



More information about the jmc-dev mailing list