8157459: G1 IHOP JFR event attribute with incorrect content type
Summary: Use PERCENTAGE instead of BYTES64 data type for the affected attributes.
Reviewed-by: ehelin, sangheki
--- a/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp Tue Jul 19 10:31:41 2016 +0200
+++ b/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp Tue Jul 19 09:30:30 2016 +0200
@@ -278,7 +278,7 @@
evt.set_gcId(GCId::current());
evt.set_threshold(threshold);
evt.set_targetOccupancy(target_occupancy);
- evt.set_thresholdPercentage(target_occupancy > 0 ? (threshold * 100 / target_occupancy) : 0);
+ evt.set_thresholdPercentage(target_occupancy > 0 ? ((double)threshold / target_occupancy) : 0.0);
evt.set_currentOccupancy(current_occupancy);
evt.set_lastAllocationSize(last_allocation_size);
evt.set_lastAllocationDuration(last_allocation_duration);
@@ -299,7 +299,7 @@
if (evt.should_commit()) {
evt.set_gcId(GCId::current());
evt.set_threshold(threshold);
- evt.set_thresholdPercentage(internal_target_occupancy > 0 ? (threshold * 100 / internal_target_occupancy) : 0);
+ evt.set_thresholdPercentage(internal_target_occupancy > 0 ? ((double)threshold / internal_target_occupancy) : 0.0);
evt.set_internalTargetOccupancy(internal_target_occupancy);
evt.set_currentOccupancy(current_occupancy);
evt.set_additionalBufferSize(additional_buffer_size);
--- a/hotspot/src/share/vm/trace/traceevents.xml Tue Jul 19 10:31:41 2016 +0200
+++ b/hotspot/src/share/vm/trace/traceevents.xml Tue Jul 19 09:30:30 2016 +0200
@@ -374,7 +374,7 @@
description="Basic statistics related to current IHOP calculation">
<value type="UINT" field="gcId" label="GC ID" relation="GC_ID"/>
<value type="BYTES64" field="threshold" label="Current IHOP threshold" description="Current IHOP threshold in bytes"/>
- <value type="BYTES64" field="thresholdPercentage" label="Current IHOP threshold in percent" description="Current IHOP threshold in percent of old gen"/>
+ <value type="PERCENTAGE" field="thresholdPercentage" label="Current IHOP threshold in percent" description="Current IHOP threshold in percent of old gen"/>
<value type="BYTES64" field="targetOccupancy" label="Target occupancy" description="Target old gen occupancy to reach at the start of mixed GC in bytes"/>
<value type="BYTES64" field="currentOccupancy" label="Current occupancy" description="Current old gen occupancy in bytes"/>
<value type="BYTES64" field="lastAllocationSize" label="Last mutator allocation size" description="Mutator allocation during mutator operation since last GC in bytes"/>
@@ -387,7 +387,7 @@
description="Statistics related to current adaptive IHOP calculation">
<value type="UINT" field="gcId" label="GC ID" relation="GC_ID"/>
<value type="BYTES64" field="threshold" label="Current IHOP threshold" description="Current IHOP threshold in bytes"/>
- <value type="BYTES64" field="thresholdPercentage" label="Current IHOP threshold in percent" description="Current IHOP threshold in percent of the internal target occupancy"/>
+ <value type="PERCENTAGE" field="thresholdPercentage" label="Current IHOP threshold in percent" description="Current IHOP threshold in percent of the internal target occupancy"/>
<value type="BYTES64" field="internalTargetOccupancy" label="Target occupancy" description="Internal target old gen occupancy to reach at the start of mixed GC in bytes"/>
<value type="BYTES64" field="currentOccupancy" label="Current occupancy" description="Current old gen occupancy in bytes"/>
<value type="BYTES64" field="additionalBufferSize" label="Additional buffer size" description="Additional buffer size in bytes"/>