Search in sources :

Example 1 with SystemCallLatencyAnalysis

use of org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCallLatencyAnalysis in project tracecompass by tracecompass.

the class SystemCallAnalysisUsageBenchmark method runTest.

private static void runTest(@NonNull CtfTestTrace testTrace, String traceName) {
    /* First, complete the analysis */
    LttngKernelTrace trace = new LttngKernelTrace();
    SystemCallLatencyAnalysis module = getModule(testTrace, trace);
    long segmentEnd = benchmarkIteration(traceName, module);
    benchmarkIntersection(traceName, module, trace.getStartTime().getValue(), segmentEnd);
    /*
         * Delete the supplementary files at the end of the benchmarks
         */
    deleteSupplementaryFiles(trace);
    module.dispose();
    trace.dispose();
    CtfTmfTestTraceUtils.dispose(testTrace);
}
Also used : SystemCallLatencyAnalysis(org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCallLatencyAnalysis) LttngKernelTrace(org.eclipse.tracecompass.lttng2.kernel.core.trace.LttngKernelTrace)

Example 2 with SystemCallLatencyAnalysis

use of org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCallLatencyAnalysis in project tracecompass by tracecompass.

the class SyscallAnalysisTest method testSmallTraceSequential.

/**
 * This will load the analysis and test it. as it depends on Kernel, this
 * test runs the kernel trace first then the analysis
 */
@Test
public void testSmallTraceSequential() {
    final SystemCallLatencyAnalysis syscallModule = fSyscallModule;
    assertNotNull(syscallModule);
    ISegmentStore<@NonNull ISegment> segmentStore = syscallModule.getSegmentStore();
    assertNotNull(segmentStore);
    assertEquals(1801, segmentStore.size());
}
Also used : SystemCallLatencyAnalysis(org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCallLatencyAnalysis) ISegment(org.eclipse.tracecompass.segmentstore.core.ISegment) Test(org.junit.Test)

Example 3 with SystemCallLatencyAnalysis

use of org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCallLatencyAnalysis in project tracecompass by tracecompass.

the class SystemCallAnalysisBenchmark method runTest.

private static void runTest(@NonNull CtfTestTrace testTrace, String testName, RunMethod method, Dimension dimension) {
    Performance perf = Performance.getDefault();
    PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + testName);
    perf.tagAsSummary(pm, "Syscall " + testName, dimension);
    for (int i = 0; i < LOOP_COUNT; i++) {
        LttngKernelTrace trace = null;
        IAnalysisModule module = null;
        String path = CtfTmfTestTraceUtils.getTrace(testTrace).getPath();
        try {
            // Make sure the TID analysis has run on this trace
            trace = new LttngKernelTrace();
            trace.initTrace(null, path, CtfTmfEvent.class);
            trace.traceOpened(new TmfTraceOpenedSignal(trace, trace, null));
            module = trace.getAnalysisModule(TidAnalysisModule.ID);
            assertNotNull(module);
            module.schedule();
            module.waitForCompletion();
            module = new SystemCallLatencyAnalysis();
            module.setId("test");
            module.setTrace(trace);
            method.execute(pm, module);
            /*
                 * Delete the supplementary files, so that the next iteration
                 * rebuilds the state system.
                 */
            File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(trace));
            for (File file : suppDir.listFiles()) {
                file.delete();
            }
        } catch (TmfAnalysisException | TmfTraceException e) {
            fail(e.getMessage());
        } finally {
            if (module != null) {
                module.dispose();
            }
            if (trace != null) {
                trace.dispose();
            }
        }
    }
    pm.commit();
    CtfTmfTestTraceUtils.dispose(testTrace);
}
Also used : SystemCallLatencyAnalysis(org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCallLatencyAnalysis) IAnalysisModule(org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule) TmfAnalysisException(org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException) TmfTraceException(org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException) PerformanceMeter(org.eclipse.test.performance.PerformanceMeter) LttngKernelTrace(org.eclipse.tracecompass.lttng2.kernel.core.trace.LttngKernelTrace) TmfTraceOpenedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal) Performance(org.eclipse.test.performance.Performance) File(java.io.File)

Example 4 with SystemCallLatencyAnalysis

use of org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCallLatencyAnalysis in project tracecompass by tracecompass.

the class SystemCallAnalysisUsageBenchmark method getModule.

private static SystemCallLatencyAnalysis getModule(@NonNull CtfTestTrace testTrace, @NonNull LttngKernelTrace trace) {
    SystemCallLatencyAnalysis module = null;
    String path = CtfTmfTestTraceUtils.getTrace(testTrace).getPath();
    try {
        // Make sure the TID analysis has run on this trace
        trace.initTrace(null, path, CtfTmfEvent.class);
        deleteSupplementaryFiles(trace);
        trace.traceOpened(new TmfTraceOpenedSignal(trace, trace, null));
        IAnalysisModule tidModule = trace.getAnalysisModule(TidAnalysisModule.ID);
        assertNotNull(tidModule);
        tidModule.schedule();
        tidModule.waitForCompletion();
        /* Initialize the analysis module */
        module = new SystemCallLatencyAnalysis();
        module.setId("test");
        module.setTrace(trace);
        TmfTestHelper.executeAnalysis(module);
    } catch (TmfAnalysisException | TmfTraceException e) {
        fail(e.getMessage());
    }
    return module;
}
Also used : SystemCallLatencyAnalysis(org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCallLatencyAnalysis) IAnalysisModule(org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule) TmfAnalysisException(org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException) TmfTraceException(org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException) TmfTraceOpenedSignal(org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal)

Aggregations

SystemCallLatencyAnalysis (org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCallLatencyAnalysis)4 LttngKernelTrace (org.eclipse.tracecompass.lttng2.kernel.core.trace.LttngKernelTrace)2 IAnalysisModule (org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule)2 TmfAnalysisException (org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException)2 TmfTraceException (org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException)2 TmfTraceOpenedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal)2 File (java.io.File)1 Performance (org.eclipse.test.performance.Performance)1 PerformanceMeter (org.eclipse.test.performance.PerformanceMeter)1 ISegment (org.eclipse.tracecompass.segmentstore.core.ISegment)1 Test (org.junit.Test)1