Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Khouzam2012-07-13 14:55:17 -0400
committerAlexandre Montplaisir2012-07-13 16:28:25 -0400
commit1d826dbfd9c6c5f7f20bc227d596e633d84e183b (patch)
treeb0cefab3c9e585af34d7ff098c6a22816e5ca8ec
parent91746de3f9f4330dfa59268c390d496f6ef59bb7 (diff)
downloadorg.eclipse.linuxtools-1d826dbfd9c6c5f7f20bc227d596e633d84e183b.tar.gz
org.eclipse.linuxtools-1d826dbfd9c6c5f7f20bc227d596e633d84e183b.tar.xz
org.eclipse.linuxtools-1d826dbfd9c6c5f7f20bc227d596e633d84e183b.zip
Fix lost events to work after multiple reloads
Change-Id: If086a2c99d6276b8b4b19b55124526f3ee468f70 Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/StreamInputPacketReader.java13
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/StreamInputPacketIndexEntry.java18
2 files changed, 27 insertions, 4 deletions
diff --git a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/StreamInputPacketReader.java b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/StreamInputPacketReader.java
index 4c3c3447dd..015e2543d9 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/StreamInputPacketReader.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/StreamInputPacketReader.java
@@ -32,7 +32,7 @@ import org.eclipse.linuxtools.internal.ctf.core.trace.StreamInputPacketIndexEntr
/**
* CTF trace packet reader. Reads the events of a packet of a trace file.
- *
+ *
* @version 1.0
* @author Matthew Khouzam
* @author Simon Marchi
@@ -103,6 +103,8 @@ public class StreamInputPacketReader implements IDefinitionScope {
private int lostSoFar;
+ private int lostEventsInThisPacket;
+
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
@@ -304,10 +306,13 @@ public class StreamInputPacketReader implements IDefinitionScope {
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;
}
-
}
/*
@@ -348,7 +353,7 @@ public class StreamInputPacketReader implements IDefinitionScope {
Long eventID = null;
long timestamp = 0;
- if (lostEvents > lostSoFar) {
+ if (lostEventsInThisPacket > lostSoFar) {
EventDefinition eventDef = EventDeclaration
.getLostEventDeclaration().createDefinition(
streamInputReader);
diff --git a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/StreamInputPacketIndexEntry.java b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/StreamInputPacketIndexEntry.java
index aa1baf2ac1..e6f602bdc3 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/StreamInputPacketIndexEntry.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/StreamInputPacketIndexEntry.java
@@ -54,6 +54,11 @@ public class StreamInputPacketIndexEntry {
*/
private long timestampEnd = 0;
+ /**
+ * How many lost events are there?
+ */
+ private long lostEvents = 0;
+
// ------------------------------------------------------------------------
// Constructors
// ------------------------------------------------------------------------
@@ -183,4 +188,17 @@ public class StreamInputPacketIndexEntry {
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;
+ }
}

Back to the top