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());
}
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);
}
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);
}
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);
}
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;
}
Aggregations