org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.kernel.statesystem;x-internal:=true,
org.eclipse.tracecompass.lttng2.kernel.core.tests.event.matchandsync;x-internal:=true,
org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.analysis,
+ org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.analysis.kernel,
org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.event.matching,
org.eclipse.tracecompass.lttng2.lttng.kernel.core.tests.shared.vm
Import-Package: com.google.common.collect,
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014, 2015 École Polytechnique de Montréal
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Geneviève Bastien - Initial API and implementation
- * Alexandre Montplaisir - Convert to org.eclipse.test.performance test
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.analysis;
-
-import static org.junit.Assert.fail;
-
-import java.io.File;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.test.performance.Dimension;
-import org.eclipse.test.performance.Performance;
-import org.eclipse.test.performance.PerformanceMeter;
-import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysisModule;
-import org.eclipse.tracecompass.lttng2.kernel.core.trace.LttngKernelTrace;
-import org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace;
-import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
-import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
-import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
-import org.eclipse.tracecompass.tmf.core.tests.shared.TmfTestHelper;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
-import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent;
-import org.eclipse.tracecompass.tmf.ctf.core.tests.shared.CtfTmfTestTraceUtils;
-import org.junit.Test;
-
-/**
- * This is a test of the time to build a kernel state system
- *
- * @author Genevieve Bastien
- */
-public class AnalysisBenchmark {
-
- private static final String TEST_ID = "org.eclipse.linuxtools#LTTng kernel analysis";
- private static final int LOOP_COUNT = 25;
-
- /**
- * Run the benchmark with "trace2"
- */
- @Test
- public void testTrace2() {
- runTest(CtfTestTrace.TRACE2, "Trace2");
- }
-
- private static void runTest(@NonNull CtfTestTrace testTrace, String testName) {
- Performance perf = Performance.getDefault();
- PerformanceMeter pm = perf.createPerformanceMeter(TEST_ID + '#' + testName);
- perf.tagAsSummary(pm, "LTTng Kernel Analysis: " + testName, Dimension.CPU_TIME);
-
- if (testTrace == CtfTestTrace.TRACE2) {
- /* Do not show all traces in the global summary */
- perf.tagAsGlobalSummary(pm, "LTTng Kernel Analysis: " + 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 = new KernelAnalysisModule();
- 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);
- }
-}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Geneviève Bastien - Initial API and implementation
+ * Alexandre Montplaisir - Convert to org.eclipse.test.performance test
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.analysis.kernel;
+
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.util.Arrays;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.test.performance.Dimension;
+import org.eclipse.test.performance.Performance;
+import org.eclipse.test.performance.PerformanceMeter;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysisModule;
+import org.eclipse.tracecompass.lttng2.kernel.core.trace.LttngKernelTrace;
+import org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace;
+import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
+import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.tracecompass.tmf.core.tests.shared.TmfTestHelper;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
+import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent;
+import org.eclipse.tracecompass.tmf.ctf.core.tests.shared.CtfTmfTestTraceUtils;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+/**
+ * This is a test of the time to build a kernel state system
+ *
+ * @author Genevieve Bastien
+ */
+@RunWith(Parameterized.class)
+public class KernelAnalysisBenchmark {
+
+ private static final String TEST_ID = "org.eclipse.linuxtools#LTTng kernel analysis#";
+ private static final int LOOP_COUNT = 25;
+
+ private final TestModule fTestModule;
+
+ private enum TestModule {
+
+ NORMAL_EXECUTION(""),
+ NULL_BACKEND("(Data not saved to disk)");
+
+ private final String fName;
+
+ private TestModule(String name) {
+ fName = name;
+ }
+
+ public String getTestNameString() {
+ return fName;
+ }
+
+ public static IAnalysisModule getNewModule(TestModule moduleType) {
+ switch (moduleType) {
+ case NORMAL_EXECUTION:
+ return new KernelAnalysisModule();
+ case NULL_BACKEND:
+ return new KernelAnalysisModuleNullBeStub();
+ default:
+ throw new IllegalStateException();
+ }
+ }
+ }
+
+ /**
+ * Constructor
+ *
+ * @param testName
+ * A name for the test, to display in the header
+ * @param module
+ * A test case parameter for this test
+ */
+ public KernelAnalysisBenchmark(String testName, TestModule module) {
+ fTestModule = module;
+ }
+
+ /**
+ * @return The arrays of parameters
+ */
+ @Parameters(name = "{index}: {0}")
+ public static Iterable<Object[]> getParameters() {
+ return Arrays.asList(new Object[][] {
+ { TestModule.NORMAL_EXECUTION.name(), TestModule.NORMAL_EXECUTION },
+ { TestModule.NULL_BACKEND.name(), TestModule.NULL_BACKEND }
+ });
+ }
+
+ /**
+ * Run the benchmark with "trace2"
+ */
+ @Test
+ public void testTrace2() {
+ runTest(CtfTestTrace.TRACE2, "Trace2", fTestModule);
+ }
+
+ 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);
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.analysis.kernel;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysisModule;
+
+/**
+ * This class is an extension of {@link KernelAnalysisModule} that uses a null
+ * backend instead of the default one. This allows to benchmark this analysis
+ * without benchmarking the insertions in the state system.
+ *
+ * @author Geneviève Bastien
+ */
+public class KernelAnalysisModuleNullBeStub extends KernelAnalysisModule {
+
+ @Override
+ protected @NonNull StateSystemBackendType getBackendType() {
+ return StateSystemBackendType.NULL;
+ }
+
+}
org.eclipse.tracecompass.ctf.core.tests.perf.trace.TraceReadBenchmark.class,
org.eclipse.tracecompass.ctf.core.tests.perf.trace.TraceSeekBenchmark.class,
- org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.analysis.AnalysisBenchmark.class,
+ org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.analysis.kernel.KernelAnalysisBenchmark.class,
org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.analysis.StatisticsAnalysisBenchmark.class,
org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.event.matching.EventMatchingBenchmark.class,
org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.event.matching.TraceSynchronizationBenchmark.class,