package org.eclipse.linuxtools.tmf.ui.views.timegraph;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@TmfSignalHandler
public void traceClosed(final TmfTraceClosedSignal signal) {
synchronized (fBuildThreadMap) {
- for (ITmfTrace trace : TmfTraceManager.getTraceSet(signal.getTrace())) {
+ for (ITmfTrace trace : getTracesToBuild(signal.getTrace())) {
BuildThread buildThread = fBuildThreadMap.remove(trace);
if (buildThread != null) {
buildThread.cancel();
setStartTime(Long.MAX_VALUE);
setEndTime(Long.MIN_VALUE);
synchronized (fBuildThreadMap) {
- for (ITmfTrace trace : TmfTraceManager.getTraceSet(fTrace)) {
+ for (ITmfTrace trace : getTracesToBuild(fTrace)) {
BuildThread buildThread = new BuildThread(trace, fTrace, getName());
fBuildThreadMap.put(trace, buildThread);
buildThread.start();
}
+ /**
+ * Return the list of traces whose data or analysis results will be used to
+ * populate the view. By default, if the trace is an experiment, the traces
+ * under it will be returned, otherwise, the trace itself is returned.
+ *
+ * A build thread will be started for each trace returned by this method,
+ * some of which may receive events in live streaming mode.
+ *
+ * @param trace
+ * The trace associated with this view
+ * @return List of traces with data to display
+ * @since 3.0
+ */
+ protected Iterable<ITmfTrace> getTracesToBuild(ITmfTrace trace) {
+ return Arrays.asList(TmfTraceManager.getTraceSet(trace));
+ }
+
/**
* Build the entries list to show in this time graph
*