Add events structures, indexes and event caches per trace
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 6 Jun 2012 19:35:37 +0000 (15:35 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 6 Jun 2012 21:03:56 +0000 (17:03 -0400)
instead of per context.
MAJOR performance and stability improvement.

Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
16 files changed:
org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderComparatorTest.java
org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputReaderTimestampComparatorTest.java
org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamInputTest.java
org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/StreamTest.java
org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/EventDeclarationTest.java
org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java
org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTraceReader.java
org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/StreamInputPacketReader.java
org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/Stream.java
org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/StreamInput.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/AllTmfCoreTests.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfEventTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfTraceTest.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIterator.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfLightweightContext.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java

index 08896a93ea84b3bc706559c142f3a9c0e057ed3a..7d1222525d228f9799ac730a9ad105ffda01966d 100644 (file)
@@ -1,17 +1,7 @@
 package org.eclipse.linuxtools.ctf.core.tests.trace;
 
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-import java.nio.channels.FileChannel;
-
-import org.eclipse.linuxtools.ctf.core.event.EventDeclaration;
-import org.eclipse.linuxtools.ctf.core.event.EventDefinition;
-import org.eclipse.linuxtools.ctf.core.tests.TestParams;
-import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
-import org.eclipse.linuxtools.ctf.core.trace.StreamInputReader;
-import org.eclipse.linuxtools.internal.ctf.core.trace.Stream;
-import org.eclipse.linuxtools.internal.ctf.core.trace.StreamInput;
 import org.eclipse.linuxtools.internal.ctf.core.trace.StreamInputReaderComparator;
 import org.junit.After;
 import org.junit.Before;
@@ -61,39 +51,4 @@ public class StreamInputReaderComparatorTest {
     public void testStreamInputReaderComparator() {
         assertNotNull(fixture);
     }
-
-    /**
-     * Run the int compare(StreamInputReader,StreamInputReader) method test.
-     *
-     * @throws CTFReaderException
-     */
-    @Test
-    public void testCompare() throws CTFReaderException {
-        StreamInputReader sir1, sir2;
-        EventDefinition ed1, ed2;
-
-        sir1 = new StreamInputReader(new StreamInput(new Stream(
-                TestParams.createTrace()), (FileChannel) null,
-                TestParams.getEmptyFile()));
-        ed1 = new EventDefinition(new EventDeclaration(),
-                new StreamInputReader(new StreamInput(new Stream(
-                        TestParams.createTrace()), (FileChannel) null,
-                        TestParams.getEmptyFile())));
-        ed1.setTimestamp(1L);
-        sir1.setCurrentEvent(ed1);
-
-        sir2 = new StreamInputReader(new StreamInput(new Stream(
-                TestParams.createTrace()), (FileChannel) null,
-                TestParams.getEmptyFile()));
-        ed2 = new EventDefinition(new EventDeclaration(),
-                new StreamInputReader(new StreamInput(new Stream(
-                        TestParams.createTrace()), (FileChannel) null,
-                        TestParams.getEmptyFile())));
-
-        ed2.setTimestamp(1L);
-        sir2.setCurrentEvent(ed2);
-
-        int result = fixture.compare(sir1, sir2);
-        assertEquals(0, result);
-    }
 }
index ce33999fb3713715253eec1b6e8d068de27c1da9..3eb9429832b80bded8db5a8f04a8848fc905c047 100644 (file)
@@ -1,22 +1,16 @@
 package org.eclipse.linuxtools.ctf.core.tests.trace;
 
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-import java.nio.channels.FileChannel;
-
-import org.eclipse.linuxtools.ctf.core.tests.TestParams;
-import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
-import org.eclipse.linuxtools.ctf.core.trace.StreamInputReader;
-import org.eclipse.linuxtools.internal.ctf.core.trace.Stream;
-import org.eclipse.linuxtools.internal.ctf.core.trace.StreamInput;
 import org.eclipse.linuxtools.internal.ctf.core.trace.StreamInputReaderTimestampComparator;
-import org.junit.*;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * The class <code>StreamInputReaderTimestampComparatorTest</code> contains
  * tests for the class <code>{@link StreamInputReaderTimestampComparator}</code>
- * 
+ *
  * @author ematkho
  * @version $Revision: 1.0 $
  */
@@ -26,7 +20,7 @@ public class StreamInputReaderTimestampComparatorTest {
 
     /**
      * Launch the test.
-     * 
+     *
      * @param args
      *            the command line arguments
      */
@@ -58,23 +52,4 @@ public class StreamInputReaderTimestampComparatorTest {
         assertNotNull(fixture);
     }
 
-    /**
-     * Run the int compare(StreamInputReader,StreamInputReader) method test.
-     * 
-     * @throws CTFReaderException 
-     */
-    @Test
-    public void testCompare() throws CTFReaderException {
-        StreamInputReader a, b;
-        a = new StreamInputReader(new StreamInput(new Stream(
-                TestParams.createTrace()), (FileChannel) null,
-                TestParams.getEmptyFile()));
-        a.setCurrentEvent(null);
-        b = new StreamInputReader(new StreamInput(new Stream(
-                TestParams.createTrace()), (FileChannel) null,
-                TestParams.getEmptyFile()));
-
-        int result = fixture.compare(a, b);
-        assertEquals(0, result);
-    }
 }
index 28a58309143916eb95d07fd948f18a3e69afd458..3bacac1f02f93c4723743f8bc92f29069a681fbc 100644 (file)
@@ -183,30 +183,4 @@ public class StreamInputTest {
                 (FileChannel) null, createFile());
         assertEquals(s1,s2);
     }
-    @Test
-    public void testEquals5() throws CTFReaderException{
-        s1 = new StreamInput(new Stream(TestParams.createTrace()),
-                (FileChannel) null, createFile());
-        s2 = new StreamInput(new Stream(null),
-                (FileChannel) null, new File("")); //$NON-NLS-1$
-        assertFalse(s1.equals(s2));
-    }
-    @Test
-    public void testEquals6(){
-        s1 = new StreamInput(new Stream(null),
-                (FileChannel) null, null);
-        s2 = new StreamInput(new Stream(null),
-                (FileChannel) null, new File("")); //$NON-NLS-1$
-
-
-        assertFalse(s1.equals(s2));
-    }
-    @Test
-    public void testEquals7() throws CTFReaderException{
-        s1 = new StreamInput(new Stream(null),
-                (FileChannel) null, new File("")); //$NON-NLS-1$
-        s2 = new StreamInput(new Stream(TestParams.createTrace()),
-                (FileChannel) null, createFile());
-        assertFalse(s1.equals(s2));
-    }
 }
\ No newline at end of file
index c6b6740613e080b09d7d7ee82888ea384e17f238..8b1cec41b07ca8ddd587176c0b96d75384633318 100644 (file)
@@ -42,8 +42,8 @@ public class StreamTest {
 
     /**
      * Perform pre-test initialization.
-     * 
-     * @throws CTFReaderException 
+     *
+     * @throws CTFReaderException
      */
     @Before
     public void setUp() throws CTFReaderException {
@@ -66,8 +66,8 @@ public class StreamTest {
 
     /**
      * Run the Stream(CTFTrace) constructor test.
-     * 
-     * @throws CTFReaderException 
+     *
+     * @throws CTFReaderException
      */
     @Test
     public void testStream() throws CTFReaderException {
@@ -87,21 +87,6 @@ public class StreamTest {
         fixture.addEvent(event);
     }
 
-    /**
-     * Run the void addEvent(EventDeclaration) method test with an event
-     * of which we modified the id.
-     * @throws ParseException
-     *
-     * @throws ParseException
-     */
-    @Test
-    public void testAddEvent_modifiedEvent() throws ParseException {
-        EventDeclaration event = new EventDeclaration();
-        event.setId(1L);
-        fixture.addEvent(event);
-        assertNotNull(fixture);
-    }
-
     /**
      * Run the boolean eventContextIsSet() method test.
      */
index 1fad892ec4e3adfab0f7506b1e43401028b6aeed..a19f98a204d8da70eccf109820b7213242001a4a 100644 (file)
@@ -6,9 +6,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-
 import org.eclipse.linuxtools.ctf.core.event.EventDeclaration;
 import org.eclipse.linuxtools.ctf.core.event.EventDefinition;
 import org.eclipse.linuxtools.ctf.core.event.types.StructDeclaration;
@@ -16,9 +13,7 @@ import org.eclipse.linuxtools.ctf.core.tests.TestParams;
 import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
 import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
 import org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader;
-import org.eclipse.linuxtools.ctf.core.trace.StreamInputReader;
 import org.eclipse.linuxtools.internal.ctf.core.trace.Stream;
-import org.eclipse.linuxtools.internal.ctf.core.trace.StreamInput;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -96,22 +91,6 @@ public class EventDeclarationTest {
         assertFalse(result);
     }
 
-    /**
-     * Run the EventDefinition createDefinition(StreamInputReader) method test.
-     *
-     * @throws CTFReaderException
-     * @throws FileNotFoundException
-     */
-    @Test
-    public void testCreateDefinition() throws CTFReaderException, FileNotFoundException {
-        StreamInputReader streamInputReader = new StreamInputReader(
-                new StreamInput(new Stream(TestParams.createTrace()),
-                       (new FileInputStream(TestParams.getTraceFile())).getChannel(), TestParams.getTraceFile()));
-
-        EventDefinition result = fixture.createDefinition(streamInputReader);
-        assertNotNull(result);
-    }
-
     /**
      * Run the boolean equals(Object) method test.
      *
index 89c0baa991667961400d9d2bf491f06f85118877..af60e736f84a860a689405b1127a25ecc9e10a1e 100644 (file)
@@ -34,6 +34,7 @@ import java.util.UUID;
 
 import org.eclipse.linuxtools.ctf.core.event.CTFClock;
 import org.eclipse.linuxtools.ctf.core.event.EventDeclaration;
+import org.eclipse.linuxtools.ctf.core.event.EventDefinition;
 import org.eclipse.linuxtools.ctf.core.event.types.ArrayDefinition;
 import org.eclipse.linuxtools.ctf.core.event.types.Definition;
 import org.eclipse.linuxtools.ctf.core.event.types.IDefinitionScope;
@@ -45,6 +46,7 @@ import org.eclipse.linuxtools.internal.ctf.core.event.io.BitBuffer;
 import org.eclipse.linuxtools.internal.ctf.core.event.metadata.exceptions.ParseException;
 import org.eclipse.linuxtools.internal.ctf.core.trace.Stream;
 import org.eclipse.linuxtools.internal.ctf.core.trace.StreamInput;
+import org.eclipse.linuxtools.internal.ctf.core.trace.StreamInputPacketIndex;
 
 /**
  * <b><u>CTFTrace</u></b>
@@ -143,7 +145,13 @@ public class CTFTrace implements IDefinitionScope {
                                                                                          // fieldJavadoc
 
     /** map of all the event types */
-    private final HashMap<Long, EventDeclaration> events;
+    private final HashMap<Long,HashMap<Long, EventDeclaration>> eventDecs;
+    /** map of all the event types */
+    private final HashMap<StreamInput,HashMap<Long, EventDefinition>> eventDefs;
+    /** map of all the indexes */
+    private final HashMap<StreamInput, StreamInputPacketIndex> indexes;
+
+
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -177,6 +185,8 @@ public class CTFTrace implements IDefinitionScope {
         environment = new HashMap<String, String>();
         clocks = new HashMap<String, CTFClock>();
         streamFileChannels = new LinkedList<FileChannel>();
+        eventDecs = new HashMap<Long, HashMap<Long, EventDeclaration>>();
+        eventDefs = new HashMap<StreamInput, HashMap<Long, EventDefinition>>();
 
         if (!this.path.isDirectory()) {
             throw new CTFReaderException("Path must be a valid directory"); //$NON-NLS-1$
@@ -199,12 +209,12 @@ public class CTFTrace implements IDefinitionScope {
         /* List files not called metadata and not hidden. */
         File[] files = path.listFiles(metadataFileFilter);
         Arrays.sort(files, metadataComparator);
-
+        indexes = new HashMap<StreamInput, StreamInputPacketIndex>();
         /* Try to open each file */
         for (File streamFile : files) {
             openStreamInput(streamFile);
         }
-        events = new HashMap<Long, EventDeclaration>();
+
         /* Create their index */
         for (Map.Entry<Long, Stream> stream : streams.entrySet()) {
             Set<StreamInput> inputs = stream.getValue().getStreamInputs();
@@ -218,7 +228,7 @@ public class CTFTrace implements IDefinitionScope {
                     Map.Entry<Long, EventDeclaration> pairs = it.next();
                     Long eventNum = pairs.getKey();
                     EventDeclaration eventDec = pairs.getValue();
-                    events.put(eventNum, eventDec);
+                    getEvents(s.getStream().getId()).put(eventNum, eventDec);
                 }
 
                 /*
@@ -250,23 +260,47 @@ public class CTFTrace implements IDefinitionScope {
     // ------------------------------------------------------------------------
 
     /**
-     * Get an event by it's ID
-     *
-     * @param id
-     *            the ID of the event
-     * @return the event declaration
+     * Gets an event declaration hashmap for a given streamID
+     * @param streanId
+     * @return the hashmap with the event declarations
+     */
+    public HashMap<Long, EventDeclaration> getEvents(Long streanId) {
+        return eventDecs.get(streanId);
+    }
+
+    /**
+     * Gets an index for a given StreamInput
+     * @param id the StreamInput
+     * @return The index
      */
-    public EventDeclaration getEventType(long id) {
-        return events.get(id);
+    public StreamInputPacketIndex getIndex(StreamInput id){
+        if(! indexes.containsKey(id)){
+            indexes.put(id, new StreamInputPacketIndex());
+        }
+        return indexes.get(id);
     }
 
     /**
-     * Get the number of events in the trace so far.
+     * Gets an event Declaration hashmap for a given StreamInput
+     * @param id the StreamInput
+     * @return the hashmap with the event definitions
+     */
+    public HashMap<Long, EventDefinition> getEventDefs(StreamInput id) {
+        if(! eventDefs.containsKey(id)){
+            eventDefs.put(id, new HashMap<Long, EventDefinition>());
+        }
+        return eventDefs.get(id);
+    }
+
+    /**
+     * Get an event by it's ID
      *
-     * @return the number of events in the trace
+     * @param id
+     *            the ID of the event
+     * @return the event declaration
      */
-    public int getNbEventTypes() {
-        return events.size();
+    public EventDeclaration getEventType(long streamId, long id) {
+        return getEvents(streamId).get(id);
     }
 
     /**
@@ -589,8 +623,7 @@ public class CTFTrace implements IDefinitionScope {
         }
 
         /*
-         * If the stream we try to add has the null key, it must be the only
-         * one. Thus, if the streams container is not empty, it is not valid.
+         * If the stream we try to add has the null key, it must be the onl         * one. Thus, if the streams container is not empty, it is not valid.
          */
         if ((stream.getId() == null) && (streams.size() != 0)) {
             throw new ParseException("Stream without id with multiple streams"); //$NON-NLS-1$
@@ -603,6 +636,7 @@ public class CTFTrace implements IDefinitionScope {
 
         /* It should be ok now. */
         streams.put(stream.getId(), stream);
+        eventDecs.put(stream.getId(), new HashMap<Long,EventDeclaration>());
     }
 
     public HashMap<String, String> getEnvironment() {
@@ -646,6 +680,18 @@ public class CTFTrace implements IDefinitionScope {
         return singleOffset;
     }
 
+    public boolean hasEvents(Long id){
+        return eventDecs.containsKey(id);
+    }
+    public HashMap<Long, EventDeclaration> createEvents(Long id){
+        HashMap<Long, EventDeclaration> value = eventDecs.get(id);
+        if( value == null ) {
+            value = new HashMap<Long, EventDeclaration>();
+            eventDecs.put(id, value);
+        }
+        return value;
+    }
+
 }
 
 class MetadataFileFilter implements FileFilter {
index 08f9d181abd47ae95454cb1f7923544de96d338f..3fbd66cce168ea3e4b07a1cb0db96ba2eff3f4a5 100644 (file)
@@ -149,7 +149,6 @@ public class CTFTraceReader {
              * For each trace file of the stream.
              */
             for (StreamInput streamInput : streamInputs) {
-                streamInput.getIndex().getEntries().clear();
                 /*
                  * Create a reader.
                  */
index 50193e553cec1b02f50044347781a152e77d3ba4..02b86226dc35923ef9e36ce64125f811364971a3 100644 (file)
@@ -87,7 +87,7 @@ public class StreamInputPacketReader implements IDefinitionScope {
     /**
      * Maps event ID to event definitions.
      */
-    private final HashMap<Long, EventDefinition> events = new HashMap<Long, EventDefinition>();
+    private final HashMap<Long, EventDefinition> events;
 
     /**
      * CPU id of current packet.
@@ -119,13 +119,15 @@ public class StreamInputPacketReader implements IDefinitionScope {
          */
         getBitBuffer().setByteOrder(streamInputReader.getByteOrder());
 
+        events = streamInputReader.getStreamInput().getStream().getTrace()
+                .getEventDefs(streamInputReader.getStreamInput());
         /*
          * Create definitions needed to read the events.
          */
         createDefinitions();
 
-        lostEvents = 0 ;
-        lostSoFar = 0 ;
+        lostEvents = 0;
+        lostSoFar = 0;
     }
 
     // ------------------------------------------------------------------------
@@ -167,17 +169,20 @@ public class StreamInputPacketReader implements IDefinitionScope {
         /*
          * Create trace packet header definition.
          */
-        final Stream currentStream = getStreamInputReader().getStreamInput().getStream();
-        StructDeclaration tracePacketHeaderDecl = currentStream.getTrace().getPacketHeader();
+        final Stream currentStream = getStreamInputReader().getStreamInput()
+                .getStream();
+        StructDeclaration tracePacketHeaderDecl = currentStream.getTrace()
+                .getPacketHeader();
         if (tracePacketHeaderDecl != null) {
-            setTracePacketHeaderDef(tracePacketHeaderDecl.createDefinition(this,
-                    "trace.packet.header")); //$NON-NLS-1$
+            setTracePacketHeaderDef(tracePacketHeaderDecl.createDefinition(
+                    this, "trace.packet.header")); //$NON-NLS-1$
         }
 
         /*
          * Create stream packet context definition.
          */
-        StructDeclaration streamPacketContextDecl = currentStream.getPacketContextDecl();
+        StructDeclaration streamPacketContextDecl = currentStream
+                .getPacketContextDecl();
         if (streamPacketContextDecl != null) {
             setStreamPacketContextDef(streamPacketContextDecl.createDefinition(
                     this, "stream.packet.context")); //$NON-NLS-1$
@@ -186,16 +191,18 @@ public class StreamInputPacketReader implements IDefinitionScope {
         /*
          * Create stream event header definition.
          */
-        StructDeclaration streamEventHeaderDecl = currentStream.getEventHeaderDecl();
+        StructDeclaration streamEventHeaderDecl = currentStream
+                .getEventHeaderDecl();
         if (streamEventHeaderDecl != null) {
-            setStreamEventHeaderDef(streamEventHeaderDecl.createDefinition(this,
-                    "stream.event.header")); //$NON-NLS-1$
+            setStreamEventHeaderDef(streamEventHeaderDecl.createDefinition(
+                    this, "stream.event.header")); //$NON-NLS-1$
         }
 
         /*
          * Create stream event context definition.
          */
-        StructDeclaration streamEventContextDecl = currentStream.getEventContextDecl();
+        StructDeclaration streamEventContextDecl = currentStream
+                .getEventContextDecl();
         if (streamEventContextDecl != null) {
             setStreamEventContextDef(streamEventContextDecl.createDefinition(
                     this, "stream.event.context")); //$NON-NLS-1$
@@ -208,15 +215,18 @@ public class StreamInputPacketReader implements IDefinitionScope {
      * Creates definitions needed to read the event. (event-defined).
      */
     private void createEventDefinitions() {
-        Collection<EventDeclaration> eventDecls = getStreamInputReader().getStreamInput().getStream().getEvents().values();
+        Collection<EventDeclaration> eventDecls = getStreamInputReader()
+                .getStreamInput().getStream().getEvents().values();
 
         /*
          * Create definitions for each event.
          */
         for (EventDeclaration event : eventDecls) {
-            EventDefinition eventDef = event.createDefinition(getStreamInputReader());
-
-            events.put(event.getId(), eventDef);
+            if (!events.containsKey(event.getId())) {
+                EventDefinition eventDef = event
+                        .createDefinition(getStreamInputReader());
+                events.put(event.getId(), eventDef);
+            }
         }
     }
 
@@ -235,9 +245,12 @@ public class StreamInputPacketReader implements IDefinitionScope {
              */
             MappedByteBuffer bb = null;
             try {
-                bb = getStreamInputReader().getStreamInput().getFileChannel().map(
-                        MapMode.READ_ONLY, this.currentPacket.getOffsetBytes(),
-                        (this.currentPacket.getPacketSizeBits() + 7) / 8);
+                bb = getStreamInputReader()
+                        .getStreamInput()
+                        .getFileChannel()
+                        .map(MapMode.READ_ONLY,
+                                this.currentPacket.getOffsetBytes(),
+                                (this.currentPacket.getPacketSizeBits() + 7) / 8);
             } catch (IOException e) {
                 /*
                  * The streamInputReader object is already allocated, so this
@@ -264,16 +277,20 @@ public class StreamInputPacketReader implements IDefinitionScope {
                  * Read CPU ID
                  */
 
-                Definition cpuiddef = getStreamPacketContextDef().lookupDefinition("cpu_id"); //$NON-NLS-1$
+                Definition cpuiddef = getStreamPacketContextDef()
+                        .lookupDefinition("cpu_id"); //$NON-NLS-1$
                 if (cpuiddef instanceof IntegerDefinition) {
-                    currentCpu = (int) ((IntegerDefinition) cpuiddef).getValue();
+                    currentCpu = (int) ((IntegerDefinition) cpuiddef)
+                            .getValue();
                 }
                 /*
                  * Read number of lost events
                  */
-                Definition lostEventsdef = getStreamPacketContextDef().lookupDefinition("events_discarded"); //$NON-NLS-1$
+                Definition lostEventsdef = getStreamPacketContextDef()
+                        .lookupDefinition("events_discarded"); //$NON-NLS-1$
                 if (cpuiddef instanceof IntegerDefinition) {
-                    lostEvents = (int) ((IntegerDefinition) lostEventsdef).getValue();
+                    lostEvents = (int) ((IntegerDefinition) lostEventsdef)
+                            .getValue();
                 }
 
             }
@@ -297,7 +314,8 @@ public class StreamInputPacketReader implements IDefinitionScope {
      */
     public boolean hasMoreEvents() {
         if (currentPacket != null) {
-            return getBitBuffer().position() < currentPacket.getContentSizeBits();
+            return getBitBuffer().position() < currentPacket
+                    .getContentSizeBits();
         }
         return false;
     }
@@ -314,15 +332,16 @@ public class StreamInputPacketReader implements IDefinitionScope {
         Long eventID = null;
         long timestamp = 0;
 
-
-        if( lostEvents > lostSoFar)
-        {
-            EventDefinition eventDef = EventDeclaration.getLostEventDeclaration().createDefinition(streamInputReader);
+        if (lostEvents > lostSoFar) {
+            EventDefinition eventDef = EventDeclaration
+                    .getLostEventDeclaration().createDefinition(
+                            streamInputReader);
             eventDef.setTimestamp(this.lastTimestamp);
             ++lostSoFar;
             return eventDef;
         }
-        StructDefinition sehd = getStreamEventHeaderDef(); // acronym for a long variable name
+        StructDefinition sehd = getStreamEventHeaderDef(); // acronym for a long
+                                                           // variable name
         BitBuffer currentBitBuffer = getBitBuffer();
         /*
          * Read the stream event header.
@@ -334,7 +353,8 @@ public class StreamInputPacketReader implements IDefinitionScope {
             /*
              * Check for an event id.
              */
-            EnumDefinition idEnumDef = (EnumDefinition) sehd.lookupDefinition("id"); //$NON-NLS-1$
+            EnumDefinition idEnumDef = (EnumDefinition) sehd
+                    .lookupDefinition("id"); //$NON-NLS-1$
             assert (idEnumDef != null);
 
             eventID = idEnumDef.getIntegerValue();
@@ -342,20 +362,23 @@ public class StreamInputPacketReader implements IDefinitionScope {
             /*
              * Check for the variant v.
              */
-            VariantDefinition variantDef = (VariantDefinition) sehd.lookupDefinition("v"); //$NON-NLS-1$
+            VariantDefinition variantDef = (VariantDefinition) sehd
+                    .lookupDefinition("v"); //$NON-NLS-1$
             assert (variantDef != null);
 
             /*
              * Get the variant current field
              */
-            StructDefinition variantCurrentField = (StructDefinition) variantDef.getCurrentField();
+            StructDefinition variantCurrentField = (StructDefinition) variantDef
+                    .getCurrentField();
             assert (variantCurrentField != null);
 
             /*
              * Try to get the id field in the current field of the variant. If
              * it is present, it overrides the previously read event id.
              */
-            IntegerDefinition idIntegerDef = (IntegerDefinition) variantCurrentField.lookupDefinition("id"); //$NON-NLS-1$
+            IntegerDefinition idIntegerDef = (IntegerDefinition) variantCurrentField
+                    .lookupDefinition("id"); //$NON-NLS-1$
             if (idIntegerDef != null) {
                 eventID = idIntegerDef.getValue();
             }
@@ -363,7 +386,8 @@ public class StreamInputPacketReader implements IDefinitionScope {
             /*
              * Get the timestamp.
              */
-            IntegerDefinition timestampDef = (IntegerDefinition) variantCurrentField.lookupDefinition("timestamp"); //$NON-NLS-1$
+            IntegerDefinition timestampDef = (IntegerDefinition) variantCurrentField
+                    .lookupDefinition("timestamp"); //$NON-NLS-1$
             assert (timestampDef != null);
 
             /*
@@ -454,6 +478,7 @@ public class StreamInputPacketReader implements IDefinitionScope {
         return lastTimestamp;
     }
 
+    @SuppressWarnings("unused")
     @Override
     public Definition lookupDefinition(String lookupPath) {
         // TODO Auto-generated method stub
@@ -476,7 +501,8 @@ public class StreamInputPacketReader implements IDefinitionScope {
         this.streamEventHeaderDef = streamEventHeaderDef;
     }
 
-    public void setStreamPacketContextDef(StructDefinition streamPacketContextDef) {
+    public void setStreamPacketContextDef(
+            StructDefinition streamPacketContextDef) {
         this.streamPacketContextDef = streamPacketContextDef;
     }
 
index 9a83d84f6398b05a8b6adc8b4e009509f2946abe..1434fa781b5137b5260394d45da716bcab90c125 100644 (file)
@@ -53,7 +53,7 @@ public class Stream {
     /**
      * Maps event ids to events
      */
-    private final HashMap<Long, EventDeclaration> events = new HashMap<Long, EventDeclaration>();
+    private HashMap<Long, EventDeclaration> events;
 
     /**
      * The inputs associated to this stream
@@ -80,6 +80,7 @@ public class Stream {
 
     public void setId(long id) {
         this.id = id;
+        this.events = trace.createEvents(this.id);
     }
 
     public Long getId() {
index 6c819a7206b6aebd738cbe6c584676b9d04e22d3..b90bb128372bd44404e8133f697effbe0cd1b8a2 100644 (file)
@@ -89,7 +89,7 @@ public class StreamInput implements IDefinitionScope {
         this.stream = stream;
         this.fileChannel = fileChannel;
         this.file = file;
-        index = new StreamInputPacketIndex();
+        index = stream.getTrace().getIndex(this);
     }
 
     // ------------------------------------------------------------------------
index 3c90e05edd4c216077edf4615ce1f1b103ff176a..c81571122e32e55f4bb0fe886e1b4370a1872f3a 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2009, 2010 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Francois Chouinard - Initial API and implementation
  *******************************************************************************/
index 5cd34a7ce9df5c0e6e0ea659f9cabc71a943f66a..8388fcd6f204fd7f29a73e01f3513081b2bb4a49 100644 (file)
@@ -113,10 +113,11 @@ public class CtfTmfEventTest {
      */
     @Test
     public void testGetFieldValue() {
-        String fieldName = "ret"; //$NON-NLS-1$
-        Object result = fixture.getContent().getField(fieldName).getValue();
+        String fieldName = "pid"; //$NON-NLS-1$
+        ITmfEventField result = fixture.getContent().getField(fieldName);
 
         assertNotNull(result);
+        assertNotNull(result.getValue());
     }
 
     /**
@@ -184,16 +185,16 @@ public class CtfTmfEventTest {
         String source = fixture.getSource();
         ITmfEventType type = fixture.getType();
         assertEquals(rank, 0);
-        assertEquals(trace.getName(), "kernel"); //$NON-NLS-1$
+        assertEquals(trace.getName(), "test"); //$NON-NLS-1$
         assertEquals(channelName, "channel0_1"); //$NON-NLS-1$
         assertEquals(reference,"channel0_1"); //$NON-NLS-1$
         assertEquals(source, "1"); //$NON-NLS-1$
-        assertEquals(type.toString(), "exit_syscall"); //$NON-NLS-1$
+        assertEquals(type.toString(), "lttng_statedump_vm_map"); //$NON-NLS-1$
     }
 
     @Test
     public void testToString() {
         String s = fixture.getContent().toString();
-        assertEquals("ret=4132", s); //$NON-NLS-1$
+        assertEquals("pid=1922, inode=917738, flags=134217845, end=3074342912, start=3074334720, pgoff=0", s); //$NON-NLS-1$
     }
 }
index 5a309f7e4b61f8de98b10478bc4baadbf601cdfc..69dba2413b603aff8aa8157ba521759705255558 100644 (file)
@@ -58,6 +58,15 @@ public class CtfTmfTraceTest {
         assertEquals(null, result.getType());
     }
 
+    @Test
+    public void testParseEvent() throws TmfTraceException{
+        CtfTmfTrace fixture = initTrace();
+        ITmfContext ctx = fixture.seekEvent(0);
+        fixture.getNext(ctx);
+        CtfTmfEvent event = fixture.parseEvent(ctx);
+        assertNotNull(event);
+    }
+
     /**
      * @return
      * @throws TmfTraceException
@@ -263,7 +272,7 @@ public class CtfTmfTraceTest {
         // An unexpected exception was thrown in user code while executing this test:
         //    org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException: Path must be a valid directory
         //       at org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace.initTrace(CtfTmfTrace.java:98)
-        assertEquals(Double.POSITIVE_INFINITY, result, 0.1);
+        assertEquals(Double.NEGATIVE_INFINITY, result, 0.1);
     }
 
     /**
@@ -693,7 +702,7 @@ public class CtfTmfTraceTest {
     public void testSeekEvent_1()
         throws Exception {
         CtfTmfTrace fixture = initTrace();
-        double ratio = 1.0;
+        double ratio = 0.99;
 
         ITmfContext result = fixture.seekEvent(ratio);
 
index a2f57ab297a8e33dc8a8d5e3c2f5dde82e43ce4d..be7bd1447a1e4f4cac2fa5af8d7c920c37691551 100644 (file)
@@ -239,6 +239,7 @@ public class CtfIterator extends CTFTraceReader implements ITmfContext, Comparab
         }
         return 0;
     }
+
     /* (non-Javadoc)
      * @see java.lang.Object#hashCode()
      */
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfLightweightContext.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfLightweightContext.java
new file mode 100644 (file)
index 0000000..0f5e320
--- /dev/null
@@ -0,0 +1,203 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.ctfadaptor;
+
+import java.util.ArrayList;
+import java.util.ListIterator;
+
+import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
+
+/**
+ * Lightweight Context for CtfTmf traces. Should only use 3 references, 1 ref to
+ * a boxed Long, a long and an int.
+ *
+ * @author Matthew Khouzam
+ *
+ */
+public class CtfTmfLightweightContext implements ITmfContext {
+
+    // -------------------------------------------
+    // Constants
+    // -------------------------------------------
+    private static final int MAX_COLLISIONS = 10;
+
+    // -------------------------------------------
+    // Fields
+    // -------------------------------------------
+    private CtfLocation curLocation;
+    private long curRank;
+    private int collisions;
+
+    private CtfIterator fSeeker;
+    final private ArrayList<CtfIterator> fIteratorPool;
+    private ListIterator<CtfIterator> fCurrentIterator;
+
+    // -------------------------------------------
+    // Constructor
+    // -------------------------------------------
+    /**
+     *
+     * @param iters
+     *            the shared iterator pool.
+     * @param pos
+     *            the iterator position.
+     */
+    public CtfTmfLightweightContext(ArrayList<CtfIterator> iters,
+            ListIterator<CtfIterator> pos) {
+        fIteratorPool = iters;
+        fCurrentIterator = pos;
+        fSeeker = getIterator();
+        curLocation = new CtfLocation((Long)null);
+        collisions = 0;
+    }
+
+    // -------------------------------------------
+    // TmfContext Overrides
+    // -------------------------------------------
+
+    @Override
+    public long getRank() {
+        return curRank;
+    }
+
+    @Override
+    public ITmfLocation<? extends Comparable<?>> getLocation() {
+        return curLocation;
+    }
+
+    @Override
+    public boolean hasValidRank() {
+        return curRank != CtfLocation.INVALID_LOCATION;
+    }
+
+    @Override
+    public void setLocation(ITmfLocation<? extends Comparable<?>> location) {
+        curLocation = (CtfLocation) location;
+        updateLocation();
+    }
+
+    @Override
+    public void setRank(long rank) {
+        curRank = rank;
+
+    }
+
+    @Override
+    public void increaseRank() {
+        if (hasValidRank()) {
+            curRank++;
+        }
+    }
+
+    // -------------------------------------------
+    // CtfTmfTrace Helpers
+    // -------------------------------------------
+
+    /**
+     * Gets the current event. Wrapper to help CtfTmfTrace
+     * @return The event or null
+     */
+    public synchronized CtfTmfEvent getCurrentEvent() {
+        updateLocation();
+        return fSeeker.getCurrentEvent();
+    }
+
+    /**
+     * Advances to a the next event. Wrapper to help CtfTmfTrace
+     * @return success or not
+     */
+    public synchronized boolean advance() {
+        updateLocation();
+        boolean retVal = fSeeker.advance();
+        CtfTmfEvent currentEvent = fSeeker.getCurrentEvent();
+        if (currentEvent != null) {
+            curLocation.setLocation(currentEvent.getTimestampValue());
+        } else {
+            curLocation.setLocation(CtfLocation.INVALID_LOCATION);
+        }
+
+        return retVal;
+    }
+
+    @Override
+    public void dispose() {
+        // do nothing
+    }
+
+    /**
+     * Seeks to a given timestamp. Wrapper to help CtfTmfTrace
+     * @param timestamp desired timestamp
+     * @return success or not
+     */
+    public synchronized boolean seek(final long timestamp) {
+        curLocation.setLocation(timestamp);
+        collisions = 0;
+        fSeeker = getIterator();
+        return updateLocation();
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see java.lang.Object#clone()
+     */
+    @Override
+    public CtfTmfLightweightContext clone() {
+        CtfTmfLightweightContext ret = new CtfTmfLightweightContext(
+                fIteratorPool, fCurrentIterator);
+        ret.curLocation = curLocation.clone();
+        ret.curRank = curRank;
+        return ret;
+    }
+
+    // -------------------------------------------
+    // Private helpers
+    // -------------------------------------------
+    /**
+     * This updates the position of an iterator to the location(curLocation)
+     * Since the iterators are in a pool to not exhaust the number of file
+     * pointers some of them can be shared. This means there can be collisions
+     * between contexts fighting over the same resource. A heuristic is applied
+     * that if there are MAX_COLLISIONS collisions in a row, the iterator is
+     * changed for the next one in the iterator pool.
+     *
+     * @return true if the location is correct.
+     */
+    private synchronized boolean updateLocation() {
+        if (!curLocation.getLocation().equals(
+                (fSeeker.getLocation().getLocation()))) {
+            collisions++;
+            if (collisions > MAX_COLLISIONS) {
+                fSeeker = getIterator();
+                collisions = 0;
+            }
+            fSeeker.setRank(curRank);
+            return fSeeker.seek(curLocation.getLocation());
+        }
+        collisions = 0;
+        return true;
+    }
+
+    /**
+     * gets the next iterator in a pool.
+     *
+     * @return
+     */
+    private CtfIterator getIterator() {
+        if (!fCurrentIterator.hasNext()) {
+            fCurrentIterator = fIteratorPool.listIterator(0);
+        }
+        return fCurrentIterator.next();
+    }
+
+}
index 3e24cf2294d03f0520579bbbbff335e82fc4c6f2..9e0adaf8688afdfbec075d9c325d1e6d8db9e4e1 100644 (file)
 
 package org.eclipse.linuxtools.tmf.core.ctfadaptor;
 
+import java.util.ArrayList;
+import java.util.ListIterator;
+
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.linuxtools.ctf.core.event.EventDeclaration;
-import org.eclipse.linuxtools.ctf.core.event.EventDefinition;
 import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
 import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTimestamp.TimestampType;
-import org.eclipse.linuxtools.tmf.core.event.ITmfEventField;
 import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
@@ -32,6 +32,7 @@ import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
 
 public class CtfTmfTrace extends TmfTrace<CtfTmfEvent> implements ITmfEventParser<CtfTmfEvent>{
 
+
     //-------------------------------------------
     //        Constants
     //-------------------------------------------
@@ -39,6 +40,7 @@ public class CtfTmfTrace extends TmfTrace<CtfTmfEvent> implements ITmfEventParse
      * Default cache size for CTF traces
      */
     protected static final int DEFAULT_CACHE_SIZE = 50000;
+    private static final int ITER_POOL_SIZE = 128;
 
     //-------------------------------------------
     //        Fields
@@ -50,6 +52,16 @@ public class CtfTmfTrace extends TmfTrace<CtfTmfEvent> implements ITmfEventParse
     /* Reference to the CTF Trace */
     private CTFTrace fTrace;
 
+    /*
+     * The iterator pool. This is a necessary change since larger traces will
+     * need many contexts and each context must have to a file pointer. Since
+     * the OS supports only so many handles on a given file, but the UI must
+     * still be responsive, parallel seeks (up to ITER_POOL_SIZE requests)
+     * can be made with a fast response time.
+     * */
+    private ArrayList<CtfIterator> fIterators;
+    private ListIterator<CtfIterator> nextIter;
+
     //-------------------------------------------
     //        TmfTrace Overrides
     //-------------------------------------------
@@ -70,26 +82,19 @@ public class CtfTmfTrace extends TmfTrace<CtfTmfEvent> implements ITmfEventParse
          */
         setCacheSize();
         super.initTrace(resource, path, eventType);
-        EventDeclaration ed;
-        ITmfEventField eventField;
 
         @SuppressWarnings("unused")
         CtfTmfEventType type;
 
         try {
             this.fTrace = new CTFTrace(path);
-            for( int i =0 ; i< this.fTrace.getNbEventTypes(); i++) {
-                ed = this.fTrace.getEventType(i);
-                eventField = parseDeclaration(ed);
-                /*
-                 * Populate the event manager with event types that are there in
-                 * the beginning.
-                 */
-                type = new CtfTmfEventType(ed.getName(), eventField);
+            fIterators = new ArrayList<CtfIterator>(ITER_POOL_SIZE);
+            for(int i = 0 ; i < ITER_POOL_SIZE; i++){
+                fIterators.add(new CtfIterator(this, 0, 0));
             }
-
+            nextIter = fIterators.listIterator(0);
             /* Set the start and (current) end times for this trace */
-            final CtfIterator iterator = new CtfIterator(this, 0, 0);
+            final CtfIterator iterator = getIterator();
             if(iterator.getLocation().equals(CtfIterator.NULL_LOCATION)) {
                 /* Handle the case where the trace is empty */
                 this.setStartTime(TmfTimestamp.BIG_BANG);
@@ -153,20 +158,33 @@ public class CtfTmfTrace extends TmfTrace<CtfTmfEvent> implements ITmfEventParse
     @Override
     public double getLocationRatio(ITmfLocation<?> location) {
         final CtfLocation curLocation = (CtfLocation) location;
-        CtfIterator iterator = new CtfIterator(this);
-        iterator.seek(curLocation.getLocation());
-        return ((double) iterator.getCurrentEvent().getTimestampValue() - iterator
-                .getStartTime())
+        CtfIterator iterator = getIterator();
+        CtfTmfLightweightContext ctx = new CtfTmfLightweightContext(fIterators, nextIter);
+        ctx.setLocation(curLocation);
+        ctx.seek(curLocation.getLocation());
+        long currentTime = ((Long)ctx.getLocation().getLocation());
+
+        return ((double) currentTime - iterator.getStartTime())
                 / (iterator.getEndTime() - iterator.getStartTime());
     }
 
+    /**
+     * @return
+     */
+    private CtfIterator getIterator() {
+        if( !nextIter.hasNext()){
+            nextIter = fIterators.listIterator(0);
+        }
+        return nextIter.next();
+    }
+
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.tmf.core.trace.TmfTrace#seekEvent(org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp)
      */
     @Override
     public synchronized ITmfContext seekEvent(ITmfTimestamp timestamp) {
         if( timestamp instanceof CtfTmfTimestamp){
-            CtfIterator iter = new CtfIterator(this);
+            CtfTmfLightweightContext iter = new CtfTmfLightweightContext(fIterators, nextIter);
             iter.seek(timestamp.getValue());
             return iter;
         }
@@ -182,9 +200,7 @@ public class CtfTmfTrace extends TmfTrace<CtfTmfEvent> implements ITmfEventParse
     @Override
     public ITmfContext seekEvent(final ITmfLocation<?> location) {
         CtfLocation currentLocation = (CtfLocation) location;
-        CtfIterator context = new CtfIterator(this);
-        context.setRank(ITmfContext.UNKNOWN_RANK);
-
+        CtfTmfLightweightContext context = new CtfTmfLightweightContext(fIterators, nextIter);
         /*
          * The rank is set to 0 if the iterator seeks the beginning. If not, it
          * will be set to UNKNOWN_RANK, since CTF traces don't support seeking
@@ -208,7 +224,7 @@ public class CtfTmfTrace extends TmfTrace<CtfTmfEvent> implements ITmfEventParse
 
     @Override
     public ITmfContext seekEvent(double ratio) {
-        CtfIterator context = new CtfIterator(this);
+        CtfTmfLightweightContext context = new CtfTmfLightweightContext(fIterators, nextIter);
         context.seek((long) (this.getNbEvents() * ratio));
         context.setRank(ITmfContext.UNKNOWN_RANK);
         return context;
@@ -223,14 +239,14 @@ public class CtfTmfTrace extends TmfTrace<CtfTmfEvent> implements ITmfEventParse
     @Override
     public synchronized CtfTmfEvent getNext(final ITmfContext context) {
         CtfTmfEvent event = null;
-        if (context instanceof CtfIterator) {
-            CtfIterator ctfIterator = (CtfIterator) context;
-            event = ctfIterator.getCurrentEvent();
+        if (context instanceof CtfTmfLightweightContext) {
+            CtfTmfLightweightContext ctfContext = (CtfTmfLightweightContext) context;
+            event = ctfContext.getCurrentEvent();
 
             if (event != null) {
                 updateAttributes(context, event.getTimestamp());
-                ctfIterator.advance();
-                ctfIterator.increaseRank();
+                ctfContext.advance();
+                ctfContext.increaseRank();
             }
         }
 
@@ -260,17 +276,6 @@ public class CtfTmfTrace extends TmfTrace<CtfTmfEvent> implements ITmfEventParse
         return this.ss;
     }
 
-    /**
-     *
-     * @param ed
-     * @return
-     */
-    private static ITmfEventField parseDeclaration(EventDeclaration ed) {
-        EventDefinition eventDef = ed.createDefinition(null);
-        return new CtfTmfContent(ITmfEventField.ROOT_FIELD_ID,
-                CtfTmfEvent.parseFields(eventDef));
-    }
-
     /**
      * gets the CTFtrace that this is wrapping
      * @return the CTF trace
@@ -331,8 +336,8 @@ public class CtfTmfTrace extends TmfTrace<CtfTmfEvent> implements ITmfEventParse
     @Override
     public CtfTmfEvent parseEvent(ITmfContext context) {
         CtfTmfEvent event = null;
-        if( context instanceof CtfIterator ){
-            CtfIterator itt = (CtfIterator) context.clone();
+        if( context instanceof CtfTmfLightweightContext ){
+            CtfTmfLightweightContext itt = (CtfTmfLightweightContext) context.clone();
             event = itt.getCurrentEvent();
         }
         return event;
This page took 0.065214 seconds and 5 git commands to generate.