com/oracle/jfr/gc/GCEventAll.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/com/oracle/jfr/gc/GCEventAll.java Thu May 2 15:03:54 2013
--- new/com/oracle/jfr/gc/GCEventAll.java Thu May 2 15:03:54 2013
*** 58,68 ****
--- 58,68 ----
* Duration for event "vm/gc/phases/pause" >= 1. Duration for phase level events >= 0.
*
*
*/
public class GCEventAll {
! private static Set<Long> gcIds = new HashSet<Long>();
! private static Set<Integer> gcIds = new HashSet<Integer>();
private static int systemGcCount = 0;
private boolean isIncompleteBatchRemoved = false;
private String youngCollector = null;
private String oldCollector = null;
*** 220,230 ****
--- 220,230 ----
*/
private List<FLREvent> filterIncompleteGcBatch(List<FLREvent> events) throws Throwable {
List<FLREvent> returnEvents = new ArrayList<FLREvent>();
returnEvents.addAll(events);
! long lastGcId = getLastGcId(events);
! int lastGcId = getLastGcId(events);
List<FLREvent> lastBatchEvents = getEventsWithGcId(events, lastGcId);
String[] endEvents = {GCHelper.event_garbage_collection, GCHelper.event_old_garbage_collection, GCHelper.event_young_garbage_collection};
boolean isComplete = containsAnyPath(lastBatchEvents, endEvents);
if (!isComplete) {
// The last GC batch does not contain an end event. The batch is incomplete.
*** 263,273 ****
--- 263,273 ----
* Get all events that has the specified gcId.
* @param events All events.
* @param gcId The specified gcId.
* @return A list of the events with the specified gcId.
*/
! private List<FLREvent> getEventsWithGcId(List<FLREvent> events, long gcId) {
! private List<FLREvent> getEventsWithGcId(List<FLREvent> events, int gcId) {
List<FLREvent> batchEvents = new ArrayList<FLREvent>();
for (FLREvent event : events) {
if (GCHelper.isGcEvent(event) && GCHelper.getGcId(event) == gcId) {
batchEvents.add(event);
}
*** 294,308 ****
--- 294,308 ----
/**
* Return the highest gcId in the list.
* @param events All events.
* @return the highest gcId found in the list or -1 if no event had a gcId.
*/
! private long getLastGcId(List<FLREvent> events) {
! long lastGcId = -1;
! private int getLastGcId(List<FLREvent> events) {
! int lastGcId = -1;
for (FLREvent event : events) {
if (GCHelper.isGcEvent(event)) {
! long gcId = GCHelper.getGcId(event);
! int gcId = GCHelper.getGcId(event);
if (gcId > lastGcId) {
lastGcId = gcId;
}
}
}
*** 398,410 ****
--- 398,410 ----
}
/**
* Verify that all gcId are unique.
*/
! private void verifyUniqueIds(List<GCHelper.GcBatch> batches, Set<Long> gcIds) {
! private void verifyUniqueIds(List<GCHelper.GcBatch> batches, Set<Integer> gcIds) {
for (GCHelper.GcBatch batch : batches) {
! Long gcId = new Long(batch.getGcId());
! Integer gcId = new Integer(batch.getGcId());
Asserts.assertFalse(gcIds.contains(gcId), "Duplicate gcId: " + gcId);
gcIds.add(gcId);
}
}
com/oracle/jfr/gc/GCEventAll.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File