use of org.eclipse.tracecompass.analysis.os.linux.core.execution.graph.OsExecutionGraph in project tracecompass by tracecompass.
the class KernelExecutionGraphBenchmark method runOneBenchmark.
private void runOneBenchmark(String testName, RunMethod method, Dimension dimension, int loopCount) {
Performance perf = Performance.getDefault();
PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + testName);
PerformanceMeter pmCritPath = perf.createPerformanceMeter(CRIT_PATH_TEST_ID + testName);
perf.tagAsSummary(pm, "Execution graph " + testName, dimension);
for (int i = 0; i < loopCount; i++) {
LttngKernelTrace trace = null;
OsExecutionGraph module = null;
try {
trace = new LttngKernelTrace();
module = new OsExecutionGraph();
module.setId("test");
trace.initTrace(null, fFileTracePath, CtfTmfEvent.class);
module.setTrace(trace);
method.execute(pm, module);
// If a thread is specified, benchmark the critical path
if (fThreadId > 0) {
benchmarkCriticalPath(testName, method, pmCritPath, trace, module);
}
/*
* 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();
pmCritPath.commit();
}
Aggregations