linux.ui: make CPU usage view support experiments with kernels.
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Mon, 16 May 2016 23:11:49 +0000 (19:11 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Fri, 27 May 2016 00:44:13 +0000 (20:44 -0400)
Time queries now clamped to the range of the state system.

Change-Id: Ifa4750bbfe57d5e2df34cc418553644d3891c377
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/72855
Reviewed-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/cpuusage/CpuUsageComposite.java
analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/cpuusage/CpuUsageXYViewer.java

index 358f6a78d7a756fdb5cef6969efdd16d67312664..bfe5a15094accff9cff5890a0b700513a21307b6 100644 (file)
@@ -35,6 +35,7 @@ import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
 import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
 import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
 import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
 import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
 import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
 import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
@@ -227,7 +228,7 @@ public class CpuUsageComposite extends AbstractTmfTreeViewer {
         }
 
         boolean complete = false;
-        long currentEnd = start;
+        long currentEnd = Math.max(start, ss.getStartTime());
 
         while (!complete && currentEnd < end) {
             complete = ss.waitUntilBuilt(BUILD_UPDATE_TIMEOUT);
@@ -293,7 +294,7 @@ public class CpuUsageComposite extends AbstractTmfTreeViewer {
                     try {
                         execNameQuark = kernelSs.getQuarkRelative(tidQuark, Attributes.EXEC_NAME);
                         execNameIntervals = StateSystemUtils.queryHistoryRange(kernelSs, execNameQuark, getStartTime(), getEndTime());
-                    } catch (AttributeNotFoundException e) {
+                    } catch (TimeRangeException | AttributeNotFoundException e) {
                         /*
                          * No information on this thread (yet?), skip it for now
                          */
index be5c552596870ecae9c8cb0b9d67aeec45d0623a..cb029858e5fbb3849937032591c0f2c7f72f711b 100644 (file)
@@ -107,7 +107,7 @@ public class CpuUsageXYViewer extends TmfCommonXLineChartViewer {
             setXAxis(xvalues);
 
             boolean complete = false;
-            long currentEnd = start;
+            long currentEnd = Math.max(ss.getStartTime(), start);
 
             while (!complete && currentEnd < end) {
 
@@ -115,7 +115,7 @@ public class CpuUsageXYViewer extends TmfCommonXLineChartViewer {
                     return;
                 }
 
-                long traceStart = getStartTime();
+                long traceStart = Math.max(getStartTime(), ss.getStartTime());
                 long traceEnd = getEndTime();
                 long offset = getTimeOffset();
                 long selectedThread = fSelectedThread;
This page took 0.026165 seconds and 5 git commands to generate.