aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFran├žois Rajotte2014-04-25 17:56:22 (EDT)
committerGenevieve Bastien2014-04-30 10:07:47 (EDT)
commitcdba39011f87d0672850f1ddbe9cce4206bebc84 (patch)
treedf51ffcb83311d8f67eb760bb38f952935e8e5c2
parent7fcbeb21d47b1f064066609991d6dd73386da527 (diff)
downloadorg.eclipse.linuxtools-cdba39011f87d0672850f1ddbe9cce4206bebc84.zip
org.eclipse.linuxtools-cdba39011f87d0672850f1ddbe9cce4206bebc84.tar.gz
org.eclipse.linuxtools-cdba39011f87d0672850f1ddbe9cce4206bebc84.tar.bz2
TMF: speed up XML view entry start and end time queriesrefs/changes/98/25598/3
Change-Id: I6ad6a2484cd569fe0d1ce8a6f7449aba924f4578 Signed-off-by: Fran├žois Rajotte <francois.rajotte@polymtl.ca> Signed-off-by: Florian Wininger <florian.wininger@polymtl.ca> Reviewed-on: https://git.eclipse.org/r/25598 Tested-by: Hudson CI Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net> Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/views/timegraph/XmlTimeGraphView.java30
1 files changed, 21 insertions, 9 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/views/timegraph/XmlTimeGraphView.java b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/views/timegraph/XmlTimeGraphView.java
index 067a4db..185d752 100644
--- a/lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/views/timegraph/XmlTimeGraphView.java
+++ b/lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/views/timegraph/XmlTimeGraphView.java
@@ -432,20 +432,32 @@ public class XmlTimeGraphView extends AbstractTimeGraphView {
long entryStart = ss.getStartTime();
long entryEnd = ss.getCurrentEndTime();
+
try {
- boolean first = true;
- List<ITmfStateInterval> execNameIntervals = ss.queryHistoryRange(displayQuark, ss.getStartTime(), ss.getCurrentEndTime());
- for (ITmfStateInterval execNameInterval : execNameIntervals) {
+ ITmfStateInterval oneInterval = ss.querySingleState(entryStart, displayQuark);
- if (!execNameInterval.getStateValue().isNull()) {
- if (first) {
- entryStart = execNameInterval.getStartTime();
- first = false;
- }
- entryEnd = execNameInterval.getEndTime();
+ /* The entry start is the first non-null interval */
+ while (oneInterval.getStateValue().isNull()) {
+ long ts = oneInterval.getEndTime() + 1;
+ if (ts > ss.getCurrentEndTime()) {
+ break;
}
+ oneInterval = ss.querySingleState(ts, displayQuark);
}
+ entryStart = oneInterval.getStartTime();
+
+ /* The entry end is the last non-null interval */
+ oneInterval = ss.querySingleState(entryEnd, displayQuark);
+ while (oneInterval.getStateValue().isNull()) {
+ long ts = oneInterval.getStartTime() - 1;
+ if (ts < ss.getStartTime()) {
+ break;
+ }
+ oneInterval = ss.querySingleState(ts, displayQuark);
+ }
+ entryEnd = oneInterval.getEndTime();
+
} catch (AttributeNotFoundException | StateSystemDisposedException e) {
}