X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=statesystem%2Forg.eclipse.tracecompass.statesystem.core%2Fsrc%2Forg%2Feclipse%2Ftracecompass%2Finternal%2Fstatesystem%2Fcore%2Fbackend%2Fhistorytree%2FHistoryTree.java;h=af0b7f6981a38b877616f4680c45afb953e15f8d;hb=dbf883bb5dc68619836a9b9318239e8bcd96e6e1;hp=33d33d120e144ed5e02e5ba9e826c7d2cdedb084;hpb=30cdc5e5458f2e986dd00e7ec38b908a6c707e55;p=deliverable%2Ftracecompass.git diff --git a/statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/backend/historytree/HistoryTree.java b/statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/backend/historytree/HistoryTree.java index 33d33d120e..af0b7f6981 100644 --- a/statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/backend/historytree/HistoryTree.java +++ b/statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/backend/historytree/HistoryTree.java @@ -795,10 +795,13 @@ public class HistoryTree { /* Only used for debugging, shouldn't be externalized */ @SuppressWarnings("nls") private void preOrderPrint(PrintWriter writer, boolean printIntervals, - HTNode currentNode, int curDepth) { + HTNode currentNode, int curDepth, long ts) { writer.println(currentNode.toString()); - if (printIntervals) { + /* Print intervals only if timestamp is negative or within the range of the node */ + if (printIntervals && + (ts <= 0 || + (ts >= currentNode.getNodeStart() && ts <= currentNode.getNodeEnd()))) { currentNode.debugPrintIntervals(writer); } @@ -814,7 +817,7 @@ public class HistoryTree { int extension = node.getExtensionSequenceNumber(); while (extension != -1) { HTNode nextNode = fTreeIO.readNode(extension); - preOrderPrint(writer, printIntervals, nextNode, curDepth); + preOrderPrint(writer, printIntervals, nextNode, curDepth, ts); } /* Print the child nodes */ @@ -824,7 +827,7 @@ public class HistoryTree { writer.print(" "); } writer.print("+-"); - preOrderPrint(writer, printIntervals, nextNode, curDepth + 1); + preOrderPrint(writer, printIntervals, nextNode, curDepth + 1, ts); } } catch (ClosedChannelException e) { Activator.getDefault().logError(e.getMessage()); @@ -843,15 +846,18 @@ public class HistoryTree { * PrintWriter in which to write the output * @param printIntervals * Flag to enable full output of the interval information + * @param ts + * The timestamp that nodes have to intersect for intervals to be + * printed. A negative value will print intervals for all nodes. + * The timestamp only applies if printIntervals is true. */ - public void debugPrintFullTree(PrintWriter writer, boolean printIntervals) { + public void debugPrintFullTree(PrintWriter writer, boolean printIntervals, long ts) { /* Only used for debugging, shouldn't be externalized */ - preOrderPrint(writer, false, fLatestBranch.get(0), 0); + preOrderPrint(writer, false, fLatestBranch.get(0), 0, ts); if (printIntervals) { - writer.println("\nDetails of intervals:"); //$NON-NLS-1$ - preOrderPrint(writer, true, fLatestBranch.get(0), 0); + preOrderPrint(writer, true, fLatestBranch.get(0), 0, ts); } writer.println('\n'); }