use of org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.InputOutputAnalysisModule in project tracecompass by tracecompass.
the class AbstractTestInputOutput method setUp.
/**
* Setup the trace for the tests and return the InputOutputAnalysisModule,
* not executed.
*
* @param fileName
* The file name of the trace to open
* @return The input output analysis module
*/
@NonNull
protected InputOutputAnalysisModule setUp(String fileName) {
TmfXmlKernelTraceStub trace = new TmfXmlKernelTraceStub();
trace.addEventAspect(KernelTidAspect.INSTANCE);
trace.setKernelEventLayout(EVENT_LAYOUT);
IPath filePath = Activator.getAbsoluteFilePath(IO_FILE_PATH + fileName);
IStatus status = trace.validate(null, filePath.toOSString());
if (!status.isOK()) {
fail(status.getException().getMessage());
}
try {
trace.initTrace(null, filePath.toOSString(), TmfEvent.class);
} catch (TmfTraceException e) {
fail(e.getMessage());
}
deleteSuppFiles(trace);
((TmfTrace) trace).traceOpened(new TmfTraceOpenedSignal(this, trace, null));
fTrace = trace;
/* Start the kernel analysis module */
KernelAnalysisModule kernelMod = TmfTraceUtils.getAnalysisModuleOfClass(trace, KernelAnalysisModule.class, KernelAnalysisModule.ID);
assertNotNull(kernelMod);
kernelMod.schedule();
kernelMod.waitForCompletion();
InputOutputAnalysisModule module = TmfTraceUtils.getAnalysisModuleOfClass(trace, InputOutputAnalysisModule.class, InputOutputAnalysisModule.ID);
assertNotNull(module);
return module;
}
use of org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.InputOutputAnalysisModule in project tracecompass by tracecompass.
the class InputOutputDataProviderTest method getProvider.
@NonNull
private DisksIODataProvider getProvider() {
InputOutputAnalysisModule module = setUp(fTestCase.getTraceFileName());
ITmfTrace trace = module.getTrace();
assertNotNull(trace);
DisksIODataProvider provider = DisksIODataProvider.create(trace);
assertNotNull(provider);
return provider;
}
use of org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.InputOutputAnalysisModule in project tracecompass by tracecompass.
the class InputOutputDiskTest method testSectorsAt.
/**
* Test the {@link Disk#getSectorsAt(long, IoOperationType)} method
* method
*/
@Test
public void testSectorsAt() {
InputOutputAnalysisModule module = setUp(fTestCase.getTraceFileName());
for (Integer deviceId : fTestCase.getSectorCount().keySet()) {
Disk disk = getDisk(module, deviceId);
assertNotNull(disk);
for (SectorCountInfo info : fTestCase.getSectorCount().get(deviceId)) {
double sectorsAt = disk.getSectorsAt(info.getTimestamp(), info.getType());
assertEquals("Sectors at " + info.getTimestamp() + " for type " + info.getType(), info.getNbSectors(), sectorsAt, 1.0);
}
}
}
use of org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.InputOutputAnalysisModule in project tracecompass by tracecompass.
the class InputOutputStateProviderTest method testStateProviderPunctualData.
/**
* Test the data of attributes at punctual times
*/
@Test
public void testStateProviderPunctualData() {
InputOutputAnalysisModule module = setUp(fTestCase.getTraceFileName());
assertNotNull(module);
TmfTestHelper.executeAnalysis(module);
ITmfStateSystem ss = module.getStateSystem();
assertNotNull(ss);
for (@NonNull PunctualInfo info : fTestCase.getPunctualTestData()) {
StateSystemTestUtils.testValuesAtTime(ss, info.getTimestamp(), info.getValues());
}
}
use of org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.InputOutputAnalysisModule in project tracecompass by tracecompass.
the class InputOutputStateProviderTest method testAnalysisExecution.
/**
* Test that the analysis executes without problems
*/
@Test
public void testAnalysisExecution() {
InputOutputAnalysisModule module = setUp(fTestCase.getTraceFileName());
/* Make sure the analysis hasn't run yet */
assertNull(module.getStateSystem());
/* Execute the analysis */
assertTrue(TmfTestHelper.executeAnalysis(module));
assertNotNull(module.getStateSystem());
}
Aggregations