use of org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule in project tracecompass by tracecompass.
the class DataDrivenTimeGraphProviderFactory method create.
/**
* Create a data provider for a trace
*
* @param trace
* The trace for which to create a provider
* @return A time graph data provider, or <code>null</code> if the data
* provider cannot be built for this trace because it does not have
* the proper analyses.
*/
@Nullable
public ITimeGraphDataProvider<TimeGraphEntryModel> create(ITmfTrace trace) {
Set<@NonNull ITmfAnalysisModuleWithStateSystems> stateSystemModules = new HashSet<>();
List<ITmfStateSystem> sss = new ArrayList<>();
if (fAnalysisIds.isEmpty()) {
/*
* No analysis specified, take all state system analysis modules
*/
Iterables.addAll(stateSystemModules, TmfTraceUtils.getAnalysisModulesOfClass(trace, ITmfAnalysisModuleWithStateSystems.class));
} else {
for (String moduleId : fAnalysisIds) {
// Get the module for the current trace only. The caller will
// take care of
// generating composite providers with experiments
IAnalysisModule module = trace.getAnalysisModule(moduleId);
if (module instanceof ITmfAnalysisModuleWithStateSystems) {
stateSystemModules.add((ITmfAnalysisModuleWithStateSystems) module);
}
}
}
for (ITmfAnalysisModuleWithStateSystems module : stateSystemModules) {
if (module.schedule().isOK() && module.waitForInitialization()) {
module.getStateSystems().forEach(sss::add);
}
}
return (sss.isEmpty() ? null : create(trace, sss, fEntries, fValues, null));
}
Aggregations