use of org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException in project tracecompass by tracecompass.
the class KernelAnalysisBenchmark method runTest.
private static void runTest(@NonNull CtfTestTrace testTrace, String testName, TestModule testModule) {
Performance perf = Performance.getDefault();
PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + testName + testModule.getTestNameString());
perf.tagAsSummary(pm, "LTTng Kernel Analysis: " + testName + testModule.getTestNameString(), Dimension.CPU_TIME);
if ((testTrace == CtfTestTrace.TRACE2) && (testModule == TestModule.NORMAL_EXECUTION)) {
/* Do not show all traces in the global summary */
perf.tagAsGlobalSummary(pm, "LTTng Kernel Analysis" + testModule.getTestNameString() + ": " + testName, Dimension.CPU_TIME);
}
for (int i = 0; i < LOOP_COUNT; i++) {
LttngKernelTrace trace = null;
IAnalysisModule module = null;
// TODO Allow the utility method to instantiate trace sub-types
// directly.
String path = CtfTmfTestTraceUtils.getTrace(testTrace).getPath();
try {
trace = new LttngKernelTrace();
module = TestModule.getNewModule(testModule);
module.setId("test");
trace.initTrace(null, path, CtfTmfEvent.class);
module.setTrace(trace);
pm.start();
TmfTestHelper.executeAnalysis(module);
pm.stop();
/*
* Delete the supplementary files, so that the next iteration
* rebuilds the state system.
*/
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();
CtfTmfTestTraceUtils.dispose(testTrace);
}
use of org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException in project tracecompass by tracecompass.
the class CPUAnalysisBenchmark method runTest.
private void runTest(String testTrace, String testName, int loopCount) throws TmfTraceException {
assertNotNull(testTrace);
/* First, initialize the trace and run the required analysis */
LttngKernelTrace trace = new LttngKernelTrace();
try {
deleteSupplementaryFiles(trace);
initializeTrace(testTrace, trace);
/* Benchmark the CPU usage module */
benchmarkCPUModule(testName, trace, loopCount);
deleteSupplementaryFiles(trace);
} catch (TmfAnalysisException e) {
fail(e.getMessage());
} finally {
trace.dispose();
}
}
use of org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException in project tracecompass by tracecompass.
the class CallGraphStatisticsDataProviderFactory method createProvider.
@Override
@Nullable
public ITmfTreeDataProvider<? extends ITmfTreeDataModel> createProvider(ITmfTrace trace) {
if (trace instanceof TmfExperiment) {
return TmfTreeCompositeDataProvider.create(TmfTraceManager.getTraceSet(trace), ID);
}
Iterator<CallStackAnalysis> csModules = TmfTraceUtils.getAnalysisModulesOfClass(trace, CallStackAnalysis.class).iterator();
if (!csModules.hasNext()) {
return null;
}
CallStackAnalysis csModule = csModules.next();
csModule.schedule();
ICallGraphProvider cgModule = csModule.getCallGraph();
if (!(cgModule instanceof CallGraphAnalysis)) {
return null;
}
CallGraphStatisticsAnalysis statisticsAnalysis = new CallGraphStatisticsAnalysis();
try {
statisticsAnalysis.setTrace(trace);
} catch (TmfAnalysisException e) {
statisticsAnalysis.dispose();
return null;
}
statisticsAnalysis.schedule();
SegmentStoreStatisticsDataProvider dp = new SegmentStoreStatisticsDataProvider(trace, statisticsAnalysis, CallGraphStatisticsAnalysis.ID);
SymbolFormatter fe = new SymbolFormatter(trace);
dp.setLabelMapper(fe);
return dp;
}
use of org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException in project tracecompass by tracecompass.
the class StateSystemInMemoryTest method initialize.
/**
* Test class setup
*/
@BeforeClass
public static void initialize() {
CtfTmfTrace thetrace = CtfTmfTestTraceUtils.getTrace(testTrace);
trace = thetrace;
module = new TestLttngKernelAnalysisModule();
try {
assertTrue(module.setTrace(thetrace));
} catch (TmfAnalysisException e) {
fail();
}
module.schedule();
assertTrue(module.waitForCompletion());
fixture = module.getStateSystem();
}
Aggregations