/**
* CTF trace packet reader. Reads the events of a packet of a trace file.
- *
+ *
* @version 1.0
* @author Matthew Khouzam
* @author Simon Marchi
private int lostSoFar;
+ private int lostEventsInThisPacket;
+
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
Definition lostEventsdef = getStreamPacketContextDef()
.lookupDefinition("events_discarded"); //$NON-NLS-1$
if (cpuiddef instanceof IntegerDefinition) {
- lostEvents = (int) ((IntegerDefinition) lostEventsdef)
+ int totalLostEvents = (int) ((IntegerDefinition) lostEventsdef)
.getValue();
+ lostEventsInThisPacket = totalLostEvents - lostEvents;
+ lostEvents = totalLostEvents;
+ currentPacket.setLostEvents(lostEventsInThisPacket);
+ lostSoFar = 0;
}
-
}
/*
Long eventID = null;
long timestamp = 0;
- if (lostEvents > lostSoFar) {
+ if (lostEventsInThisPacket > lostSoFar) {
EventDefinition eventDef = EventDeclaration
.getLostEventDeclaration().createDefinition(
streamInputReader);
*/
private long timestampEnd = 0;
+ /**
+ * How many lost events are there?
+ */
+ private long lostEvents = 0;
+
// ------------------------------------------------------------------------
// Constructors
// ------------------------------------------------------------------------
this.timestampEnd = timestampEnd;
}
+ /**
+ * @return the lostEvents
+ */
+ public long getLostEvents() {
+ return lostEvents;
+ }
+
+ /**
+ * @param lostEvents the lostEvents to set
+ */
+ public void setLostEvents(long lostEvents) {
+ this.lostEvents = lostEvents;
+ }
}