com/oracle/jfr/gc/GCHelper.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
closed Cdiff com/oracle/jfr/gc/GCHelper.java
com/oracle/jfr/gc/GCHelper.java
Print this page
rev 1475 : 8010090: GC ID has the wrong type
Summary: GC ID changed from ulong to uint
Reviewed-by: mattias.tobiasson@oracle.com
*** 49,60 ****
public static final String gcPSMarkSweep = "PSMarkSweep";
public static final String gcParallelOld = "ParallelOld";
private static PrintStream defaultErrorLog = null;
! public static long getGcId(FLREvent event) {
! return ((Long) event.getValue("gcId")).longValue();
}
/**
* Check if this is a GC event. We count it as a GC event if it has the value "gcId".
*/
--- 49,60 ----
public static final String gcPSMarkSweep = "PSMarkSweep";
public static final String gcParallelOld = "ParallelOld";
private static PrintStream defaultErrorLog = null;
! public static int getGcId(FLREvent event) {
! return ((Integer) event.getValue("gcId")).intValue();
}
/**
* Check if this is a GC event. We count it as a GC event if it has the value "gcId".
*/
*** 132,142 ****
* Contains all GC events belonging to the same GC (same gcId).
*/
public static class GcBatch {
private List<FLREvent> events = new ArrayList<FLREvent>();
! public long getGcId() {
if (events.isEmpty()) {
return -1;
}
return GCHelper.getGcId(events.get(0));
}
--- 132,142 ----
* Contains all GC events belonging to the same GC (same gcId).
*/
public static class GcBatch {
private List<FLREvent> events = new ArrayList<FLREvent>();
! public int getGcId() {
if (events.isEmpty()) {
return -1;
}
return GCHelper.getGcId(events.get(0));
}
*** 232,250 ****
/**
* Parse all events and group them into batches
*/
public static List<GcBatch> createFromEvents(List<FLREvent> events) throws Exception {
! Stack<Long> openGcIds = new Stack<Long>();
List<GcBatch> batches = new ArrayList<GcBatch>();
GcBatch currBatch = null;
for (FLREvent event : events) {
if (!isGcEvent(event)) {
continue;
}
! long gcId = GCHelper.getGcId(event);
if (currBatch == null || currBatch.getGcId() != gcId) {
currBatch = null;
// Search for existing batch
for (GcBatch loopBatch : batches) {
if (gcId == loopBatch.getGcId()) {
--- 232,250 ----
/**
* Parse all events and group them into batches
*/
public static List<GcBatch> createFromEvents(List<FLREvent> events) throws Exception {
! Stack<Integer> openGcIds = new Stack<Integer>();
List<GcBatch> batches = new ArrayList<GcBatch>();
GcBatch currBatch = null;
for (FLREvent event : events) {
if (!isGcEvent(event)) {
continue;
}
! int gcId = GCHelper.getGcId(event);
if (currBatch == null || currBatch.getGcId() != gcId) {
currBatch = null;
// Search for existing batch
for (GcBatch loopBatch : batches) {
if (gcId == loopBatch.getGcId()) {
*** 254,264 ****
}
if (currBatch == null) {
// No existing batch. Create new.
currBatch = new GcBatch();
batches.add(currBatch);
! openGcIds.push(new Long(gcId));
}
}
boolean isEndEvent = currBatch.addEvent(event);
if (isEndEvent) {
openGcIds.pop();
--- 254,264 ----
}
if (currBatch == null) {
// No existing batch. Create new.
currBatch = new GcBatch();
batches.add(currBatch);
! openGcIds.push(new Integer(gcId));
}
}
boolean isEndEvent = currBatch.addEvent(event);
if (isEndEvent) {
openGcIds.pop();
com/oracle/jfr/gc/GCHelper.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File