import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes;
import org.eclipse.linuxtools.internal.lttng2.kernel.ui.Messages;
import org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.resources.ResourcesEntry.Type;
-import org.eclipse.linuxtools.lttng2.kernel.ui.analysis.LttngKernelAnalysisModule;
-import org.eclipse.linuxtools.tmf.core.exceptions.AttributeNotFoundException;
-import org.eclipse.linuxtools.tmf.core.exceptions.StateSystemDisposedException;
-import org.eclipse.linuxtools.tmf.core.exceptions.StateValueTypeException;
-import org.eclipse.linuxtools.tmf.core.exceptions.TimeRangeException;
-import org.eclipse.linuxtools.tmf.core.interval.ITmfStateInterval;
-import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem;
+import org.eclipse.linuxtools.lttng2.kernel.core.analysis.LttngKernelAnalysisModule;
+import org.eclipse.linuxtools.statesystem.core.ITmfStateSystem;
+import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.linuxtools.statesystem.core.exceptions.StateSystemDisposedException;
+import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException;
+import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException;
+import org.eclipse.linuxtools.statesystem.core.interval.ITmfStateInterval;
+import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
import org.eclipse.linuxtools.tmf.ui.views.timegraph.AbstractTimeGraphView;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;
+import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.NullTimeEvent;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeEvent;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
@Override
protected void buildEventList(ITmfTrace trace, ITmfTrace parentTrace, IProgressMonitor monitor) {
- LttngKernelAnalysisModule module = trace.getAnalysisModuleOfClass(LttngKernelAnalysisModule.class, LttngKernelAnalysisModule.ID);
- if (module == null) {
+ if (trace == null) {
return;
}
- module.schedule();
- module.waitForInitialization();
- ITmfStateSystem ssq = module.getStateSystem();
+ ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysisModule.ID);
if (ssq == null) {
return;
}
refresh();
}
long resolution = Math.max(1, (endTime - ssq.getStartTime()) / getDisplayWidth());
- for (TimeGraphEntry entry : traceEntry.getChildren()) {
+ for (ITimeGraphEntry child : traceEntry.getChildren()) {
if (monitor.isCanceled()) {
return;
}
- List<ITimeEvent> eventList = getEventList(entry, start, endTime, resolution, monitor);
- if (eventList != null) {
- for (ITimeEvent event : eventList) {
- entry.addEvent(event);
+ if (child instanceof TimeGraphEntry) {
+ TimeGraphEntry entry = (TimeGraphEntry) child;
+ List<ITimeEvent> eventList = getEventList(entry, start, endTime, resolution, monitor);
+ if (eventList != null) {
+ for (ITimeEvent event : eventList) {
+ entry.addEvent(event);
+ }
}
+ redraw();
}
- redraw();
}
start = end;
}
@Override
- protected List<ITimeEvent> getEventList(TimeGraphEntry entry,
+ protected @Nullable List<ITimeEvent> getEventList(TimeGraphEntry entry,
long startTime, long endTime, long resolution,
IProgressMonitor monitor) {
ResourcesEntry resourcesEntry = (ResourcesEntry) entry;
- LttngKernelAnalysisModule module = resourcesEntry.getTrace().getAnalysisModuleOfClass(LttngKernelAnalysisModule.class, LttngKernelAnalysisModule.ID);
- if (module == null) {
- return null;
- }
- ITmfStateSystem ssq = module.getStateSystem();
+ ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(resourcesEntry.getTrace(), LttngKernelAnalysisModule.ID);
if (ssq == null) {
return null;
}