use of org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule in project tracecompass by tracecompass.
the class TmfStateSystemExplorer method handleAnalysisStarted.
/**
* Rebuild the view's entry tree to ensure that entries from a newly started
* trace are added.
*
* @param signal
* analysis started signal.
* @since 3.3
*/
@TmfSignalHandler
public void handleAnalysisStarted(TmfStartAnalysisSignal signal) {
IAnalysisModule module = signal.getAnalysisModule();
if (module instanceof ITmfAnalysisModuleWithStateSystems && !module.isAutomatic()) {
/*
* use set to wait for initialization in build entry list to avoid
* deadlocks.
*/
final ITmfTrace viewTrace = getTrace();
if (Iterables.contains(allModules(viewTrace), module)) {
/*
* Rebuild only if the started analysis module is from the
* active trace/experiment.
*/
new Thread(() -> {
/*
* DataProviderManager#getDataProvider() (see getDataProvider() below) should never be called in a signal handler.
*/
synchronized (fStartedAnalysis) {
fStartedAnalysis.add((ITmfAnalysisModuleWithStateSystems) module);
// Every children of ITmfAnalysisModuleWithStateSystems extends TmfAbstractAnalysisModule
ITmfTrace moduleTrace = module instanceof TmfAbstractAnalysisModule ? ((TmfAbstractAnalysisModule) module).getTrace() : viewTrace;
if (moduleTrace != null) {
getDataProvider(moduleTrace).startedAnalysisSignalHandler((ITmfAnalysisModuleWithStateSystems) module);
rebuild();
}
}
}).start();
} else {
/*
* Reset the View for the relevant trace, ensuring that the
* entry list will be rebuilt when the view switches back.
*/
for (ITmfTrace trace : TmfTraceManager.getInstance().getOpenedTraces()) {
if (Iterables.contains(allModules(trace), module)) {
synchronized (fStartedAnalysis) {
fStartedAnalysis.add((ITmfAnalysisModuleWithStateSystems) module);
resetView(trace);
}
break;
}
}
}
}
}
use of org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule in project tracecompass by tracecompass.
the class KernelPidAspectTest method setUp.
/**
* Test setup
*/
@Before
public void setUp() {
ITmfTrace trace = KERNEL_TEST_CASE.getKernelTrace();
deleteSuppFiles(trace);
/* Make sure the Kernel analysis has run */
((TmfTrace) trace).traceOpened(new TmfTraceOpenedSignal(this, trace, null));
IAnalysisModule module = null;
for (IAnalysisModule mod : TmfTraceUtils.getAnalysisModulesOfClass(trace, KernelAnalysisModule.class)) {
module = mod;
}
assertNotNull(module);
module.schedule();
module.waitForCompletion();
for (IAnalysisModule mod : TmfTraceUtils.getAnalysisModulesOfClass(trace, TidAnalysisModule.class)) {
module = mod;
}
assertNotNull(module);
module.schedule();
module.waitForCompletion();
fTrace = trace;
}
use of org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule in project tracecompass by tracecompass.
the class KernelThreadInformationProviderTest method setUp.
/**
* Setup the trace for the tests
*/
@Before
public void setUp() {
ITmfTrace trace = KERNEL_TEST_CASE.getKernelTrace();
deleteSuppFiles(trace);
((TmfTrace) trace).traceOpened(new TmfTraceOpenedSignal(this, trace, null));
IAnalysisModule module = null;
for (IAnalysisModule mod : TmfTraceUtils.getAnalysisModulesOfClass(trace, KernelAnalysisModule.class)) {
module = mod;
}
assertNotNull(module);
module.schedule();
module.waitForCompletion();
fModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, KernelAnalysisModule.class, KernelAnalysisModule.ID);
fTrace = trace;
}
use of org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule in project tracecompass by tracecompass.
the class KernelTidAspectTest method setUp.
/**
* Test setup
*/
@Before
public void setUp() {
ITmfTrace trace = KERNEL_TEST_CASE.getKernelTrace();
deleteSuppFiles(trace);
/* Make sure the Kernel analysis has run */
((TmfTrace) trace).traceOpened(new TmfTraceOpenedSignal(this, trace, null));
IAnalysisModule module = null;
for (IAnalysisModule mod : TmfTraceUtils.getAnalysisModulesOfClass(trace, TidAnalysisModule.class)) {
module = mod;
}
assertNotNull(module);
module.schedule();
module.waitForCompletion();
fTrace = trace;
}
use of org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule in project tracecompass by tracecompass.
the class KernelMemoryStateProviderTest method testAnalysisExecution.
/**
* Test that the analysis executes without problems
*/
@Test
public void testAnalysisExecution() {
/* Make sure the analysis hasn't run yet */
assertNull(fModule.getStateSystem());
/* Make sure dependent analysis is executed for so that it ready for KernelMemoryAnalysisModule */
ITmfTrace trace = fTrace;
assertNotNull(trace);
IAnalysisModule module = TmfTraceUtils.getAnalysisModuleOfClass(trace, TidAnalysisModule.class, TidAnalysisModule.ID);
assertNotNull(module);
module.schedule();
module.waitForCompletion();
/* Execute the analysis */
assertTrue(TmfTestHelper.executeAnalysis(fModule));
assertNotNull(fModule.getStateSystem());
}
Aggregations