From: Geneviève Bastien Date: Thu, 22 Sep 2016 01:45:28 +0000 (-0400) Subject: os.linux: Remove latency table view and use the one from timing X-Git-Url: http://git.efficios.com/?p=deliverable%2Ftracecompass.git;a=commitdiff_plain;h=43439230e2184842a9d75552a2e944beb181c267 os.linux: Remove latency table view and use the one from timing 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 Reviewed-on: https://git.eclipse.org/r/80963 Reviewed-by: Hudson CI Reviewed-by: Matthew Khouzam Tested-by: Matthew Khouzam --- diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui.swtbot.tests/src/org/eclipse/tracecompass/analysis/os/linux/ui/swtbot/tests/latency/SystemCallLatencyTableAnalysisTest.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui.swtbot.tests/src/org/eclipse/tracecompass/analysis/os/linux/ui/swtbot/tests/latency/SystemCallLatencyTableAnalysisTest.java index 358d252e85..28e0451465 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui.swtbot.tests/src/org/eclipse/tracecompass/analysis/os/linux/ui/swtbot/tests/latency/SystemCallLatencyTableAnalysisTest.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui.swtbot.tests/src/org/eclipse/tracecompass/analysis/os/linux/ui/swtbot/tests/latency/SystemCallLatencyTableAnalysisTest.java @@ -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() { @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); diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/plugin.properties b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/plugin.properties index 2826638360..03db5763cb 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/plugin.properties +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/plugin.properties @@ -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 diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/plugin.xml b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/plugin.xml index 0137f5b797..5dde761bc4 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/plugin.xml +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/plugin.xml @@ -31,12 +31,11 @@ restorable="true"> + id="org.eclipse.tracecompass.analysis.timing.ui.segstore.table:org.eclipse.tracecompass.analysis.os.linux.latency.syscall"> diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyDensityView.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyDensityView.java index 1f4617f4a4..8299fc71ea 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyDensityView.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyDensityView.java @@ -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 index 83ba1876d4..0000000000 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyTableViewer.java +++ /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 index 22b1d8b7f6..0000000000 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyView.java +++ /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); - } -} diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java index dc2189419a..3809a3f3ff 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java @@ -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; }