TMF: Check if state system is available before scheduling analysis
authorGeneviève Bastien <gbastien+lttng@versatic.net>
Mon, 15 Dec 2014 16:18:43 +0000 (11:18 -0500)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Wed, 11 Mar 2015 17:06:00 +0000 (13:06 -0400)
Adding tracing capabilities to analyses shows that an analysis is scheduled
a LOT of times just to get the state system. We should check the state system
is not null before scheduling.

Change-Id: Ic5b159566b0b84211e1b9506f4d0ecfa08df0dc6
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/38271
Reviewed-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/TmfStateSystemAnalysisModule.java

index c9981a64ba72581866399de934fc5ec14bec21cb..d89a90af29fec18d4c9d6681120c206dde793dd0 100644 (file)
@@ -108,6 +108,10 @@ public abstract class TmfStateSystemAnalysisModule extends TmfAbstractAnalysisMo
         TmfStateSystemAnalysisModule module =
                 TmfTraceUtils.getAnalysisModuleOfClass(trace, TmfStateSystemAnalysisModule.class, moduleId);
         if (module != null) {
+            ITmfStateSystem ss = module.getStateSystem();
+            if (ss != null) {
+                return ss;
+            }
             IStatus status = module.schedule();
             if (status.isOK()) {
                 module.waitForInitialization();
This page took 0.026393 seconds and 5 git commands to generate.