\r
import java.util.ArrayList;\r
import java.util.Arrays;\r
+import java.util.Collections;\r
import java.util.Comparator;\r
import java.util.List;\r
\r
ControlFlowEntry entry1 = (ControlFlowEntry) o1;\r
ControlFlowEntry entry2 = (ControlFlowEntry) o2;\r
result = entry1.getTrace().getStartTime().compareTo(entry2.getTrace().getStartTime());\r
+ if (result == 0) {\r
+ result = entry1.getTrace().getName().compareTo(entry2.getTrace().getName());\r
+ }\r
if (result == 0) {\r
result = entry1.getThreadId() < entry2.getThreadId() ? -1 : entry1.getThreadId() > entry2.getThreadId() ? 1 : 0;\r
}\r
fStartTime = Long.MAX_VALUE;\r
fEndTime = Long.MIN_VALUE;\r
fSelectedExperiment = (TmfExperiment<ITmfEvent>) experiment;\r
- ArrayList<ControlFlowEntry> entryList = new ArrayList<ControlFlowEntry>();\r
+ ArrayList<ControlFlowEntry> rootList = new ArrayList<ControlFlowEntry>();\r
for (ITmfTrace<?> trace : experiment.getTraces()) {\r
if (trace instanceof CtfKernelTrace) {\r
+ ArrayList<ControlFlowEntry> entryList = new ArrayList<ControlFlowEntry>();\r
CtfKernelTrace ctfKernelTrace = (CtfKernelTrace) trace;\r
IStateSystemQuerier ssq = ctfKernelTrace.getStateSystem();\r
long start = ssq.getStartTime();\r
e.printStackTrace();\r
}\r
}\r
+ buildTree(entryList, rootList);\r
}\r
- buildTree(entryList);\r
+ Collections.sort(rootList, fControlFlowEntryComparator);\r
+ fEntryList = rootList;\r
refresh(INITIAL_WINDOW_OFFSET);\r
- ControlFlowEntry[] entries = fEntryList.toArray(new ControlFlowEntry[0]);\r
- Arrays.sort(entries, fControlFlowEntryComparator);\r
- for (ControlFlowEntry entry : entries) {\r
- buildStatusEvents(entry);\r
- }\r
+ }\r
+ for (ControlFlowEntry entry : rootList) {\r
+ buildStatusEvents(entry);\r
}\r
}\r
\r
- private void buildTree(ArrayList<ControlFlowEntry> entryList) {\r
- ArrayList<ControlFlowEntry> rootList = new ArrayList<ControlFlowEntry>();\r
+ private void buildTree(ArrayList<ControlFlowEntry> entryList, ArrayList<ControlFlowEntry> rootList) {\r
for (ControlFlowEntry entry : entryList) {\r
boolean root = true;\r
if (entry.getParentThreadId() > 0) {\r
rootList.add(entry);\r
}\r
}\r
- fEntryList = rootList;\r
}\r
\r
private void buildStatusEvents(ControlFlowEntry entry) {\r