From 0039d5e8f603f10e079fe379f6767543a9e96786 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Genevi=C3=A8ve=20Bastien?= Date: Tue, 24 May 2016 13:37:51 -0400 Subject: [PATCH] critical path: bug 490085 Always start critical path from head vertex MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Previously, the critical path was calculated starting at the start of the window range, but that behavior was not intuitive to the user and it was not possible to change that window range once it is calculated. Now the critical path is calculated for the whole of the worker's lifetime. Change-Id: Id76192eec04dff6d3c45c1bd1314248d4ea991fb Signed-off-by: Geneviève Bastien Reviewed-on: https://git.eclipse.org/r/73515 Reviewed-by: Hudson CI Reviewed-by: Matthew Khouzam --- .../core/criticalpath/CriticalPathModule.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/criticalpath/CriticalPathModule.java b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/criticalpath/CriticalPathModule.java index 30e9289afd..481d37cdb8 100644 --- a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/criticalpath/CriticalPathModule.java +++ b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/criticalpath/CriticalPathModule.java @@ -24,9 +24,7 @@ import org.eclipse.tracecompass.internal.analysis.graph.core.criticalpath.Messag import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule; import org.eclipse.tracecompass.tmf.core.analysis.TmfAbstractAnalysisModule; import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException; -import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange; import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; -import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager; import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils; /** @@ -95,19 +93,10 @@ public class CriticalPathModule extends TmfAbstractAnalysisModule { fCriticalPath = new TmfGraph(); return true; } - TmfTimeRange tr = TmfTraceManager.getInstance().getCurrentTraceContext().getWindowRange(); - TmfVertex start = graph.getVertexAt(tr.getStartTime(), worker); - if (start == null) { - /* - * Nothing happens with this worker after start, return an empty - * graph - */ - fCriticalPath = new TmfGraph(); - return true; - } + ICriticalPathAlgorithm cp = getAlgorithm(graph); try { - fCriticalPath = cp.compute(start, null); + fCriticalPath = cp.compute(head, null); return true; } catch (CriticalPathAlgorithmException e) { Activator.getInstance().logError(NonNullUtils.nullToEmptyString(e.getMessage()), e); -- 2.34.1