From: Matthew Khouzam Date: Mon, 16 May 2016 23:11:49 +0000 (-0400) Subject: linux.ui: make CPU usage view support experiments with kernels. X-Git-Url: http://git.efficios.com/?p=deliverable%2Ftracecompass.git;a=commitdiff_plain;h=fee88beb07164451b5a5bbda206bff62820307c9 linux.ui: make CPU usage view support experiments with kernels. Time queries now clamped to the range of the state system. Change-Id: Ifa4750bbfe57d5e2df34cc418553644d3891c377 Signed-off-by: Matthew Khouzam Reviewed-on: https://git.eclipse.org/r/72855 Reviewed-by: Hudson CI Reviewed-by: Marc-Andre Laperle Tested-by: Marc-Andre Laperle --- diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/cpuusage/CpuUsageComposite.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/cpuusage/CpuUsageComposite.java index 358f6a78d7..bfe5a15094 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/cpuusage/CpuUsageComposite.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/cpuusage/CpuUsageComposite.java @@ -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 */ diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/cpuusage/CpuUsageXYViewer.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/cpuusage/CpuUsageXYViewer.java index be5c552596..cb029858e5 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/cpuusage/CpuUsageXYViewer.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/cpuusage/CpuUsageXYViewer.java @@ -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;