ust: Add swtbot for callstack view responsiveness
authorGeneviève Bastien <gbastien+lttng@versatic.net>
Thu, 1 Sep 2016 20:12:31 +0000 (16:12 -0400)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Tue, 13 Dec 2016 19:24:56 +0000 (14:24 -0500)
This swtbot test navigates a trace with the callstack view opened. This
test is not meant to be run in the performance test suite, but enabling
JUL logging with it allows to have a reproducible series of UI operations
and analyze its output.

Change-Id: If4081a4581bb1c774c3643fc0bb0dd418c421379
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/80258
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
lttng/org.eclipse.tracecompass.lttng2.ust.core/META-INF/MANIFEST.MF
lttng/org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests/.classpath
lttng/org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests/build.properties
lttng/org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests/perf/org/eclipse/tracecompass/lttng2/ust/ui/swtbot/tests/perf/LttngUstResponseBenchmark.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/callstack/CallStackView.java

index 8947b4dae3270b9322b0d51d477c0d7ae7ea50d4..7c8c16cbc834a77d5c3fa806528feb17d0514356 100644 (file)
@@ -11,7 +11,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Export-Package: org.eclipse.tracecompass.internal.lttng2.ust.core;x-friends:="org.eclipse.tracecompass.lttng2.ust.core.tests,org.eclipse.tracecompass.lttng2.ust.ui",
  org.eclipse.tracecompass.internal.lttng2.ust.core.analysis.debuginfo;x-friends:="org.eclipse.tracecompass.lttng2.ust.core.tests",
  org.eclipse.tracecompass.internal.lttng2.ust.core.analysis.memory;x-friends:="org.eclipse.tracecompass.lttng2.ust.ui,org.eclipse.tracecompass.lttng2.ust.core.tests",
- org.eclipse.tracecompass.internal.lttng2.ust.core.callstack;x-friends:="org.eclipse.tracecompass.lttng2.ust.ui,org.eclipse.tracecompass.lttng2.ust.core.tests",
+ org.eclipse.tracecompass.internal.lttng2.ust.core.callstack;x-friends:="org.eclipse.tracecompass.lttng2.ust.ui,org.eclipse.tracecompass.lttng2.ust.core.tests,org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests",
  org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout;x-internal:=true,
  org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo,
  org.eclipse.tracecompass.lttng2.ust.core.analysis.memory,
index 53e1048342e3a10ddbf95e5de99e12a89233eb24..aab7650a24e8414d5ee1078ef1772eba592c1017 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
        <classpathentry kind="src" path="src"/>
+       <classpathentry kind="src" path="perf"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
                <attributes>
                        <attribute name="annotationpath" value="/org.eclipse.tracecompass.common.core/annotations"/>
index cee367fdce9ca2f94596e03961d68fb29a85e73d..520eb0edb7cceb797436c3d6a7da86e3b741352d 100644 (file)
@@ -10,7 +10,8 @@
 #    Ericsson - Initial API and implementation
 ###############################################################################
 
-source.. = src/
+source.. = src/,\
+           perf/
 bin.includes = META-INF/,\
                .,\
                plugin.properties,\
diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests/perf/org/eclipse/tracecompass/lttng2/ust/ui/swtbot/tests/perf/LttngUstResponseBenchmark.java b/lttng/org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests/perf/org/eclipse/tracecompass/lttng2/ust/ui/swtbot/tests/perf/LttngUstResponseBenchmark.java
new file mode 100644 (file)
index 0000000..389f79d
--- /dev/null
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * 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.ust.ui.swtbot.tests.perf;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.tracecompass.internal.lttng2.ust.core.callstack.LttngUstCallStackAnalysis;
+import org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace;
+import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.ui.swtbot.tests.perf.views.ViewsResponseTest;
+import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotUtils;
+import org.eclipse.tracecompass.tmf.ui.views.TracingPerspectiveFactory;
+import org.eclipse.tracecompass.tmf.ui.views.callstack.CallStackView;
+import org.junit.Test;
+
+/**
+ * Test the responsiveness of some UST-specific views. Ideally, when running
+ * this test, JUL logging should be enabled using a logger.properties file.
+ * LTTng JUL handler is advised since it works better with multi-threaded
+ * applications than other log handlers
+ *
+ * @author Geneviève Bastien
+ */
+public class LttngUstResponseBenchmark extends ViewsResponseTest {
+
+    private static final @NonNull String CALLSTACK_VIEW_ID = CallStackView.ID;
+    private static final String TRACE_TYPE = "org.eclipse.linuxtools.lttng2.ust.tracetype";
+
+    @Override
+    protected void prepareWorkspace() {
+        /* Switch to kernel perspective */
+        SWTBotUtils.switchToPerspective(TracingPerspectiveFactory.ID);
+    }
+
+    @Override
+    protected void beforeRunningTest(ITmfTrace trace) {
+        List<IAnalysisModule> modules = new ArrayList<>(3);
+        modules.add(trace.getAnalysisModule(LttngUstCallStackAnalysis.ID));
+        for (IAnalysisModule module : modules) {
+            if (module != null) {
+                module.schedule();
+            }
+        }
+        for (IAnalysisModule module : modules) {
+            if (module != null) {
+                assertTrue(module.waitForCompletion());
+            }
+        }
+    }
+
+    /**
+     * Test with the many-threads trace
+     *
+     * @throws SecurityException
+     *             If a security manager is present and any the wrong class is
+     *             loaded or the class loader is not the same as its ancestor's
+     *             loader.
+     * @throws IllegalArgumentException
+     *             the object is not the correct class type
+     * @throws IOException
+     *             Exceptions with the trace file
+     *
+     */
+    @Test
+    public void testWithCygProfile() throws SecurityException, IllegalArgumentException, IOException {
+        runTestWithTrace(FileLocator.toFileURL(CtfTestTrace.CYG_PROFILE.getTraceURL()).getPath(), TRACE_TYPE, Collections.singleton(CALLSTACK_VIEW_ID));
+    }
+
+}
index 6b2aa2484a89a786aad28a5e3707d938c9c9da55..c5a5eae7adc4e8e3e0e3a7ae020a3e587422de8f 100644 (file)
@@ -102,7 +102,7 @@ public class CallStackView extends AbstractTimeGraphView {
     // ------------------------------------------------------------------------
 
     /** View ID. */
-    public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.callstack"; //$NON-NLS-1$
+    public static final @NonNull String ID = "org.eclipse.linuxtools.tmf.ui.views.callstack"; //$NON-NLS-1$
 
     private static final String[] COLUMN_NAMES = new String[] {
             Messages.CallStackView_FunctionColumn,
This page took 0.027834 seconds and 5 git commands to generate.