use of org.eclipse.tracecompass.tmf.core.trace.ITmfTrace in project tracecompass by tracecompass.
the class AbstractProviderTest method tearDown.
/**
* Perform post-class clean-up.
*/
@After
public void tearDown() {
fModule.dispose();
ITmfTrace trace = fTrace;
if (trace != null) {
LttngUstTestTraceUtils.dispose(getTestTrace());
File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(trace));
deleteDirectory(suppDir);
}
}
use of org.eclipse.tracecompass.tmf.core.trace.ITmfTrace in project tracecompass by tracecompass.
the class UstMemoryAnalysisModule method executeAnalysis.
@Override
protected boolean executeAnalysis(IProgressMonitor monitor) {
if (!super.executeAnalysis(monitor)) {
return false;
}
ITmfTrace trace = checkNotNull(getTrace());
// $NON-NLS-1$
String segmentFileName = getSsFileName() + ".seg";
/* See if the data file already exists on disk */
String dir = TmfTraceManager.getSupplementaryFileDir(trace);
final Path file = Paths.get(dir, segmentFileName);
boolean needsBuilding = true;
Map<Long, MemoryAllocation> unfreedMemory = fPotentialLeaks;
if (unfreedMemory == null || unfreedMemory.isEmpty()) {
needsBuilding = false;
}
ISegmentStore<@NonNull ISegment> segmentStore = null;
try {
if (needsBuilding) {
Files.deleteIfExists(file);
}
segmentStore = SegmentStoreFactory.createOnDiskSegmentStore(file, PotentialLeakSegment.MEMORY_SEGMENT_READ_FACTORY, 1);
} catch (IOException e) {
return false;
}
if (needsBuilding) {
fillStore(segmentStore, unfreedMemory);
}
fSegmentStore = segmentStore;
sendUpdate(segmentStore);
return true;
}
use of org.eclipse.tracecompass.tmf.core.trace.ITmfTrace in project tracecompass by tracecompass.
the class TmfStateValueScenarioTest method setUp.
/**
* Initializes the trace and the module for the tests
*
* @throws TmfAnalysisException
* Any exception thrown during module initialization
*/
@Before
public void setUp() throws TmfAnalysisException {
ITmfTrace trace = XmlUtilsTest.initializeTrace(TEST_TRACE);
XmlPatternAnalysis module = XmlUtilsTest.initializePatternModule(TmfXmlTestFiles.STATE_VALUE_PATTERN_FILE);
module.setTrace(trace);
module.schedule();
module.waitForCompletion();
fTrace = trace;
fModule = module;
}
use of org.eclipse.tracecompass.tmf.core.trace.ITmfTrace in project tracecompass by tracecompass.
the class TmfStateValueTest method setUp.
/**
* Initializes the trace and the module for the tests
*
* @throws TmfAnalysisException
* Any exception thrown during module initialization
*/
@Before
public void setUp() throws TmfAnalysisException {
ITmfTrace trace = XmlUtilsTest.initializeTrace(TEST_TRACE);
fTrace = trace;
DataDrivenAnalysisModule module = XmlUtilsTest.initializeModule(TmfXmlTestFiles.STATE_VALUE_FILE);
fModule = module;
module.setTrace(trace);
module.schedule();
module.waitForCompletion();
}
use of org.eclipse.tracecompass.tmf.core.trace.ITmfTrace in project tracecompass by tracecompass.
the class XmlSegmentTest method testSegmentContent.
/**
* Test segment generated using a mapping group
*
* @throws TmfAnalysisException
* Exception thrown by analysis
*/
@Test
public void testSegmentContent() throws TmfAnalysisException {
ITmfTrace trace = getTrace(TEST_TRACE2);
XmlPatternAnalysis module = null;
try {
module = initializeModule(trace, TmfXmlTestFiles.VALID_PATTERN_SEGMENT);
doTestSegmentContent(module);
// Close the segment store and open it again, it should read the
// segment store from disk this time
module.dispose();
module = initializeModule(trace, TmfXmlTestFiles.VALID_PATTERN_SEGMENT);
doTestSegmentContent(module);
} finally {
if (module != null) {
module.dispose();
}
deleteSupplementaryFiles(trace);
trace.dispose();
}
}
Aggregations