Search in sources :

Example 11 with TmfStateInterval

use of org.eclipse.tracecompass.statesystem.core.interval.TmfStateInterval in project tracecompass by tracecompass.

the class ThreadStatusDataProvider method createTimeGraphState.

@NonNull
private static ITimeGraphState createTimeGraphState(ITmfStateInterval interval, NavigableSet<ITmfStateInterval> syscalls) {
    long startTime = interval.getStartTime();
    long duration = interval.getEndTime() - startTime + 1;
    Object status = interval.getValue();
    if (status instanceof Integer) {
        int s = (int) status;
        if (s == StateValues.PROCESS_STATUS_RUN_SYSCALL) {
            // intervals are sorted by start time
            ITmfStateInterval syscall = syscalls.floor(new TmfStateInterval(startTime, startTime + 1, 0, 0));
            if (syscall != null) {
                Object value = syscall.getValue();
                if (value instanceof String) {
                    return new TimeGraphState(startTime, duration, String.valueOf(value), getElementStyle(s));
                }
            }
        }
        return new TimeGraphState(startTime, duration, null, getElementStyle(s));
    }
    return new TimeGraphState(startTime, duration, Integer.MIN_VALUE);
}
Also used : TmfStateInterval(org.eclipse.tracecompass.statesystem.core.interval.TmfStateInterval) ITmfStateInterval(org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval) ITimeGraphState(org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphState) TimeGraphState(org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphState) ITmfStateInterval(org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval) NonNull(org.eclipse.jdt.annotation.NonNull)

Aggregations

ITmfStateInterval (org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval)11 TmfStateInterval (org.eclipse.tracecompass.statesystem.core.interval.TmfStateInterval)11 Test (org.junit.Test)5 TimeRangeException (org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException)4 ArrayList (java.util.ArrayList)3 IStateHistoryBackend (org.eclipse.tracecompass.statesystem.core.backend.IStateHistoryBackend)2 StateSystemDisposedException (org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException)2 ITmfStateValue (org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue)2 JsonElement (com.google.gson.JsonElement)1 JsonObject (com.google.gson.JsonObject)1 IOException (java.io.IOException)1 ByteBuffer (java.nio.ByteBuffer)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 NonNull (org.eclipse.jdt.annotation.NonNull)1 Nullable (org.eclipse.jdt.annotation.Nullable)1 KernelAnalysisModule (org.eclipse.tracecompass.analysis.os.linux.core.kernel.KernelAnalysisModule)1 ProcessStatus (org.eclipse.tracecompass.analysis.os.linux.core.model.ProcessStatus)1 ISafeByteBufferReader (org.eclipse.tracecompass.datastore.core.serialization.ISafeByteBufferReader)1 ITmfStateSystem (org.eclipse.tracecompass.statesystem.core.ITmfStateSystem)1