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);
}
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);
}
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);
}
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);
}
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;
}
Aggregations