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