use of org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException in project tracecompass by tracecompass.
the class LttngTraceAnalysisBenchmark method runOneBenchmark.
private static void runOneBenchmark(@NonNull CtfTmfTrace testTrace, String testName, runMethod method, Dimension dimension, Supplier<IAnalysisModule> moduleSupplier) {
Performance perf = Performance.getDefault();
PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + testName);
perf.tagAsSummary(pm, "Trace Compass Analysis " + testName, dimension);
for (int i = 0; i < LOOP_COUNT; i++) {
LttngKernelTrace trace = null;
IAnalysisModule module = null;
String path = testTrace.getPath();
try {
trace = new LttngKernelTrace();
module = moduleSupplier.get();
module.setId("test");
trace.initTrace(null, path, CtfTmfEvent.class);
module.setTrace(trace);
method.execute(pm, module);
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();
}
use of org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException in project tracecompass by tracecompass.
the class KernelAnalysisUsageBenchmark method getModule.
private static KernelAnalysisModule getModule(@NonNull CtfTestTrace testTrace, @NonNull LttngKernelTrace trace) {
KernelAnalysisModule module = null;
String path = CtfTmfTestTraceUtils.getTrace(testTrace).getPath();
try {
/* Initialize the analysis module */
module = new KernelAnalysisModule();
module.setId("test");
trace.initTrace(null, path, CtfTmfEvent.class);
module.setTrace(trace);
TmfTestHelper.executeAnalysis(module);
} catch (TmfAnalysisException | TmfTraceException e) {
fail(e.getMessage());
}
return module;
}
use of org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException in project tracecompass by tracecompass.
the class TidAnalysisUsageBenchmark method getModule.
private static TidAnalysisModule getModule(@NonNull CtfTestTrace testTrace, @NonNull LttngKernelTrace trace) {
TidAnalysisModule module = null;
String path = CtfTmfTestTraceUtils.getTrace(testTrace).getPath();
try {
/* Initialize the analysis module */
module = new TidAnalysisModule();
module.setId("test");
trace.initTrace(null, path, CtfTmfEvent.class);
module.setTrace(trace);
TmfTestHelper.executeAnalysis(module);
} catch (TmfAnalysisException | TmfTraceException e) {
fail(e.getMessage());
}
return module;
}
use of org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException in project tracecompass by tracecompass.
the class StateSystemFullHistoryTest method testBuild.
// ------------------------------------------------------------------------
// Tests specific to a full-history
// ------------------------------------------------------------------------
/**
* Rebuild independently so we can benchmark it. Too bad JUnit doesn't allow
* us to @Test the @BeforeClass...
*/
@Test
public void testBuild() {
TestLttngKernelAnalysisModule module2 = new TestLttngKernelAnalysisModule(BENCHMARK_FILE_NAME);
try {
assertTrue(module2.setTrace(trace));
} catch (TmfAnalysisException e) {
module2.dispose();
fail();
}
module2.schedule();
assertTrue(module2.waitForCompletion());
ITmfStateSystem ssb2 = module2.getStateSystem();
assertNotNull(ssb2);
assertEquals(startTime, ssb2.getStartTime());
assertEquals(endTime, ssb2.getCurrentEndTime());
module2.dispose();
}
use of org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException in project tracecompass by tracecompass.
the class StateSystemFullHistoryTest method testOpenExistingStateFile.
/**
* Test re-opening the existing file.
*/
@Test
public void testOpenExistingStateFile() {
/* 'newStateFile' should have already been created */
TestLttngKernelAnalysisModule module2 = new TestLttngKernelAnalysisModule(TEST_FILE_NAME);
try {
assertTrue(module2.setTrace(trace));
} catch (TmfAnalysisException e) {
module2.dispose();
fail();
}
module2.schedule();
assertTrue(module2.waitForCompletion());
ITmfStateSystem ssb2 = module2.getStateSystem();
assertNotNull(ssb2);
assertEquals(startTime, ssb2.getStartTime());
assertEquals(endTime, ssb2.getCurrentEndTime());
module2.dispose();
}
Aggregations