Search in sources :

Example 26 with IAnalysisModule

use of org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule in project tracecompass by tracecompass.

the class KernelContextSwitchAnalysis method getDependentAnalyses.

@Override
protected Iterable<IAnalysisModule> getDependentAnalyses() {
    Set<IAnalysisModule> modules = new HashSet<>();
    ITmfTrace trace = getTrace();
    if (trace == null) {
        // $NON-NLS-1$
        throw new IllegalStateException("Analysis requires a trace");
    }
    /*
         * This analysis depends on the LTTng kernel analysis, so it's added to
         * dependent modules.
         */
    Iterable<KernelAnalysisModule> kernelModules = TmfTraceUtils.getAnalysisModulesOfClass(trace, KernelAnalysisModule.class);
    for (KernelAnalysisModule kernelModule : kernelModules) {
        /* Only add the first one we find, if there is one */
        modules.add(kernelModule);
        break;
    }
    return modules;
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) IAnalysisModule(org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule) KernelAnalysisModule(org.eclipse.tracecompass.analysis.os.linux.core.kernel.KernelAnalysisModule) HashSet(java.util.HashSet)

Example 27 with IAnalysisModule

use of org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule in project tracecompass by tracecompass.

the class KernelCpuUsageAnalysis method getDependentAnalyses.

@Override
protected Iterable<IAnalysisModule> getDependentAnalyses() {
    Set<IAnalysisModule> modules = new HashSet<>();
    ITmfTrace trace = getTrace();
    if (trace == null) {
        // $NON-NLS-1$
        throw new IllegalStateException("Analysis requires a trace");
    }
    /*
         * This analysis depends on the LTTng kernel analysis, so it's added to
         * dependent modules.
         */
    Iterable<TidAnalysisModule> kernelModules = TmfTraceUtils.getAnalysisModulesOfClass(trace, TidAnalysisModule.class);
    for (TidAnalysisModule kernelModule : kernelModules) {
        /* Only add the first one we find, if there is one */
        modules.add(kernelModule);
        break;
    }
    return modules;
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) IAnalysisModule(org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule) TidAnalysisModule(org.eclipse.tracecompass.analysis.os.linux.core.tid.TidAnalysisModule) HashSet(java.util.HashSet)

Example 28 with IAnalysisModule

use of org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule in project tracecompass by tracecompass.

the class InputOutputAnalysisModule method getDependentAnalyses.

@Override
protected Iterable<IAnalysisModule> getDependentAnalyses() {
    Set<IAnalysisModule> modules = new HashSet<>();
    ITmfTrace trace = getTrace();
    if (trace == null) {
        throw new IllegalStateException();
    }
    /*
         * This analysis depends on the LTTng kernel analysis, so it's added to
         * dependent modules.
         */
    Iterable<TidAnalysisModule> tidModules = TmfTraceUtils.getAnalysisModulesOfClass(trace, TidAnalysisModule.class);
    for (TidAnalysisModule tidModule : tidModules) {
        /* Only add the first one we find, if there is one */
        modules.add(tidModule);
        break;
    }
    return modules;
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) IAnalysisModule(org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule) TidAnalysisModule(org.eclipse.tracecompass.analysis.os.linux.core.tid.TidAnalysisModule) HashSet(java.util.HashSet)

Example 29 with IAnalysisModule

use of org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule in project tracecompass by tracecompass.

the class UiResponseTest method beforeRunningTest.

@Override
protected void beforeRunningTest(ITmfTrace trace) {
    List<IAnalysisModule> modules = new ArrayList<>(3);
    modules.add(trace.getAnalysisModule(KernelCpuUsageAnalysis.ID));
    modules.add(trace.getAnalysisModule(KernelAnalysisModule.ID));
    modules.add(trace.getAnalysisModule(InputOutputAnalysisModule.ID));
    for (IAnalysisModule module : modules) {
        if (module != null) {
            module.schedule();
        }
    }
    for (IAnalysisModule module : modules) {
        if (module != null) {
            assertTrue(module.waitForCompletion());
        }
    }
}
Also used : IAnalysisModule(org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule) ArrayList(java.util.ArrayList)

Example 30 with IAnalysisModule

use of org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule in project tracecompass by tracecompass.

the class AbstractSegmentStatisticsAnalysis method getDependentAnalyses.

@Override
protected Iterable<IAnalysisModule> getDependentAnalyses() {
    ITmfTrace trace = getTrace();
    if (trace != null) {
        ISegmentStoreProvider provider = getSegmentProviderAnalysis(trace);
        fSegmentStoreProviderModule = provider;
        if (provider instanceof IAnalysisModule) {
            return ImmutableList.of((IAnalysisModule) provider);
        }
    }
    return super.getDependentAnalyses();
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) ISegmentStoreProvider(org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider) IAnalysisModule(org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule)

Aggregations

IAnalysisModule (org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule)71 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)28 Test (org.junit.Test)18 TmfTraceOpenedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal)17 TmfAnalysisException (org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException)15 ArrayList (java.util.ArrayList)12 ISegmentStoreProvider (org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider)11 HashSet (java.util.HashSet)10 Nullable (org.eclipse.jdt.annotation.Nullable)9 TmfTraceException (org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException)8 TmfTrace (org.eclipse.tracecompass.tmf.core.trace.TmfTrace)7 TmfExperiment (org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment)7 TestAnalysis (org.eclipse.tracecompass.tmf.tests.stubs.analysis.TestAnalysis)7 File (java.io.File)6 IStatus (org.eclipse.core.runtime.IStatus)6 ISegment (org.eclipse.tracecompass.segmentstore.core.ISegment)6 Before (org.junit.Before)6 IPath (org.eclipse.core.runtime.IPath)5 TmfSignalHandler (org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler)5 HashMap (java.util.HashMap)4