From 58ecfaa78500ff806a2ea3dad014667de03cd0b1 Mon Sep 17 00:00:00 2001 From: Matthew Khouzam Date: Mon, 9 May 2016 10:42:59 -0400 Subject: [PATCH] linux.ui: Add Operating System Overview Perspective When solving a problem, one must locate it before they can identify it. The current LTTng Kernel perspective is very good at identifying problems but its views are mostly useful when a user is zoomed in. This perspective, allows users to locate problem using metrics that they are used to: CPU usage, Memory usage and IO usage, just like system monitors in Linux[1] and Windows[2]. This perspective is intended to be used in tandem with the LTTng Kernel perspective as this one can hone in on an issue and the Kernel perspective can figure out the problem. [1] http://static.thegeekstuff.com/wp-content/uploads/2009/10/system-monitor-resources.png [2] http://www.windows7library.com/blog/wp-content/uploads/2011/04/Resource-Monitor.jpg Change-Id: I0465b5bd61dc6cca6e8b6f78adbf2969df6f5481 Signed-off-by: Matthew Khouzam Reviewed-on: https://git.eclipse.org/r/72303 Reviewed-by: Hudson CI Reviewed-by: Genevieve Bastien Tested-by: Genevieve Bastien --- .../icons/obj16/os_overview.png | Bin 0 -> 231 bytes .../plugin.properties | 2 + .../plugin.xml | 9 +++ .../KernelOverviewPerspectiveFactory.java | 75 ++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 analysis/org.eclipse.tracecompass.analysis.os.linux.ui/icons/obj16/os_overview.png create mode 100644 analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/perspectives/KernelOverviewPerspectiveFactory.java diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/icons/obj16/os_overview.png b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/icons/obj16/os_overview.png new file mode 100644 index 0000000000000000000000000000000000000000..bd17f33179a592cfddf15ac7bbbc7feab80ecaa0 GIT binary patch literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vfe + + + + diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/perspectives/KernelOverviewPerspectiveFactory.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/perspectives/KernelOverviewPerspectiveFactory.java new file mode 100644 index 0000000000..8833dd53a3 --- /dev/null +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/perspectives/KernelOverviewPerspectiveFactory.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * Copyright (c) 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 + *******************************************************************************/ + +package org.eclipse.tracecompass.internal.analysis.os.linux.ui.perspectives; + +import org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.cpuusage.CpuUsageView; +import org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.io.diskioactivity.DiskIOActivityView; +import org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.kernelmemoryusage.KernelMemoryUsageView; +import org.eclipse.tracecompass.tmf.ui.project.wizards.NewTmfProjectWizard; +import org.eclipse.tracecompass.tmf.ui.views.histogram.HistogramView; +import org.eclipse.ui.IFolderLayout; +import org.eclipse.ui.IPageLayout; +import org.eclipse.ui.IPerspectiveFactory; + +/** + * The overview perspective. This perspective is useful for locating problem + * areas in a kernel trace. + * + * @author Matthew Khouzam + */ +public class KernelOverviewPerspectiveFactory implements IPerspectiveFactory { + + /** Perspective ID */ + public static final String ID = "org.eclipse.tracecompass.analysis.os.linux.ui.perspective"; //$NON-NLS-1$ + + // LTTng views + private static final String HISTOGRAM_VIEW_ID = HistogramView.ID; + private static final String CPU_VIEW_ID = CpuUsageView.ID; + private static final String MEMORY_VIEW_ID = KernelMemoryUsageView.ID; + private static final String DISK_VIEW_ID = DiskIOActivityView.ID; + + // Standard Eclipse views + private static final String PROJECT_VIEW_ID = IPageLayout.ID_PROJECT_EXPLORER; + private static final String BOOKMARKS_VIEW_ID = IPageLayout.ID_BOOKMARKS; + + @Override + public void createInitialLayout(IPageLayout layout) { + + layout.setEditorAreaVisible(true); + + // Create the top left folder + IFolderLayout topLeftFolder = layout.createFolder( + "topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ + topLeftFolder.addView(PROJECT_VIEW_ID); + + // Create the top right folder + IFolderLayout topFolders[] = new IFolderLayout[3]; + topFolders[0] = layout.createFolder( + "topFolder1", IPageLayout.TOP, 1.0f/5.0f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ + topFolders[0].addView(CPU_VIEW_ID); + // Create the top right folder + topFolders[1] = layout.createFolder( + "topFolder2", IPageLayout.TOP, 1.0f/4.0f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ + topFolders[1].addView(DISK_VIEW_ID); + // Create the top right folder + topFolders[2] = layout.createFolder( + "topFolders3", IPageLayout.TOP, 1.0f/3.0f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ + topFolders[2].addView(MEMORY_VIEW_ID); + + // Create the bottom right folder + IFolderLayout bottomRightFolder = layout.createFolder( + "bottomRightFolder", IPageLayout.BOTTOM, 0.50f, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ + bottomRightFolder.addView(HISTOGRAM_VIEW_ID); + bottomRightFolder.addView(BOOKMARKS_VIEW_ID); + + layout.addNewWizardShortcut(NewTmfProjectWizard.ID); + } + +} -- 2.34.1