From: Alexandre Montplaisir Date: Tue, 15 May 2012 14:43:15 +0000 (-0400) Subject: tmf: Also pick the interval at the end time of range queries X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=6db459836f8788ba4c72c9d1cbd04366af58b299;p=deliverable%2Ftracecompass.git tmf: Also pick the interval at the end time of range queries When doing a range query with resolution, include the end time of the range (t2) as the last "resolution point". This means that the interval crossing t2 will be returned no matter what, which is consistent with range queries with no resolution. Signed-off-by: Alexandre Montplaisir --- diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/StateHistorySystem.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/StateHistorySystem.java index 53748351b4..9fc11e715d 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/StateHistorySystem.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/StateHistorySystem.java @@ -249,6 +249,13 @@ public class StateHistorySystem extends StateSystem implements intervals.add(currentInterval); } + + /* Add the interval at t2, if it wasn't included already. */ + if (currentInterval.getEndTime() < t2 && + t2 <= this.getCurrentEndTime()) { + currentInterval = querySingleState(t2, attributeQuark); + intervals.add(currentInterval); + } return intervals; }