os.linux: Remove latency table view and use the one from timing
authorGeneviève Bastien <gbastien+lttng@versatic.net>
Thu, 22 Sep 2016 01:45:28 +0000 (21:45 -0400)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Tue, 8 Nov 2016 13:49:56 +0000 (08:49 -0500)
The latency table is replaced by the timing's concrete table view with
secondary ID.

The SWTbot tests needed to be udpated as well. A utils method was added
to open views with secondary ids.

Change-Id: Ia71ece1f14f7f0032cef9bd219dba45d7cd1e242
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/80963
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
analysis/org.eclipse.tracecompass.analysis.os.linux.ui.swtbot.tests/src/org/eclipse/tracecompass/analysis/os/linux/ui/swtbot/tests/latency/SystemCallLatencyTableAnalysisTest.java
analysis/org.eclipse.tracecompass.analysis.os.linux.ui/plugin.properties
analysis/org.eclipse.tracecompass.analysis.os.linux.ui/plugin.xml
analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyDensityView.java
analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyTableViewer.java [deleted file]
analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyView.java [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java

index 358d252e856889d243384c9a304d30dacb0e95db..28e04514655f12c80288adb866ae40bccb48ee3d 100644 (file)
@@ -31,9 +31,9 @@ import org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreP
 import org.eclipse.tracecompass.analysis.timing.ui.swtbot.tests.table.SegmentTableTest;
 import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table.AbstractSegmentStoreTableView;
 import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table.AbstractSegmentStoreTableViewer;
+import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table.SegmentStoreTableView;
 import org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCall;
 import org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCallLatencyAnalysis;
-import org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.latency.SystemCallLatencyView;
 import org.eclipse.tracecompass.segmentstore.core.ISegment;
 import org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace;
 import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.ConditionHelpers;
@@ -56,7 +56,9 @@ public class SystemCallLatencyTableAnalysisTest extends SegmentTableTest {
 
     private static final String TRACE_TYPE = "org.eclipse.linuxtools.lttng2.kernel.tracetype";
     private static final String PROJECT_NAME = "test";
-    static final String VIEW_ID = SystemCallLatencyView.ID;
+
+    private static final String PRIMARY_VIEW_ID = SegmentStoreTableView.ID;
+    private static final String SECONDARY_VIEW_ID = SystemCallLatencyAnalysis.ID;
     private static final SystemCallLatencyAnalysis fSystemCallLatencyAnalysis = new SystemCallLatencyAnalysis();
 
     @Override
@@ -77,9 +79,9 @@ public class SystemCallLatencyTableAnalysisTest extends SegmentTableTest {
         /*
          * Open latency view
          */
-        SWTBotUtils.openView(VIEW_ID);
+        SWTBotUtils.openView(PRIMARY_VIEW_ID, SECONDARY_VIEW_ID);
         SWTWorkbenchBot bot = new SWTWorkbenchBot();
-        SWTBotView viewBot = bot.viewById(VIEW_ID);
+        SWTBotView viewBot = bot.viewById(PRIMARY_VIEW_ID);
         final IViewReference viewReference = viewBot.getViewReference();
         IViewPart viewPart = UIThreadRunnable.syncExec(new Result<IViewPart>() {
             @Override
@@ -88,10 +90,10 @@ public class SystemCallLatencyTableAnalysisTest extends SegmentTableTest {
             }
         });
         assertNotNull(viewPart);
-        if (!(viewPart instanceof SystemCallLatencyView)) {
+        if (!(viewPart instanceof SegmentStoreTableView)) {
             fail("Could not instanciate view");
         }
-        return (SystemCallLatencyView) viewPart;
+        return (SegmentStoreTableView) viewPart;
     }
 
     @Override
@@ -136,7 +138,7 @@ public class SystemCallLatencyTableAnalysisTest extends SegmentTableTest {
         String tracePath;
         tracePath = FileLocator.toFileURL(CtfTestTrace.ARM_64_BIT_HEADER.getTraceURL()).getPath();
         SWTWorkbenchBot bot = new SWTWorkbenchBot();
-        SWTBotView view = bot.viewById(VIEW_ID);
+        SWTBotView view = bot.viewById(PRIMARY_VIEW_ID);
         view.close();
         bot.waitUntil(ConditionHelpers.ViewIsClosed(view));
         SWTBotUtils.createProject(PROJECT_NAME);
index 2826638360a2849afc7aef0feba4eaa4b707cfde..03db5763cbbd4c75b8b2e7705e58ad6ae4332b92 100644 (file)
@@ -19,7 +19,7 @@ controlflow.view.name = Control Flow
 resources.view.name = Resources
 cpuusage.view.name = CPU Usage
 
-latency.view.name = System Call Latencies
+latency.table.view.name = System Call Latencies
 latency.scatter.view.name = System Call Latency vs Time
 latency.stats.view.name = System Call Latency Statistics
 latency.density.view.name = System Call Density
index 0137f5b79782d854ee03236b93842642766cd4e4..5dde761bc4ddafaf27e0d4b1eca882b39266fc52 100644 (file)
             restorable="true">
       </view>
       <view
-            allowMultiple="false"
             category="org.eclipse.linuxtools.lttng2.ui.views.category"
-            class="org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.latency.SystemCallLatencyView"
+            class="org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table.SegmentStoreTableView"
             icon="icons/eview16/latency.png"
-            id="org.eclipse.tracecompass.analysis.os.linux.views.latency"
-            name="%latency.view.name"
+            id="org.eclipse.tracecompass.analysis.timing.ui.segstore.table:org.eclipse.tracecompass.analysis.os.linux.latency.syscall"
+            name="%latency.table.view.name"
             restorable="true">
       </view>
       <view
       </output>
       <output
             class="org.eclipse.tracecompass.tmf.ui.analysis.TmfAnalysisViewOutput"
-            id="org.eclipse.tracecompass.analysis.os.linux.views.latency">
+            id="org.eclipse.tracecompass.analysis.timing.ui.segstore.table:org.eclipse.tracecompass.analysis.os.linux.latency.syscall">
          <analysisModuleClass
                class="org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCallLatencyAnalysis">
          </analysisModuleClass>
index 1f4617f4a4c9a5b5951b6457539c38e4b57c49ce..8299fc71ea048864df5a798c6a66f6aa0abc165e 100644 (file)
@@ -16,6 +16,8 @@ import org.eclipse.swt.widgets.Table;
 import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.density.AbstractSegmentStoreDensityView;
 import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.density.AbstractSegmentStoreDensityViewer;
 import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table.AbstractSegmentStoreTableViewer;
+import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table.SegmentStoreTableViewer;
+import org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCallLatencyAnalysis;
 
 /**
  * System Call Density view
@@ -37,7 +39,7 @@ public class SystemCallLatencyDensityView extends AbstractSegmentStoreDensityVie
 
     @Override
     protected AbstractSegmentStoreTableViewer createSegmentStoreTableViewer(Composite parent) {
-        return new SystemCallLatencyTableViewer(new TableViewer(parent, SWT.FULL_SELECTION | SWT.VIRTUAL)) {
+        return new SegmentStoreTableViewer(new TableViewer(parent, SWT.FULL_SELECTION | SWT.VIRTUAL), SystemCallLatencyAnalysis.ID) {
             @Override
             protected void createProviderColumns() {
                 super.createProviderColumns();
diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyTableViewer.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyTableViewer.java
deleted file mode 100644 (file)
index 83ba187..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015, 2016 Ericsson
- *
- * 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:
- *   France Lapointe Nguyen - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.latency;
-
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider;
-import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table.AbstractSegmentStoreTableViewer;
-import org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCallLatencyAnalysis;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
-
-/**
- * Displays the latency analysis data in a column table
- *
- * @author France Lapointe Nguyen
- */
-public class SystemCallLatencyTableViewer extends AbstractSegmentStoreTableViewer {
-
-    // ------------------------------------------------------------------------
-    // Constructor
-    // ------------------------------------------------------------------------
-
-    /**
-     * Constructor
-     *
-     * @param tableViewer
-     *            The table viewer
-     */
-    public SystemCallLatencyTableViewer(TableViewer tableViewer) {
-        super(tableViewer);
-    }
-
-    // ------------------------------------------------------------------------
-    // Operations
-    // ------------------------------------------------------------------------
-
-    @Override
-    protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(ITmfTrace trace) {
-          return TmfTraceUtils.getAnalysisModuleOfClass(trace, SystemCallLatencyAnalysis.class, SystemCallLatencyAnalysis.ID);
-    }
-}
diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyView.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyView.java
deleted file mode 100644 (file)
index 22b1d8b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015, 2016 Ericsson
- *
- * 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:
- *   France Lapointe Nguyen - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.latency;
-
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table.AbstractSegmentStoreTableView;
-import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table.AbstractSegmentStoreTableViewer;
-
-/**
- * View for the latency analysis
- *
- * @author France Lapointe Nguyen
- */
-public class SystemCallLatencyView extends AbstractSegmentStoreTableView {
-
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-
-    /** The view's ID */
-    public static final String ID = "org.eclipse.tracecompass.analysis.os.linux.views.latency"; //$NON-NLS-1$
-
-    // ------------------------------------------------------------------------
-    // Constructor
-    // ------------------------------------------------------------------------
-
-    @Override
-    protected AbstractSegmentStoreTableViewer createSegmentStoreViewer(TableViewer tableViewer) {
-        return new SystemCallLatencyTableViewer(tableViewer);
-    }
-}
index dc2189419a885ef14ce8b340d1125caf97989ba2..3809a3f3ff279e9d995afc48a47600e06628dad2 100644 (file)
@@ -31,6 +31,7 @@ import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.jface.bindings.keys.IKeyLookup;
 import org.eclipse.jface.bindings.keys.KeyStroke;
 import org.eclipse.jface.bindings.keys.ParseException;
@@ -80,6 +81,7 @@ import org.eclipse.tracecompass.tmf.ui.views.TracingPerspectiveFactory;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.WorkbenchException;
@@ -761,12 +763,28 @@ public final class SWTBotUtils {
      *            view id.
      */
     public static void openView(final String id) {
+        openView(id, null);
+    }
+
+    /**
+     * Open a view by id and secondary id
+     *
+     * @param id
+     *            view id.
+     * @param secondaryId
+     *            The secondary ID
+     */
+    public static void openView(final String id, final @Nullable String secondaryId) {
         final PartInitException res[] = new PartInitException[1];
         UIThreadRunnable.syncExec(new VoidResult() {
             @Override
             public void run() {
                 try {
-                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(id);
+                    if (secondaryId == null) {
+                        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(id);
+                    } else {
+                        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(id, secondaryId, IWorkbenchPage.VIEW_ACTIVATE);
+                    }
                 } catch (PartInitException e) {
                     res[0] = e;
                 }
This page took 0.030539 seconds and 5 git commands to generate.