Search in sources :

Example 1 with ITmfEventField

use of org.eclipse.tracecompass.tmf.core.event.ITmfEventField in project tracecompass by tracecompass.

the class CtfTmfEventTest method testGetFieldValue.

/**
 * Run the Object getFieldValue(String) method test.
 */
@Test
public void testGetFieldValue() {
    ITmfEventField result = fixture.getContent().getField(VALID_FIELD);
    assertNotNull(result);
    assertNotNull(result.getValue());
}
Also used : ITmfEventField(org.eclipse.tracecompass.tmf.core.event.ITmfEventField) Test(org.junit.Test)

Example 2 with ITmfEventField

use of org.eclipse.tracecompass.tmf.core.event.ITmfEventField in project tracecompass by tracecompass.

the class CtfTmfEventTypeTest method testToString.

/**
 * Run the String toString() method test.
 */
@Test
public void testToString() {
    ITmfEventField emptyField = new TmfEventField("", null, new ITmfEventField[] {});
    CtfTmfEventType fixture = new CtfTmfEventType("", emptyField);
    String result = fixture.toString();
    assertEquals("", result);
}
Also used : ITmfEventField(org.eclipse.tracecompass.tmf.core.event.ITmfEventField) CtfTmfEventType(org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEventType) ITmfEventField(org.eclipse.tracecompass.tmf.core.event.ITmfEventField) TmfEventField(org.eclipse.tracecompass.tmf.core.event.TmfEventField) Test(org.junit.Test)

Example 3 with ITmfEventField

use of org.eclipse.tracecompass.tmf.core.event.ITmfEventField in project tracecompass by tracecompass.

the class TraceEventHandlerExecutionGraph method handleSchedSwitch.

private void handleSchedSwitch(ITmfEvent event) {
    String host = event.getTrace().getHostId();
    long ts = event.getTimestamp().getValue();
    IKernelAnalysisEventLayout eventLayout = getProvider().getEventLayout(event.getTrace());
    OsSystemModel system = getProvider().getSystem();
    ITmfEventField content = event.getContent();
    Integer next = content.getFieldValue(Integer.class, eventLayout.fieldNextTid());
    Integer prev = content.getFieldValue(Integer.class, eventLayout.fieldPrevTid());
    if (next == null || prev == null) {
        return;
    }
    OsWorker nextTask = system.findWorker(new HostThread(host, next));
    OsWorker prevTask = system.findWorker(new HostThread(host, prev));
    if (prevTask == null || nextTask == null) {
        return;
    }
    stateChange(prevTask, ts);
    stateChange(nextTask, ts);
}
Also used : HostThread(org.eclipse.tracecompass.analysis.os.linux.core.model.HostThread) OsWorker(org.eclipse.tracecompass.analysis.os.linux.core.execution.graph.OsWorker) OsSystemModel(org.eclipse.tracecompass.analysis.os.linux.core.execution.graph.OsSystemModel) ITmfEventField(org.eclipse.tracecompass.tmf.core.event.ITmfEventField) IKernelAnalysisEventLayout(org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout)

Example 4 with ITmfEventField

use of org.eclipse.tracecompass.tmf.core.event.ITmfEventField in project tracecompass by tracecompass.

the class TraceEventHandlerSched method handleSchedProcessFork.

private void handleSchedProcessFork(ITmfEvent event) {
    String host = event.getTrace().getHostId();
    IKernelAnalysisEventLayout eventLayout = getProvider().getEventLayout(event.getTrace());
    OsSystemModel system = getProvider().getSystem();
    ITmfEventField content = event.getContent();
    Integer childTid = content.getFieldValue(Integer.class, eventLayout.fieldChildTid());
    String name = content.getFieldValue(String.class, eventLayout.fieldChildComm());
    if (childTid == null) {
        return;
    }
    name = (name == null ? String.valueOf(childTid) : name);
    long ts = event.getTimestamp().getValue();
    HostThread childHt = new HostThread(host, childTid);
    OsWorker childTask = system.findWorker(childHt);
    if (childTask == null) {
        childTask = new OsWorker(childHt, name, ts);
        system.addWorker(childTask);
    }
    childTask.setStatus(ProcessStatus.WAIT_FORK);
}
Also used : HostThread(org.eclipse.tracecompass.analysis.os.linux.core.model.HostThread) OsWorker(org.eclipse.tracecompass.analysis.os.linux.core.execution.graph.OsWorker) OsSystemModel(org.eclipse.tracecompass.analysis.os.linux.core.execution.graph.OsSystemModel) ITmfEventField(org.eclipse.tracecompass.tmf.core.event.ITmfEventField) IKernelAnalysisEventLayout(org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout)

Example 5 with ITmfEventField

use of org.eclipse.tracecompass.tmf.core.event.ITmfEventField in project tracecompass by tracecompass.

the class TcpEventMatching method getEventKey.

@Override
public IEventMatchingKey getEventKey(ITmfEvent event) {
    ITmfEventField content = event.getContent();
    Long sequence = content.getFieldValue(Long.class, TcpEventStrings.SEQ);
    Long ack = content.getFieldValue(Long.class, TcpEventStrings.ACKSEQ);
    Long flags = content.getFieldValue(Long.class, TcpEventStrings.FLAGS);
    if (sequence == null || ack == null || flags == null) {
        // $NON-NLS-1$
        throw new IllegalArgumentException("Event does not have expected fields");
    }
    IEventMatchingKey key = new TcpEventKey(sequence, ack, flags);
    return key;
}
Also used : ITmfEventField(org.eclipse.tracecompass.tmf.core.event.ITmfEventField) IEventMatchingKey(org.eclipse.tracecompass.tmf.core.event.matching.IEventMatchingKey) TcpEventKey(org.eclipse.tracecompass.tmf.core.event.matching.TcpEventKey)

Aggregations

ITmfEventField (org.eclipse.tracecompass.tmf.core.event.ITmfEventField)68 Nullable (org.eclipse.jdt.annotation.Nullable)19 TmfEventField (org.eclipse.tracecompass.tmf.core.event.TmfEventField)14 Test (org.junit.Test)12 CtfTmfEvent (org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent)8 DiskWriteModel (org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.DiskWriteModel)6 OsWorker (org.eclipse.tracecompass.analysis.os.linux.core.execution.graph.OsWorker)5 Request (org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.Request)5 OsSystemModel (org.eclipse.tracecompass.analysis.os.linux.core.execution.graph.OsSystemModel)4 HostThread (org.eclipse.tracecompass.analysis.os.linux.core.model.HostThread)4 ICompositeDefinition (org.eclipse.tracecompass.ctf.core.event.types.ICompositeDefinition)4 IoOperationType (org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.IoOperationType)4 ITmfEvent (org.eclipse.tracecompass.tmf.core.event.ITmfEvent)4 TmfEventType (org.eclipse.tracecompass.tmf.core.event.TmfEventType)4 ArrayList (java.util.ArrayList)3 NonNull (org.eclipse.jdt.annotation.NonNull)3 IKernelAnalysisEventLayout (org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout)3 BlockIO (org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.BlockIO)3 Packet (org.eclipse.tracecompass.internal.pcap.core.packet.Packet)3 ITmfStateValue (org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue)3