Search in sources :

Example 11 with LttngUstTrace

use of org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace in project tracecompass by tracecompass.

the class UstDebugInfoAnalysisModuleTest method testExecution.

/**
 * Test that basic execution of the module works well.
 */
@Test
public void testExecution() {
    LttngUstTrace trace = LttngUstTestTraceUtils.getTrace(REAL_TEST_TRACE);
    executeModule(trace);
    ITmfStateSystem ss = fModule.getStateSystem();
    assertNotNull(ss);
    LttngUstTestTraceUtils.dispose(REAL_TEST_TRACE);
}
Also used : LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace) ITmfStateSystem(org.eclipse.tracecompass.statesystem.core.ITmfStateSystem) Test(org.junit.Test)

Example 12 with LttngUstTrace

use of org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace in project tracecompass by tracecompass.

the class UstDebugInfoAnalysisModuleTest method testCanExecute.

/**
 * Test that the analysis can execute on a valid trace.
 */
@Test
public void testCanExecute() {
    LttngUstTrace trace = LttngUstTestTraceUtils.getTrace(REAL_TEST_TRACE);
    assertTrue(fModule.canExecute(trace));
    LttngUstTestTraceUtils.dispose(REAL_TEST_TRACE);
}
Also used : LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace) Test(org.junit.Test)

Example 13 with LttngUstTrace

use of org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace in project tracecompass by tracecompass.

the class UstDebugInfoAnalysisModuleTest method testExec.

/**
 * Test the analysis with a test trace doing an "exec" system call.
 */
@Test
public void testExec() {
    UstDebugInfoLoadedBinaryFile matchingFile, expected;
    int vpid = 1337;
    LttngUstTrace trace = LttngUstTestTraceUtils.getTrace(SYNTH_EXEC_TRACE);
    executeModule(trace);
    expected = new UstDebugInfoLoadedBinaryFile(0x400000, "/tmp/foo", null, null, false);
    matchingFile = fModule.getMatchingFile(4000000, vpid, 0x400100);
    assertEquals(expected, matchingFile);
    expected = null;
    matchingFile = fModule.getMatchingFile(8000000, vpid, 0x400100);
    assertEquals(expected, matchingFile);
    expected = new UstDebugInfoLoadedBinaryFile(0x500000, "/tmp/bar", null, null, false);
    matchingFile = fModule.getMatchingFile(9000000, vpid, 0x500100);
    assertEquals(expected, matchingFile);
    LttngUstTestTraceUtils.dispose(SYNTH_EXEC_TRACE);
}
Also used : UstDebugInfoLoadedBinaryFile(org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoLoadedBinaryFile) LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace) Test(org.junit.Test)

Example 14 with LttngUstTrace

use of org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace in project tracecompass by tracecompass.

the class UstDebugInfoAnalysisModuleTest method testTwoProcesses.

/**
 * Test the analysis with a test trace with two processes doing a statedump
 * simultaneously.
 */
@Test
public void testTwoProcesses() {
    UstDebugInfoLoadedBinaryFile matchingFile, expected;
    int vpid1 = 1337;
    int vpid2 = 2001;
    LttngUstTrace trace = LttngUstTestTraceUtils.getTrace(SYNTH_TWO_PROCESSES_TRACE);
    executeModule(trace);
    expected = new UstDebugInfoLoadedBinaryFile(0x400000, "/tmp/foo", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "/tmp/debuglink1", false);
    matchingFile = fModule.getMatchingFile(11000000, vpid1, 0x400100);
    assertEquals(expected, matchingFile);
    expected = new UstDebugInfoLoadedBinaryFile(0x400000, "/tmp/bar", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "/tmp/debuglink2", false);
    matchingFile = fModule.getMatchingFile(12000000, vpid2, 0x400100);
    assertEquals(expected, matchingFile);
    LttngUstTestTraceUtils.dispose(SYNTH_TWO_PROCESSES_TRACE);
}
Also used : UstDebugInfoLoadedBinaryFile(org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoLoadedBinaryFile) LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace) Test(org.junit.Test)

Example 15 with LttngUstTrace

use of org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace in project tracecompass by tracecompass.

the class UstMemoryAnalysisModule method getAnalysisRequirements.

@Override
public Iterable<TmfAbstractAnalysisRequirement> getAnalysisRequirements() {
    Set<TmfAbstractAnalysisRequirement> requirements = fAnalysisRequirements;
    if (requirements == null) {
        ITmfTrace trace = getTrace();
        ILttngUstEventLayout layout;
        if (!(trace instanceof LttngUstTrace)) {
            layout = ILttngUstEventLayout.DEFAULT_LAYOUT;
        } else {
            layout = ((LttngUstTrace) trace).getEventLayout();
        }
        @NonNull Set<@NonNull String> requiredEvents = ImmutableSet.of(layout.eventLibcMalloc(), layout.eventLibcFree(), layout.eventLibcCalloc(), layout.eventLibcRealloc(), layout.eventLibcMemalign(), layout.eventLibcPosixMemalign());
        /* Initialize the requirements for the analysis: domain and events */
        TmfAbstractAnalysisRequirement eventsReq = new TmfAnalysisEventRequirement(requiredEvents, PriorityLevel.MANDATORY);
        /*
             * In order to have these events, the libc wrapper with probes should be
             * loaded
             */
        eventsReq.addInformation(nullToEmptyString(Messages.UstMemoryAnalysisModule_EventsLoadingInformation));
        eventsReq.addInformation(nullToEmptyString(Messages.UstMemoryAnalysisModule_EventsLoadingExampleInformation));
        /* The domain type of the analysis */
        // FIXME: The domain requirement should have a way to be verified. It is useless otherwise
        // TmfAnalysisRequirement domainReq = new TmfAnalysisRequirement(nullToEmptyString(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN));
        // domainReq.addValue(nullToEmptyString(SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST), ValuePriorityLevel.MANDATORY);
        requirements = ImmutableSet.of(eventsReq);
        fAnalysisRequirements = requirements;
    }
    return requirements;
}
Also used : LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace) ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) TmfAbstractAnalysisRequirement(org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement) NonNull(org.eclipse.jdt.annotation.NonNull) TmfAnalysisEventRequirement(org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAnalysisEventRequirement) NonNullUtils.nullToEmptyString(org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString) ILttngUstEventLayout(org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout)

Aggregations

LttngUstTrace (org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace)18 Test (org.junit.Test)8 UstDebugInfoLoadedBinaryFile (org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoLoadedBinaryFile)3 ILttngUstEventLayout (org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout)3 File (java.io.File)2 NonNull (org.eclipse.jdt.annotation.NonNull)2 Nullable (org.eclipse.jdt.annotation.Nullable)2 NonNullUtils.nullToEmptyString (org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString)2 SymbolProviderConfig (org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace.SymbolProviderConfig)2 CtfTestTrace (org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace)2 TmfAbstractAnalysisRequirement (org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement)2 ArrayList (java.util.ArrayList)1 SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)1 UstDebugInfoAnalysisModule (org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoAnalysisModule)1 UstDebugInfoBinaryAspect (org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoBinaryAspect)1 UstDebugInfoBinaryFile (org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoBinaryFile)1 LttngUstEvent (org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstEvent)1 ITmfStateSystem (org.eclipse.tracecompass.statesystem.core.ITmfStateSystem)1 TmfAnalysisEventRequirement (org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAnalysisEventRequirement)1 ITmfEvent (org.eclipse.tracecompass.tmf.core.event.ITmfEvent)1