import org.eclipse.linuxtools.lttng.core.trace.LTTngTextTrace;
import org.eclipse.linuxtools.lttng.core.trace.LTTngTrace;
import org.eclipse.linuxtools.lttng.jni.JniEvent;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
import org.eclipse.linuxtools.tmf.core.trace.TmfLocation;
@SuppressWarnings("unused")
LttngEvent testAnotherEvent = null;
LttngTimestamp testTime = null;
- TmfEventSource testSource = null;
+ String testSource = null;
LttngEventType testType = null;
LttngEventContent testContent = null;
LttngEventReference testReference = null;
testMarkerFields = new String[1];
testEvent = null;
testTime = new LttngTimestamp(0L);
- testSource = new TmfEventSource("test");
+ testSource = "test";
testType = new LttngEventType("test", 0L, "test", 0, testMarkerFields);
testContent = new LttngEventContent(testEvent);
testReference = new LttngEventReference("test", "test");
// These will test TMF functions but since we are expecting it to work...
assertEquals("Timestamp not what expected!",eventTimestamp,testEvent.getTimestamp().getValue());
- assertEquals("Source not what expected!",eventSource,testEvent.getSource().getSourceId());
+ assertEquals("Source not what expected!",eventSource,testEvent.getSource());
assertEquals("Reference not what expected!",eventReference,((String)testEvent.getReference().toString()) );
// These should be overridden functions
import org.eclipse.linuxtools.lttng.core.event.LttngEvent;
import org.eclipse.linuxtools.lttng.core.event.LttngEventType;
import org.eclipse.linuxtools.lttng.core.event.LttngSyntheticEvent;
-import org.eclipse.linuxtools.lttng.core.event.LttngTimestamp;
import org.eclipse.linuxtools.lttng.core.event.LttngSyntheticEvent.SequenceInd;
+import org.eclipse.linuxtools.lttng.core.event.LttngTimestamp;
import org.eclipse.linuxtools.lttng.core.model.LTTngTreeNode;
import org.eclipse.linuxtools.lttng.core.request.LttngBaseEventRequest;
import org.eclipse.linuxtools.lttng.core.state.evProcessor.ITransEventProcessor;
import org.eclipse.linuxtools.lttng.core.state.model.LttngTraceState;
import org.eclipse.linuxtools.lttng.core.state.trace.IStateTraceManager;
import org.eclipse.linuxtools.tmf.core.component.TmfEventProvider;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.experiment.TmfExperiment;
// prepare empty instance status indicators and allow them to travel via
// the framework
- TmfEventSource source = new TmfEventSource(this);
+ String source = this.toString();
LttngEventType dtype = new LttngEventType();
LttngTimestamp statusTimeStamp = new LttngTimestamp(
TmfTimestamp.Zero);
import org.eclipse.linuxtools.lttng.jni.JniEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
/**
* @see org.eclipse.linuxtools.lttng.core.event.LttngEventReference
* @see org.eclipse.linuxtools.org.eclipse.linuxtools.lttng.jni.JniEvent
*/
- public LttngEvent(TmfTrace<LttngEvent> parent, LttngTimestamp timestamp, TmfEventSource source, LttngEventType type, LttngEventContent content,
+ public LttngEvent(TmfTrace<LttngEvent> parent, LttngTimestamp timestamp, String source, LttngEventType type, LttngEventContent content,
LttngEventReference reference, JniEvent lttEvent) {
super(timestamp, source, type, reference);
this(
(TmfTrace<LttngEvent>) oldEvent.getTrace(),
(LttngTimestamp)oldEvent.getTimestamp(),
- (TmfEventSource)oldEvent.getSource(),
+ oldEvent.getSource(),
(LttngEventType)oldEvent.getType(),
(LttngEventContent)oldEvent.getContent(),
(LttngEventReference)oldEvent.getReference(),
} else if (name.equals(LttngEventType.TIMESTAMP_LABEL) || name.equals(FIELD_ID_TIMESTAMP)) {
return new Long(fParentEvent.getTimestamp().getValue()).toString();
} else if (name.equals(FIELD_ID_SOURCE)) {
- return fParentEvent.getSource().getSourceId().toString();
+ return fParentEvent.getSource();
}
// *** VERIFY ***
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2009 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:
- * William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.lttng.core.event;
-
-import org.eclipse.linuxtools.tmf.core.event.*;
-
-/**
- * <b><u>LttngEventSource</u></b><p>
- *
- * Lttng specific implementation of the TmfEventSource
- */
-public class LttngEventSource extends TmfEventSource {
-
- /**
- * Default Constructor.<p>
- *
- */
- public LttngEventSource() {
- super();
- }
-
- /**
- * Copy Constructor.<p>
- *
- * @param newSource Source of the event as string.
- */
- public LttngEventSource(String newSource) {
- super(newSource);
- }
-
-
- /**
- * Copy Constructor.<p>
- *
- * @param oldSource LttngEventSource to copy from.
- */
- public LttngEventSource(LttngEventSource oldSource) {
- this( (String)oldSource.getSourceId() );
- }
-
-
- @Override
- public String getSourceId() {
- return (String)fSourceId;
- }
-
- public void setSourceId(String newSource) {
- fSourceId = newSource;
- }
-
- @Override
- public String toString() {
- return fSourceId.toString();
- }
-
- @Override
- public LttngEventSource clone() {
- LttngEventSource clone = (LttngEventSource) super.clone();
- clone.fSourceId = new String((String) fSourceId);
- return clone;
- }
-}
import org.eclipse.linuxtools.lttng.core.state.model.LttngTraceState;
import org.eclipse.linuxtools.lttng.jni.JniEvent;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
/**
* @param lttEvent
*/
public LttngSyntheticEvent(TmfTrace<LttngEvent> parent,
- LttngTimestamp timestamp, TmfEventSource source,
+ LttngTimestamp timestamp, String source,
LttngEventType type, LttngEventContent content,
LttngEventReference reference, JniEvent lttEvent) {
super(parent, timestamp, source, type, content, reference, lttEvent);
import org.eclipse.linuxtools.lttng.core.event.LttngEventContent;
import org.eclipse.linuxtools.lttng.core.event.LttngEventField;
import org.eclipse.linuxtools.lttng.core.event.LttngEventReference;
-import org.eclipse.linuxtools.lttng.core.event.LttngEventSource;
import org.eclipse.linuxtools.lttng.core.event.LttngEventType;
import org.eclipse.linuxtools.lttng.core.event.LttngTimestamp;
import org.eclipse.linuxtools.lttng.jni.JniEvent;
public class LTTngTextTrace extends TmfTrace<LttngEvent> {
private LttngTimestamp eventTimestamp = null;
- private LttngEventSource eventSource = null;
+ private String eventSource = null;
private LttngEventType eventType = null;
private TextLttngEventContent eventContent = null;
private LttngEventReference eventReference = null;
traceTypes = new HashMap<String, LttngEventType>();
eventTimestamp = new LttngTimestamp();
- eventSource = new LttngEventSource();
+ eventSource = "";
eventType = new LttngEventType();
eventContent = new TextLttngEventContent(currentLttngEvent);
eventReference = new LttngEventReference(this.getName());
}
// EventSource is always the same for now :
- eventSource.setSourceId("Kernel Core"); //$NON-NLS-1$
+ currentLttngEvent.setSource("Kernel Core"); //$NON-NLS-1$
// Tracefile and marker are first in the file
public TextLttngEvent( TmfTrace<LttngEvent> parent,
LttngTimestamp timestamp,
- LttngEventSource source,
+ String source,
LttngEventType type,
LttngEventContent content,
LttngEventReference reference)
this(
(TmfTrace<LttngEvent>) oldEvent.getTrace(),
(LttngTimestamp)oldEvent.getTimestamp(),
- (LttngEventSource)oldEvent.getSource(),
+ oldEvent.getSource(),
(LttngEventType)oldEvent.getType(),
(LttngEventContent)oldEvent.getContent(),
(LttngEventReference)oldEvent.getReference()
import org.eclipse.linuxtools.lttng.core.event.LttngEvent;
import org.eclipse.linuxtools.lttng.core.event.LttngEventContent;
import org.eclipse.linuxtools.lttng.core.event.LttngEventReference;
-import org.eclipse.linuxtools.lttng.core.event.LttngEventSource;
import org.eclipse.linuxtools.lttng.core.event.LttngEventType;
import org.eclipse.linuxtools.lttng.core.event.LttngLocation;
import org.eclipse.linuxtools.lttng.core.event.LttngTimestamp;
private JniTrace currentJniTrace;
LttngTimestamp eventTimestamp;
- LttngEventSource eventSource;
+ String eventSource;
LttngEventContent eventContent;
LttngEventReference eventReference;
// Build the re-used event structure
eventTimestamp = new LttngTimestamp();
- eventSource = new LttngEventSource();
+ eventSource = "";
this.eventType = new LttngEventType();
eventContent = new LttngEventContent(currentLttngEvent);
eventReference = new LttngEventReference(this.getName());
// Verify that all those "default constructor" are safe to use
clone.eventTimestamp = new LttngTimestamp();
- clone.eventSource = new LttngEventSource();
+ clone.eventSource = "";
clone.eventType = new LttngEventType();
clone.eventContent = new LttngEventContent(clone.currentLttngEvent);
clone.eventReference = new LttngEventReference(this.getName());
// all allocation done in the LttngTrace constructor
// ***
eventTimestamp.setValue(jniEvent.getEventTime().getTime());
- eventSource.setSourceId(jniEvent.requestEventSource());
+ eventSource = jniEvent.requestEventSource();
eventType = traceTypes.get(EventTypeKey.getEventTypeHash(jniEvent));
// Allocating new memory is slow.
// Parsing every events is very slow.
eventTimestamp = new LttngTimestamp(jniEvent.getEventTime().getTime());
- eventSource = new LttngEventSource(jniEvent.requestEventSource());
+ eventSource = jniEvent.requestEventSource();
eventReference = new LttngEventReference(jniEvent.getParentTracefile().getTracefilePath(), this.getName());
eventType = new LttngEventType(traceTypes.get(EventTypeKey.getEventTypeHash(jniEvent)));
eventContent = new LttngEventContent(currentLttngEvent);
suite.addTestSuite(TmfEventFieldTest.class);
suite.addTestSuite(TmfEventContentTest.class);
suite.addTestSuite(TmfEventTypeTest.class);
- suite.addTestSuite(TmfEventSourceTest.class);
suite.addTestSuite(TmfEventReferenceTest.class);
suite.addTestSuite(TmfTimestampTest.class);
suite.addTestSuite(TmfTimeRangeTest.class);
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventContent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
import org.eclipse.linuxtools.tmf.core.event.TmfNoSuchFieldException;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
// ------------------------------------------------------------------------
private final TmfTimestamp fTimestamp;
- private final TmfEventSource fEventSource;
+ private final String fEventSource;
private final TmfEventType fEventType;
private final TmfEventTypeStub fEventTypeStub;
private final TmfEventReference fReference;
public TmfEventContentTest(String name) {
super(name);
fTimestamp = new TmfTimestamp();
- fEventSource = new TmfEventSource(new Object());
+ fEventSource = "";
fEventType = new TmfEventType();
fEventTypeStub = new TmfEventTypeStub();
fReference = new TmfEventReference();
import org.eclipse.linuxtools.tmf.core.event.TmfEventContent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventField;
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.stubs.event.TmfEventTypeStub;
public TmfEventFieldTest(String name) {
super(name);
TmfTimestamp fTimestamp = new TmfTimestamp();
- TmfEventSource fEventSource = new TmfEventSource();
+ String fEventSource = "";
TmfEventType fEventType = new TmfEventTypeStub();
TmfEventReference fReference = new TmfEventReference();
TmfEvent fEvent = new TmfEvent(fTimestamp, fEventSource, fEventType, fReference);
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2009 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
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.tests.event;
-
-import junit.framework.TestCase;
-
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
-
-/**
- * <b><u>TmfEventSourceTest</u></b>
- * <p>
- * Test suite for the TmfEventSource class.
- */
-@SuppressWarnings("nls")
-public class TmfEventSourceTest extends TestCase {
-
- // ------------------------------------------------------------------------
- // Variables
- // ------------------------------------------------------------------------
-
- private final Object source1 = new String("Some source");
- private final Object source2 = new String("Some other source");
-
- private final TmfEventSource fSource0 = new TmfEventSource(source1);
- private final TmfEventSource fSource1 = new TmfEventSource(source1);
- private final TmfEventSource fSource2 = new TmfEventSource(source1);
- private final TmfEventSource fSource3 = new TmfEventSource(source2);
-
- // ------------------------------------------------------------------------
- // Housekeeping
- // ------------------------------------------------------------------------
-
- /**
- * @param name the test name
- */
- public TmfEventSourceTest(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- // ------------------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------------------
-
- public void testTmfEventSourceDefault() {
- TmfEventSource source = new TmfEventSource();
- assertEquals("getSourceId", null, source.getSourceId());
- }
-
- public void testTmfEventSource() {
- TmfEventSource source = new TmfEventSource(source1);
- assertSame("getSourceId", source1, source.getSourceId());
- }
-
- public void testTmfEventSourceCopy() {
- TmfEventSource original = new TmfEventSource(source1);
- TmfEventSource source = new TmfEventSource(original);
- assertSame("getSourceId", source1, source.getSourceId());
- }
-
- public void testTmfEventSourceCopy2() {
- try {
- @SuppressWarnings("unused")
- TmfEventSource source = new TmfEventSource(null);
- fail("null copy");
- }
- catch (IllegalArgumentException e) {
- // Success
- }
- }
-
- // ------------------------------------------------------------------------
- // equals
- // ------------------------------------------------------------------------
-
- public void testEqualsReflexivity() throws Exception {
- assertTrue("equals", fSource0.equals(fSource0));
- assertTrue("equals", fSource3.equals(fSource3));
-
- assertTrue("equals", !fSource0.equals(fSource3));
- assertTrue("equals", !fSource3.equals(fSource0));
- }
-
- public void testEqualsSymmetry() throws Exception {
- assertTrue("equals", fSource0.equals(fSource2));
- assertTrue("equals", fSource2.equals(fSource0));
-
- assertTrue("equals", !fSource0.equals(fSource3));
- assertTrue("equals", !fSource3.equals(fSource0));
- }
-
- public void testEqualsTransivity() throws Exception {
- assertTrue("equals", fSource0.equals(fSource1));
- assertTrue("equals", fSource1.equals(fSource2));
- assertTrue("equals", fSource0.equals(fSource2));
- }
-
- public void testEqualsNull() throws Exception {
- assertTrue("equals", !fSource0.equals(null));
- assertTrue("equals", !fSource3.equals(null));
- }
-
- // ------------------------------------------------------------------------
- // hashCode
- // ------------------------------------------------------------------------
-
- public void testHashCode() throws Exception {
- assertTrue("hashCode", fSource0.hashCode() == fSource1.hashCode());
- assertTrue("hashCode", fSource0.hashCode() != fSource3.hashCode());
- }
-
- // ------------------------------------------------------------------------
- // toString
- // ------------------------------------------------------------------------
-
- public void testToString() {
- String expected1 = "[TmfEventSource(" + "null" + ")]";
- TmfEventSource nullSource = new TmfEventSource();
- assertEquals("toString", expected1, nullSource.toString());
-
- String expected2 = "[TmfEventSource(" + source1.toString() + ")]";
- TmfEventSource source = new TmfEventSource(source1);
- assertEquals("toString", expected2, source.toString());
- }
-
-}
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventContent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
private final TmfTimestamp fTimestamp1 = new TmfTimestamp(12345, (byte) 2, 5);
private final TmfTimestamp fTimestamp2 = new TmfTimestamp(12350, (byte) 2, 5);
- private final TmfEventSource fSource = new TmfEventSource("Source");
+ private final String fSource = "Source";
private final TmfEventType fType = new TmfEventType(fTypeId, fLabels);
private final TmfEventReference fReference = new TmfEventReference("Some reference");
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventContent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.uml2sd.TmfAsyncSequenceDiagramEvent;
private final TmfTimestamp fTimestamp1 = new TmfTimestamp(12345, (byte) 2, 5);
private final TmfTimestamp fTimestamp2 = new TmfTimestamp(12350, (byte) 2, 5);
- private final TmfEventSource fSource = new TmfEventSource("Source");
+ private final String fSource = "Source";
private final TmfEventType fType = new TmfEventType(fTypeId, fLabels);
private final TmfEventReference fReference = new TmfEventReference("Some reference");
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventContent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.uml2sd.TmfSyncSequenceDiagramEvent;
private final String[] fLabels = new String[] { fLabel0, fLabel1 };
private final TmfTimestamp fTimestamp1 = new TmfTimestamp(12345, (byte) 2, 5);
- private final TmfEventSource fSource = new TmfEventSource("Source");
+ private final String fSource = "Source";
private final TmfEventType fType = new TmfEventType(fTypeId, fLabels);
private final TmfEventReference fReference = new TmfEventReference("Some reference");
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventContent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.parser.ITmfEventParser;
TmfEvent event = new TmfEvent(
new TmfTimestamp(ts, (byte) -3, 0), // millisecs
- new TmfEventSource(source),
+ source,
fTypes[typeIndex],
new TmfEventReference(name));
TmfEventContent cnt = new TmfEventContent(event, content);
protected ITmfTrace<? extends TmfDataEvent> fTrace;
protected long fRank;
- protected TmfEventSource fSource;
+ protected String fSource;
protected TmfEventType fType;
protected TmfEventContent fContent;
protected TmfEventReference fReference;
* @param reference the event reference
*/
public TmfDataEvent(ITmfTrace<? extends TmfDataEvent> trace, long rank,
- TmfEventSource source, TmfEventType type, TmfEventContent content,
+ String source, TmfEventType type, TmfEventContent content,
TmfEventReference reference)
{
fTrace = trace;
return fRank;
}
+ /**
+ * @param source the event source
+ */
+ public void setSource(String source) {
+ fSource = source;
+ }
+
/**
* @return the event source
*/
- public TmfEventSource getSource() {
+ public String getSource() {
return fSource;
}
* @param type the event type
* @param reference the event reference
*/
- public TmfEvent(ITmfTrace<?> trace, long rank, TmfTimestamp timestamp, TmfEventSource source,
+ public TmfEvent(ITmfTrace<?> trace, long rank, TmfTimestamp timestamp, String source,
TmfEventType type, TmfEventReference reference) {
super(trace, rank, source, type, null, reference);
fTimestamp = timestamp;
/**
* Constructor - no rank
*/
- public TmfEvent(ITmfTrace<?> parentTrace, TmfTimestamp timestamp, TmfEventSource source,
+ public TmfEvent(ITmfTrace<?> parentTrace, TmfTimestamp timestamp, String source,
TmfEventType type, TmfEventReference reference) {
this(parentTrace, -1, timestamp, source, type, reference);
}
/**
* Constructor - no trace, no rank
*/
- public TmfEvent(TmfTimestamp timestamp, TmfEventSource source, TmfEventType type,
+ public TmfEvent(TmfTimestamp timestamp, String source, TmfEventType type,
TmfEventReference reference) {
this(null, -1, timestamp, source, type, reference);
}
} else if (id.equals(FIELD_ID_TIMESTAMP)) {
return new Long(fParentEvent.getTimestamp().getValue()).toString();
} else if (id.equals(FIELD_ID_SOURCE)) {
- return fParentEvent.getSource().getSourceId().toString();
+ return fParentEvent.getSource();
} else if (id.equals(FIELD_ID_TYPE)) {
return fParentEvent.getType().getTypeId().toString();
} else if (id.equals(FIELD_ID_REFERENCE)) {
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2009 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
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.event;
-
-/**
- * <b><u>TmfEventSource</u></b>
- * <p>
- * The event source.
- */
-public class TmfEventSource implements Cloneable {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
-
- protected Object fSourceId;
-
- // ------------------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------------------
-
- /**
- * The default constructor
- */
- public TmfEventSource() {
- fSourceId = null;
- }
-
- /**
- * @param sourceId
- */
- public TmfEventSource(Object sourceId) {
- fSourceId = sourceId;
- }
-
- /**
- * Copy constructor
- * @param other
- */
- public TmfEventSource(TmfEventSource other) {
- if (other == null)
- throw new IllegalArgumentException();
- TmfEventSource o = (TmfEventSource) other;
- fSourceId = o.fSourceId;
- }
-
- // ------------------------------------------------------------------------
- // Accessors
- // ------------------------------------------------------------------------
-
- /**
- * @return
- */
- public Object getSourceId() {
- return fSourceId;
- }
-
- // ------------------------------------------------------------------------
- // Object
- // ------------------------------------------------------------------------
-
- @Override
- public int hashCode() {
- return (fSourceId != null) ? fSourceId.hashCode() : 0;
- }
-
- @Override
- public boolean equals(Object other) {
- if (!(other instanceof TmfEventSource))
- return false;
- TmfEventSource o = (TmfEventSource) other;
- if (fSourceId == null) {
- return o.fSourceId == null;
- }
- return fSourceId.equals(o.fSourceId);
- }
-
- @Override
- @SuppressWarnings("nls")
- public String toString() {
- return "[TmfEventSource(" + ((fSourceId != null) ? fSourceId.toString() : "null") + ")]";
- }
-
- @Override
- public TmfEventSource clone() {
- TmfEventSource clone = null;
- try {
- clone = (TmfEventSource) super.clone();
- clone.fSourceId = fSourceId;
- }
- catch (CloneNotSupportedException e) {
- e.printStackTrace();
- }
- return clone;
- }
-}
* @param file
* @param line
*/
- public TmfTraceEvent(TmfTimestamp timestamp, TmfEventSource source, TmfEventType type,
+ public TmfTraceEvent(TmfTimestamp timestamp, String source, TmfEventType type,
TmfEventReference reference, String path, String file, int line)
{
super(timestamp, source, type, reference);
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventContent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.util.TmfFixedArray;
private final TmfTimestamp fTimestamp2 = new TmfTimestamp(12350, (byte) 2, 5);
private final TmfTimestamp fTimestamp3 = new TmfTimestamp(12355, (byte) 2, 5);
- private final TmfEventSource fSource = new TmfEventSource("Source");
+ private final String fSource = "Source";
private final TmfEventType fType1 = new TmfEventType(fTypeId1, fLabels);
private final TmfEventType fType2 = new TmfEventType(fTypeId1, fLabels);
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventContent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.util.TmfFixedArray;
import org.eclipse.linuxtools.tmf.ui.views.statistics.ITmfExtraEventInfo;
+import org.eclipse.linuxtools.tmf.ui.views.statistics.model.AbsTmfStatisticsTree;
import org.eclipse.linuxtools.tmf.ui.views.statistics.model.Messages;
import org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfBaseStatisticsTree;
-import org.eclipse.linuxtools.tmf.ui.views.statistics.model.AbsTmfStatisticsTree;
import org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfStatisticsTreeNode;
@SuppressWarnings("nls")
private final TmfTimestamp fTimestamp2 = new TmfTimestamp(12350, (byte) 2, 5);
private final TmfTimestamp fTimestamp3 = new TmfTimestamp(12355, (byte) 2, 5);
- private final TmfEventSource fSource = new TmfEventSource("Source");
+ private final String fSource = "Source";
private final TmfEventType fType1 = new TmfEventType(fTypeId1, fLabels);
private final TmfEventType fType2 = new TmfEventType(fTypeId1, fLabels);
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventContent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.util.TmfFixedArray;
import org.eclipse.linuxtools.tmf.ui.views.statistics.ITmfExtraEventInfo;
+import org.eclipse.linuxtools.tmf.ui.views.statistics.model.AbsTmfStatisticsTree;
import org.eclipse.linuxtools.tmf.ui.views.statistics.model.Messages;
import org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfBaseStatisticsTree;
-import org.eclipse.linuxtools.tmf.ui.views.statistics.model.AbsTmfStatisticsTree;
import org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfStatisticsTreeNode;
@SuppressWarnings("nls")
private final TmfTimestamp fTimestamp2 = new TmfTimestamp(12350, (byte) 2, 5);
private final TmfTimestamp fTimestamp3 = new TmfTimestamp(12355, (byte) 2, 5);
- private final TmfEventSource fSource = new TmfEventSource("Source");
+ private final String fSource = "Source";
private final TmfEventType fType1 = new TmfEventType(fTypeId1, fLabels);
private final TmfEventType fType2 = new TmfEventType(fTypeId1, fLabels);
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventContent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.util.TmfFixedArray;
import org.eclipse.linuxtools.tmf.ui.views.statistics.ITmfExtraEventInfo;
+import org.eclipse.linuxtools.tmf.ui.views.statistics.model.AbsTmfStatisticsTree;
import org.eclipse.linuxtools.tmf.ui.views.statistics.model.Messages;
import org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfBaseStatisticsTree;
-import org.eclipse.linuxtools.tmf.ui.views.statistics.model.AbsTmfStatisticsTree;
import org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfStatisticsTreeNode;
import org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfTreeContentProvider;
private final TmfTimestamp fTimestamp1 = new TmfTimestamp(12345, (byte) 2, 5);
private final TmfTimestamp fTimestamp2 = new TmfTimestamp(12350, (byte) 2, 5);
- private final TmfEventSource fSource = new TmfEventSource("Source");
+ private final String fSource = "Source";
private final TmfEventType fType1 = new TmfEventType(fTypeId1, fLabels);
private final TmfEventType fType2 = new TmfEventType(fTypeId2, fLabels);
import org.eclipse.linuxtools.tmf.core.event.TmfEventContent;
import org.eclipse.linuxtools.tmf.core.event.TmfEventField;
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.parser.ITmfEventParser;
String signal = stream.readUTF();
TmfEventReference tmfReference = new TmfEventReference(reference);
- TmfEventSource tmfSource = new TmfEventSource(source);
+ String tmfSource = source;
String[] labels = {"sender", "receiver", "signal"};
TmfEventType tmfEventType = new TmfEventType(type, labels);
\r
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;\r
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;\r
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;\r
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;\r
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;\r
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;\r
fData = new HashMap<String, String>();\r
}\r
\r
- public CustomEvent(CustomTraceDefinition definition, ITmfTrace<?> parentTrace, TmfTimestamp timestamp, TmfEventSource source, TmfEventType type, TmfEventReference reference) {\r
+ public CustomEvent(CustomTraceDefinition definition, ITmfTrace<?> parentTrace, TmfTimestamp timestamp, String source, TmfEventType type, TmfEventReference reference) {\r
super(parentTrace, timestamp, source, type, reference);\r
fDefinition = definition;\r
fData = new HashMap<String, String>();\r
\r
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;\r
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;\r
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;\r
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;\r
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;\r
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;\r
super(definition, other);\r
}\r
\r
- public CustomTxtEvent(CustomTxtTraceDefinition definition, ITmfTrace<?> parentTrace, TmfTimestamp timestamp, TmfEventSource source, TmfEventType type, TmfEventReference reference) {\r
+ public CustomTxtEvent(CustomTxtTraceDefinition definition, ITmfTrace<?> parentTrace, TmfTimestamp timestamp, String source, TmfEventType type, TmfEventReference reference) {\r
super(definition, parentTrace, timestamp, source, type, reference);\r
}\r
\r
\r
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;\r
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;\r
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;\r
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;\r
import org.eclipse.linuxtools.tmf.core.io.BufferedRandomAccessFile;\r
import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;\r
}\r
\r
public CustomTxtEvent parseFirstLine(CustomTxtTraceContext context) {\r
- CustomTxtEvent event = new CustomTxtEvent(fDefinition, this, TmfTimestamp.Zero, new TmfEventSource(""), fEventType, new TmfEventReference("")); //$NON-NLS-1$ //$NON-NLS-2$\r
+ CustomTxtEvent event = new CustomTxtEvent(fDefinition, this, TmfTimestamp.Zero, "", fEventType, new TmfEventReference("")); //$NON-NLS-1$ //$NON-NLS-2$\r
event.processGroups(context.inputLine, context.firstLineMatcher);\r
event.setContent(new CustomEventContent(event, new StringBuffer(context.firstLine)));\r
return event;\r
\r
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;\r
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;\r
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;\r
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;\r
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;\r
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;\r
super(definition, other);\r
}\r
\r
- public CustomXmlEvent(CustomXmlTraceDefinition definition, ITmfTrace<?> parentTrace, TmfTimestamp timestamp, TmfEventSource source, TmfEventType type, TmfEventReference reference) {\r
+ public CustomXmlEvent(CustomXmlTraceDefinition definition, ITmfTrace<?> parentTrace, TmfTimestamp timestamp, String source, TmfEventType type, TmfEventReference reference) {\r
super(definition, parentTrace, timestamp, source, type, reference);\r
}\r
\r
\r
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;\r
import org.eclipse.linuxtools.tmf.core.event.TmfEventReference;\r
-import org.eclipse.linuxtools.tmf.core.event.TmfEventSource;\r
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;\r
import org.eclipse.linuxtools.tmf.core.io.BufferedRandomAccessFile;\r
import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;\r
}\r
\r
public CustomXmlEvent extractEvent(Element element, InputElement inputElement) {\r
- CustomXmlEvent event = new CustomXmlEvent(fDefinition, this, TmfTimestamp.Zero, new TmfEventSource(""), fEventType, new TmfEventReference("")); //$NON-NLS-1$ //$NON-NLS-2$\r
+ CustomXmlEvent event = new CustomXmlEvent(fDefinition, this, TmfTimestamp.Zero, "", fEventType, new TmfEventReference("")); //$NON-NLS-1$ //$NON-NLS-2$\r
event.setContent(new CustomEventContent(event, new StringBuffer()));\r
parseElement(element, event, inputElement);\r
return event;\r
String[] fields = new String[0];\r
if (event != null) {\r
fields = new String[] { new Long(event.getTimestamp().getValue()).toString(),\r
- event.getSource().getSourceId().toString(), event.getType().getTypeId().toString(),\r
+ event.getSource(), event.getType().getTypeId().toString(),\r
event.getReference().getReference().toString(), event.getContent().toString() };\r
}\r
return fields;\r